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: get rid of variable in the function body Created Jan. 29, 2015, 12:38 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 /* 1 /*
2 * This file is part of Adblock Plus <https://adblockplus.org/>, 2 * This file is part of Adblock Plus <https://adblockplus.org/>,
3 * Copyright (C) 2006-2015 Eyeo GmbH 3 * Copyright (C) 2006-2015 Eyeo GmbH
4 * 4 *
5 * Adblock Plus is free software: you can redistribute it and/or modify 5 * Adblock Plus is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 3 as 6 * it under the terms of the GNU General Public License version 3 as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
8 * 8 *
9 * Adblock Plus is distributed in the hope that it will be useful, 9 * Adblock Plus is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 27 matching lines...) Expand all
38 { 38 {
39 return FileUrl(HtmlFolderPath() + L"firstRun.html"); 39 return FileUrl(HtmlFolderPath() + L"firstRun.html");
40 } 40 }
41 41
42 std::wstring FileUrl(const std::wstring& path) 42 std::wstring FileUrl(const std::wstring& path)
43 { 43 {
44 std::wstring url = path; 44 std::wstring url = path;
45 std::replace(url.begin(), url.end(), L'\\', L'/'); 45 std::replace(url.begin(), url.end(), L'\\', L'/');
46 return L"file:///" + url; 46 return L"file:///" + url;
47 } 47 }
48
49 std::wstring GetLocationUrl(IWebBrowser2& browser)
50 {
51 ATL::CComBSTR locationUrl;
52 if (FAILED(browser.get_LocationURL(&locationUrl)) || !locationUrl)
53 {
54 return std::wstring();
55 }
56 return std::wstring(locationUrl, locationUrl.Length());
57 }
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