OLD | NEW |
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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 explicit SyncPromoUIHTMLSource(content::WebUI* web_ui); | 69 explicit SyncPromoUIHTMLSource(content::WebUI* web_ui); |
70 | 70 |
71 private: | 71 private: |
72 ~SyncPromoUIHTMLSource() {} | 72 ~SyncPromoUIHTMLSource() {} |
73 DISALLOW_COPY_AND_ASSIGN(SyncPromoUIHTMLSource); | 73 DISALLOW_COPY_AND_ASSIGN(SyncPromoUIHTMLSource); |
74 }; | 74 }; |
75 | 75 |
76 SyncPromoUIHTMLSource::SyncPromoUIHTMLSource(content::WebUI* web_ui) | 76 SyncPromoUIHTMLSource::SyncPromoUIHTMLSource(content::WebUI* web_ui) |
77 : ChromeWebUIDataSource(chrome::kChromeUISyncPromoHost) { | 77 : ChromeWebUIDataSource(chrome::kChromeUISyncPromoHost) { |
78 DictionaryValue localized_strings; | 78 DictionaryValue localized_strings; |
79 options2::CoreOptionsHandler::GetStaticLocalizedValues(&localized_strings); | 79 options::CoreOptionsHandler::GetStaticLocalizedValues(&localized_strings); |
80 SyncSetupHandler::GetStaticLocalizedValues(&localized_strings, web_ui); | 80 SyncSetupHandler::GetStaticLocalizedValues(&localized_strings, web_ui); |
81 AddLocalizedStrings(localized_strings); | 81 AddLocalizedStrings(localized_strings); |
82 } | 82 } |
83 | 83 |
84 } // namespace | 84 } // namespace |
85 | 85 |
86 SyncPromoUI::SyncPromoUI(content::WebUI* web_ui) : WebUIController(web_ui) { | 86 SyncPromoUI::SyncPromoUI(content::WebUI* web_ui) : WebUIController(web_ui) { |
87 SyncPromoHandler* handler = new SyncPromoHandler( | 87 SyncPromoHandler* handler = new SyncPromoHandler( |
88 g_browser_process->profile_manager()); | 88 g_browser_process->profile_manager()); |
89 web_ui->AddMessageHandler(handler); | 89 web_ui->AddMessageHandler(handler); |
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
257 bool SyncPromoUI::GetAutoCloseForSyncPromoURL(const GURL& url) { | 257 bool SyncPromoUI::GetAutoCloseForSyncPromoURL(const GURL& url) { |
258 std::string value; | 258 std::string value; |
259 if (chrome_common_net::GetValueForKeyInQuery( | 259 if (chrome_common_net::GetValueForKeyInQuery( |
260 url, kSyncPromoQueryKeyAutoClose, &value)) { | 260 url, kSyncPromoQueryKeyAutoClose, &value)) { |
261 int source = 0; | 261 int source = 0; |
262 base::StringToInt(value, &source); | 262 base::StringToInt(value, &source); |
263 return (source == 1); | 263 return (source == 1); |
264 } | 264 } |
265 return false; | 265 return false; |
266 } | 266 } |
OLD | NEW |