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: Created Jan. 13, 2015, 3:22 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 a077d4e7e6058fa0cd1361d0ace6ad8f0e3597d8..8b4aa33ba719a02f2042c22f6cefa2f928b9e98a 100644
--- a/src/plugin/PluginUtil.cpp
+++ b/src/plugin/PluginUtil.cpp
@@ -28,3 +28,14 @@ std::wstring FileUrl(const std::wstring& path)
std::replace(url.begin(), url.end(), L'\\', L'/');
return L"file:///" + url;
}
+
+std::wstring GetLocationUrl(IWebBrowser2& browser)
+{
+ std::wstring retValue;
Eric 2015/01/13 17:04:20 Use of this variable requires extraneous assignmen
sergei 2015/01/29 12:42:11 I've changed the body of this function and removed
+ ATL::CComBSTR locationUrl;
+ if (SUCCEEDED(browser.get_LocationURL(&locationUrl)) && !!locationUrl)
Eric 2015/01/13 17:04:20 No need for double negation. Testing a converted p
+ {
+ retValue.assign(locationUrl, locationUrl.Length());
Eric 2015/01/13 17:04:20 return std::wstring(locationUrl, locationUrl.Lengt
+ }
+ return retValue;
Eric 2015/01/13 17:04:20 return L""; -- or -- return std:;wstring();
+}
« 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