OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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" |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 *out_value = ""; | 98 *out_value = ""; |
99 return true; | 99 return true; |
100 } | 100 } |
101 } | 101 } |
102 } | 102 } |
103 return false; | 103 return false; |
104 } | 104 } |
105 | 105 |
106 } // namespace | 106 } // namespace |
107 | 107 |
108 SyncPromoUI::SyncPromoUI(WebContents* contents) : WebUI(contents) { | 108 SyncPromoUI::SyncPromoUI(WebContents* contents) : WebUI(contents, this) { |
109 should_hide_url_ = true; | 109 should_hide_url_ = true; |
110 | 110 |
111 SyncPromoHandler* handler = new SyncPromoHandler( | 111 SyncPromoHandler* handler = new SyncPromoHandler( |
112 g_browser_process->profile_manager()); | 112 g_browser_process->profile_manager()); |
113 AddMessageHandler(handler); | 113 AddMessageHandler(handler); |
114 | 114 |
115 // Set up the chrome://theme/ source. | 115 // Set up the chrome://theme/ source. |
116 Profile* profile = Profile::FromBrowserContext(contents->GetBrowserContext()); | 116 Profile* profile = Profile::FromBrowserContext(contents->GetBrowserContext()); |
117 ThemeSource* theme = new ThemeSource(profile); | 117 ThemeSource* theme = new ThemeSource(profile); |
118 profile->GetChromeURLDataManager()->AddDataSource(theme); | 118 profile->GetChromeURLDataManager()->AddDataSource(theme); |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
268 UTF16ToUTF8(output.data(), output.length(), &url); | 268 UTF16ToUTF8(output.data(), output.length(), &url); |
269 return GURL(url); | 269 return GURL(url); |
270 } | 270 } |
271 return GURL(); | 271 return GURL(); |
272 } | 272 } |
273 | 273 |
274 // static | 274 // static |
275 bool SyncPromoUI::UserHasSeenSyncPromoAtStartup(Profile* profile) { | 275 bool SyncPromoUI::UserHasSeenSyncPromoAtStartup(Profile* profile) { |
276 return profile->GetPrefs()->GetInteger(prefs::kSyncPromoStartupCount) > 0; | 276 return profile->GetPrefs()->GetInteger(prefs::kSyncPromoStartupCount) > 0; |
277 } | 277 } |
OLD | NEW |