Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: src/plugin/PluginUtil.cpp

Issue 5469643829411840: Issue 1795 - Add helper std::wstring GetLocationUrl(IWebBrowser2& browser) (Closed)
Patch Set: get rid of variable in the function body Created Jan. 29, 2015, 12:38 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« src/plugin/PluginUtil.h ('K') | « src/plugin/PluginUtil.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/plugin/PluginUtil.cpp
diff --git a/src/plugin/PluginUtil.cpp b/src/plugin/PluginUtil.cpp
index fe7acb6b7c81194819966308eab9b1cef9238f4b..aeb19f6f28dfce10785c12f05f2efc8f60822760 100644
--- a/src/plugin/PluginUtil.cpp
+++ b/src/plugin/PluginUtil.cpp
@@ -1,20 +1,20 @@
-/*
- * This file is part of Adblock Plus <https://adblockplus.org/>,
- * Copyright (C) 2006-2015 Eyeo GmbH
- *
- * Adblock Plus is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 3 as
- * published by the Free Software Foundation.
- *
- * Adblock Plus is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>.
- */
-
+/*
+ * This file is part of Adblock Plus <https://adblockplus.org/>,
+ * Copyright (C) 2006-2015 Eyeo GmbH
+ *
+ * Adblock Plus is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 3 as
+ * published by the Free Software Foundation.
+ *
+ * Adblock Plus is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>.
+ */
+
#include "PluginStdAfx.h"
#include <algorithm>
#include <stdexcept>
@@ -45,3 +45,13 @@ std::wstring FileUrl(const std::wstring& path)
std::replace(url.begin(), url.end(), L'\\', L'/');
return L"file:///" + url;
}
+
+std::wstring GetLocationUrl(IWebBrowser2& browser)
+{
+ ATL::CComBSTR locationUrl;
+ if (FAILED(browser.get_LocationURL(&locationUrl)) || !locationUrl)
+ {
+ return std::wstring();
+ }
+ return std::wstring(locationUrl, locationUrl.Length());
+}
« src/plugin/PluginUtil.h ('K') | « src/plugin/PluginUtil.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld