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

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

Issue 9814030: get rid of old options pages (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: more fixes Created 8 years, 9 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/utf_string_conversions.h" 8 #include "base/utf_string_conversions.h"
9 #include "chrome/browser/browser_process.h" 9 #include "chrome/browser/browser_process.h"
10 #include "chrome/browser/first_run/first_run.h" 10 #include "chrome/browser/first_run/first_run.h"
11 #include "chrome/browser/google/google_util.h" 11 #include "chrome/browser/google/google_util.h"
12 #include "chrome/browser/prefs/pref_service.h" 12 #include "chrome/browser/prefs/pref_service.h"
13 #include "chrome/browser/profiles/profile.h" 13 #include "chrome/browser/profiles/profile.h"
14 #include "chrome/browser/profiles/profile_info_cache.h" 14 #include "chrome/browser/profiles/profile_info_cache.h"
15 #include "chrome/browser/profiles/profile_manager.h" 15 #include "chrome/browser/profiles/profile_manager.h"
16 #include "chrome/browser/sync/profile_sync_service.h" 16 #include "chrome/browser/sync/profile_sync_service.h"
17 #include "chrome/browser/sync/profile_sync_service_factory.h" 17 #include "chrome/browser/sync/profile_sync_service_factory.h"
18 #include "chrome/browser/ui/webui/chrome_url_data_manager.h" 18 #include "chrome/browser/ui/webui/chrome_url_data_manager.h"
19 #include "chrome/browser/ui/webui/chrome_web_ui_data_source.h" 19 #include "chrome/browser/ui/webui/chrome_web_ui_data_source.h"
20 #include "chrome/browser/ui/webui/options/core_options_handler.h" 20 #include "chrome/browser/ui/webui/options2/core_options_handler2.h"
21 #include "chrome/browser/ui/webui/sync_promo/sync_promo_handler.h" 21 #include "chrome/browser/ui/webui/sync_promo/sync_promo_handler.h"
22 #include "chrome/browser/ui/webui/sync_promo/sync_promo_trial.h" 22 #include "chrome/browser/ui/webui/sync_promo/sync_promo_trial.h"
23 #include "chrome/browser/ui/webui/theme_source.h" 23 #include "chrome/browser/ui/webui/theme_source.h"
24 #include "chrome/common/chrome_switches.h" 24 #include "chrome/common/chrome_switches.h"
25 #include "chrome/common/pref_names.h" 25 #include "chrome/common/pref_names.h"
26 #include "chrome/common/url_constants.h" 26 #include "chrome/common/url_constants.h"
27 #include "content/public/browser/web_contents.h" 27 #include "content/public/browser/web_contents.h"
28 #include "content/public/browser/web_ui.h" 28 #include "content/public/browser/web_ui.h"
29 #include "googleurl/src/url_util.h" 29 #include "googleurl/src/url_util.h"
30 #include "grit/browser_resources.h" 30 #include "grit/browser_resources.h"
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 explicit SyncPromoUIHTMLSource(content::WebUI* web_ui); 73 explicit SyncPromoUIHTMLSource(content::WebUI* web_ui);
74 74
75 private: 75 private:
76 ~SyncPromoUIHTMLSource() {} 76 ~SyncPromoUIHTMLSource() {}
77 DISALLOW_COPY_AND_ASSIGN(SyncPromoUIHTMLSource); 77 DISALLOW_COPY_AND_ASSIGN(SyncPromoUIHTMLSource);
78 }; 78 };
79 79
80 SyncPromoUIHTMLSource::SyncPromoUIHTMLSource(content::WebUI* web_ui) 80 SyncPromoUIHTMLSource::SyncPromoUIHTMLSource(content::WebUI* web_ui)
81 : ChromeWebUIDataSource(chrome::kChromeUISyncPromoHost) { 81 : ChromeWebUIDataSource(chrome::kChromeUISyncPromoHost) {
82 DictionaryValue localized_strings; 82 DictionaryValue localized_strings;
83 CoreOptionsHandler::GetStaticLocalizedValues(&localized_strings); 83 options2::CoreOptionsHandler::GetStaticLocalizedValues(&localized_strings);
84 SyncSetupHandler::GetStaticLocalizedValues(&localized_strings, web_ui); 84 SyncSetupHandler::GetStaticLocalizedValues(&localized_strings, web_ui);
85 AddLocalizedStrings(localized_strings); 85 AddLocalizedStrings(localized_strings);
86 } 86 }
87 87
88 // Looks for |search_key| in the query portion of |url|. Returns true if the 88 // Looks for |search_key| in the query portion of |url|. Returns true if the
89 // key is found and sets |out_value| to the value for the key. Returns false if 89 // key is found and sets |out_value| to the value for the key. Returns false if
90 // the key is not found. 90 // the key is not found.
91 bool GetValueForKeyInQuery(const GURL& url, const std::string& search_key, 91 bool GetValueForKeyInQuery(const GURL& url, const std::string& search_key,
92 std::string* out_value) { 92 std::string* out_value) {
93 url_parse::Component query = url.parsed_for_possibly_invalid_spec().query; 93 url_parse::Component query = url.parsed_for_possibly_invalid_spec().query;
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after
275 } 275 }
276 return GURL(); 276 return GURL();
277 } 277 }
278 278
279 // static 279 // static
280 std::string SyncPromoUI::GetSourceForSyncPromoURL(const GURL& url) { 280 std::string SyncPromoUI::GetSourceForSyncPromoURL(const GURL& url) {
281 std::string value; 281 std::string value;
282 return GetValueForKeyInQuery(url, kSyncPromoQueryKeySource, &value) ? 282 return GetValueForKeyInQuery(url, kSyncPromoQueryKeySource, &value) ?
283 value : std::string(); 283 value : std::string();
284 } 284 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698