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

Side by Side 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.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« src/plugin/PluginUtil.h ('K') | « src/plugin/PluginUtil.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #include "PluginStdAfx.h" 1 #include "PluginStdAfx.h"
2 #include <algorithm> 2 #include <algorithm>
3 #include <stdexcept> 3 #include <stdexcept>
4 #include <vector> 4 #include <vector>
5 5
6 #include "../shared/Utils.h" 6 #include "../shared/Utils.h"
7 #include "PluginUtil.h" 7 #include "PluginUtil.h"
8 #include "PluginSettings.h" 8 #include "PluginSettings.h"
9 9
10 std::wstring HtmlFolderPath() 10 std::wstring HtmlFolderPath()
(...skipping 10 matching lines...) Expand all
21 { 21 {
22 return FileUrl(HtmlFolderPath() + L"firstRun.html"); 22 return FileUrl(HtmlFolderPath() + L"firstRun.html");
23 } 23 }
24 24
25 std::wstring FileUrl(const std::wstring& path) 25 std::wstring FileUrl(const std::wstring& path)
26 { 26 {
27 std::wstring url = path; 27 std::wstring url = path;
28 std::replace(url.begin(), url.end(), L'\\', L'/'); 28 std::replace(url.begin(), url.end(), L'\\', L'/');
29 return L"file:///" + url; 29 return L"file:///" + url;
30 } 30 }
31
32 std::wstring GetLocationUrl(IWebBrowser2& browser)
33 {
34 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
35 ATL::CComBSTR locationUrl;
36 if (SUCCEEDED(browser.get_LocationURL(&locationUrl)) && !!locationUrl)
Eric 2015/01/13 17:04:20 No need for double negation. Testing a converted p
37 {
38 retValue.assign(locationUrl, locationUrl.Length());
Eric 2015/01/13 17:04:20 return std::wstring(locationUrl, locationUrl.Lengt
39 }
40 return retValue;
Eric 2015/01/13 17:04:20 return L""; -- or -- return std:;wstring();
41 }
OLDNEW
« 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