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

Delta Between Two Patch Sets: src/plugin/PluginUtil.cpp

Issue 11043057: First run page triggering (Closed)
Left Patch Set: Created July 11, 2013, 9:49 a.m.
Right Patch Set: Minor refactoring. Renaming and a small cleanup. Created July 26, 2013, 12:05 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « src/plugin/PluginUtil.h ('k') | src/shared/Communication.h » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
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 BString::BString(const std::wstring& value) 10 BString::BString(const std::wstring& value)
11 : value(::SysAllocString(value.c_str())) 11 : value(::SysAllocString(value.c_str()))
12 { 12 {
13 } 13 }
14 14
15 BString::~BString() 15 BString::~BString()
16 { 16 {
17 ::SysFreeString(value); 17 ::SysFreeString(value);
18 } 18 }
19 19
20 BString::operator BSTR() 20 BString::operator BSTR()
21 { 21 {
22 return value; 22 return value;
23 } 23 }
24 24
25 std::wstring HtmlFolderPath()
26 {
27 return GetDllDir() + L"html\\templates\\";
28 }
29
25 std::wstring UserSettingsFileUrl() 30 std::wstring UserSettingsFileUrl()
26 { 31 {
27 return FileUrl(GetDllDir() + L"html\\templates\\index.html"); 32 return FileUrl(HtmlFolderPath() + L"index.html");
28 } 33 }
29 34
30 std::wstring UserSettingsFirstRunPageUrl() 35 std::wstring FirstRunPageFileUrl()
31 { 36 {
32 return FileUrl(GetDllDir() + L"html\\templates\\firstrun.html"); 37 return FileUrl(HtmlFolderPath() + L"firstRun.html");
Wladimir Palant 2013/07/11 11:58:10 This should be firstRun.html even though capitaliz
33 } 38 }
34 39
35 std::wstring FileUrl(const std::wstring& path) 40 std::wstring FileUrl(const std::wstring& path)
36 { 41 {
37 std::wstring url = path; 42 std::wstring url = path;
38 std::replace(url.begin(), url.end(), L'\\', L'/'); 43 std::replace(url.begin(), url.end(), L'\\', L'/');
39 return L"file:///" + url; 44 return L"file:///" + url;
40 } 45 }
41 46
LEFTRIGHT

Powered by Google App Engine
This is Rietveld