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

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: plugins, ui_account_tweaks fixes 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
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 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 // Set up the chrome://theme/ source. 112 // Set up the chrome://theme/ source.
113 Profile* profile = Profile::FromWebUI(web_ui); 113 Profile* profile = Profile::FromWebUI(web_ui);
114 ThemeSource* theme = new ThemeSource(profile); 114 ThemeSource* theme = new ThemeSource(profile);
115 ChromeURLDataManager::AddDataSource(profile, theme); 115 ChromeURLDataManager::AddDataSource(profile, theme);
116 116
117 // Set up the sync promo source. 117 // Set up the sync promo source.
118 SyncPromoUIHTMLSource* html_source = new SyncPromoUIHTMLSource(web_ui); 118 SyncPromoUIHTMLSource* html_source = new SyncPromoUIHTMLSource(web_ui);
119 html_source->set_json_path(kStringsJsFile); 119 html_source->set_json_path(kStringsJsFile);
120 html_source->add_resource_path(kSyncPromoJsFile, IDR_SYNC_PROMO_JS); 120 html_source->add_resource_path(kSyncPromoJsFile, IDR_SYNC_PROMO_JS);
121 html_source->set_default_resource(IDR_SYNC_PROMO_HTML); 121 html_source->set_default_resource(IDR_SYNC_PROMO_HTML);
122 html_source->set_use_json_js_format_v2();
122 ChromeURLDataManager::AddDataSource(profile, html_source); 123 ChromeURLDataManager::AddDataSource(profile, html_source);
123 124
124 sync_promo_trial::RecordUserShownPromo(web_ui); 125 sync_promo_trial::RecordUserShownPromo(web_ui);
125 } 126 }
126 127
127 // static 128 // static
128 bool SyncPromoUI::HasShownPromoAtStartup(Profile* profile) { 129 bool SyncPromoUI::HasShownPromoAtStartup(Profile* profile) {
129 return profile->GetPrefs()->HasPrefPath(prefs::kSyncPromoStartupCount); 130 return profile->GetPrefs()->HasPrefPath(prefs::kSyncPromoStartupCount);
130 } 131 }
131 132
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
262 std::string value; 263 std::string value;
263 if (GetValueForKeyInQuery(url, kSyncPromoQueryKeySource, &value)) { 264 if (GetValueForKeyInQuery(url, kSyncPromoQueryKeySource, &value)) {
264 int source = 0; 265 int source = 0;
265 if (base::StringToInt(value, &source) && source >= SOURCE_START_PAGE && 266 if (base::StringToInt(value, &source) && source >= SOURCE_START_PAGE &&
266 source < SOURCE_UNKNOWN) { 267 source < SOURCE_UNKNOWN) {
267 return static_cast<Source>(source); 268 return static_cast<Source>(source);
268 } 269 }
269 } 270 }
270 return SOURCE_UNKNOWN; 271 return SOURCE_UNKNOWN;
271 } 272 }
OLDNEW
« chrome/browser/resources/plugins.html ('K') | « 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