Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(222)

Side by Side Diff: chrome/browser/ui/webui/sync_promo/sync_promo_ui.cc

Issue 10391044: retry 136193 - convert localStrings to loadTimeData for options page (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: sync Created 8 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/ui/webui/plugins_ui.cc ('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 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/webui/sync_promo/sync_promo_ui.h" 5 #include "chrome/browser/ui/webui/sync_promo/sync_promo_ui.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/string_number_conversions.h" 8 #include "base/string_number_conversions.h"
9 #include "base/utf_string_conversions.h" 9 #include "base/utf_string_conversions.h"
10 #include "chrome/browser/browser_process.h" 10 #include "chrome/browser/browser_process.h"
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 // Set up the chrome://theme/ source. 90 // Set up the chrome://theme/ source.
91 Profile* profile = Profile::FromWebUI(web_ui); 91 Profile* profile = Profile::FromWebUI(web_ui);
92 ThemeSource* theme = new ThemeSource(profile); 92 ThemeSource* theme = new ThemeSource(profile);
93 ChromeURLDataManager::AddDataSource(profile, theme); 93 ChromeURLDataManager::AddDataSource(profile, theme);
94 94
95 // Set up the sync promo source. 95 // Set up the sync promo source.
96 SyncPromoUIHTMLSource* html_source = new SyncPromoUIHTMLSource(web_ui); 96 SyncPromoUIHTMLSource* html_source = new SyncPromoUIHTMLSource(web_ui);
97 html_source->set_json_path(kStringsJsFile); 97 html_source->set_json_path(kStringsJsFile);
98 html_source->add_resource_path(kSyncPromoJsFile, IDR_SYNC_PROMO_JS); 98 html_source->add_resource_path(kSyncPromoJsFile, IDR_SYNC_PROMO_JS);
99 html_source->set_default_resource(IDR_SYNC_PROMO_HTML); 99 html_source->set_default_resource(IDR_SYNC_PROMO_HTML);
100 html_source->set_use_json_js_format_v2();
100 ChromeURLDataManager::AddDataSource(profile, html_source); 101 ChromeURLDataManager::AddDataSource(profile, html_source);
101 102
102 sync_promo_trial::RecordUserShownPromo(web_ui); 103 sync_promo_trial::RecordUserShownPromo(web_ui);
103 } 104 }
104 105
105 // static 106 // static
106 bool SyncPromoUI::HasShownPromoAtStartup(Profile* profile) { 107 bool SyncPromoUI::HasShownPromoAtStartup(Profile* profile) {
107 return profile->GetPrefs()->HasPrefPath(prefs::kSyncPromoStartupCount); 108 return profile->GetPrefs()->HasPrefPath(prefs::kSyncPromoStartupCount);
108 } 109 }
109 110
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
238 if (chrome_common_net::GetValueForKeyInQuery( 239 if (chrome_common_net::GetValueForKeyInQuery(
239 url, kSyncPromoQueryKeySource, &value)) { 240 url, kSyncPromoQueryKeySource, &value)) {
240 int source = 0; 241 int source = 0;
241 if (base::StringToInt(value, &source) && source >= SOURCE_START_PAGE && 242 if (base::StringToInt(value, &source) && source >= SOURCE_START_PAGE &&
242 source < SOURCE_UNKNOWN) { 243 source < SOURCE_UNKNOWN) {
243 return static_cast<Source>(source); 244 return static_cast<Source>(source);
244 } 245 }
245 } 246 }
246 return SOURCE_UNKNOWN; 247 return SOURCE_UNKNOWN;
247 } 248 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/plugins_ui.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698