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/ntp/ntp_login_handler.h" | 5 #include "chrome/browser/ui/webui/ntp/ntp_login_handler.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
11 #include "base/metrics/histogram.h" | 11 #include "base/metrics/histogram.h" |
12 #include "base/utf_string_conversions.h" | 12 #include "base/utf_string_conversions.h" |
13 #include "base/values.h" | 13 #include "base/values.h" |
14 #include "chrome/browser/browser_process.h" | 14 #include "chrome/browser/browser_process.h" |
15 #include "chrome/browser/managed_mode.h" | |
15 #include "chrome/browser/prefs/pref_notifier.h" | 16 #include "chrome/browser/prefs/pref_notifier.h" |
16 #include "chrome/browser/prefs/pref_service.h" | 17 #include "chrome/browser/prefs/pref_service.h" |
17 #include "chrome/browser/profiles/profile.h" | 18 #include "chrome/browser/profiles/profile.h" |
18 #include "chrome/browser/profiles/profile_info_cache.h" | 19 #include "chrome/browser/profiles/profile_info_cache.h" |
19 #include "chrome/browser/profiles/profile_manager.h" | 20 #include "chrome/browser/profiles/profile_manager.h" |
20 #include "chrome/browser/profiles/profile_metrics.h" | 21 #include "chrome/browser/profiles/profile_metrics.h" |
21 #include "chrome/browser/sync/profile_sync_service.h" | 22 #include "chrome/browser/sync/profile_sync_service.h" |
22 #include "chrome/browser/sync/profile_sync_service_factory.h" | 23 #include "chrome/browser/sync/profile_sync_service_factory.h" |
23 #include "chrome/browser/ui/browser.h" | 24 #include "chrome/browser/ui/browser.h" |
24 #include "chrome/browser/ui/browser_list.h" | 25 #include "chrome/browser/ui/browser_list.h" |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
130 return; | 131 return; |
131 | 132 |
132 if (username.empty()) { | 133 if (username.empty()) { |
133 #if !defined(OS_ANDROID) | 134 #if !defined(OS_ANDROID) |
134 // The user isn't signed in, show the sync promo. | 135 // The user isn't signed in, show the sync promo. |
135 if (SyncPromoUI::ShouldShowSyncPromo(profile)) { | 136 if (SyncPromoUI::ShouldShowSyncPromo(profile)) { |
136 browser->ShowSyncSetup(SyncPromoUI::SOURCE_NTP_LINK); | 137 browser->ShowSyncSetup(SyncPromoUI::SOURCE_NTP_LINK); |
137 RecordInHistogram(NTP_SIGN_IN_PROMO_CLICKED); | 138 RecordInHistogram(NTP_SIGN_IN_PROMO_CLICKED); |
138 } | 139 } |
139 #endif | 140 #endif |
140 } else if (args->GetSize() == 4) { | 141 } else if (args->GetSize() == 4 && |
142 !ManagedMode::IsInManagedMode()) { | |
sail
2012/04/25 18:02:46
I don't think this is a good way to disable the pr
Bernhard Bauer
2012/04/26 16:46:15
Good idea. Done.
| |
141 // The user is signed in, show the profiles menu. | 143 // The user is signed in, show the profiles menu. |
142 double x = 0; | 144 double x = 0; |
143 double y = 0; | 145 double y = 0; |
144 double width = 0; | 146 double width = 0; |
145 double height = 0; | 147 double height = 0; |
146 bool success = args->GetDouble(0, &x); | 148 bool success = args->GetDouble(0, &x); |
147 DCHECK(success); | 149 DCHECK(success); |
148 success = args->GetDouble(1, &y); | 150 success = args->GetDouble(1, &y); |
149 DCHECK(success); | 151 DCHECK(success); |
150 success = args->GetDouble(2, &width); | 152 success = args->GetDouble(2, &width); |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
266 l10n_util::GetStringFUTF16(IDS_SYNC_PROMO_NTP_BUBBLE_MESSAGE, | 268 l10n_util::GetStringFUTF16(IDS_SYNC_PROMO_NTP_BUBBLE_MESSAGE, |
267 l10n_util::GetStringUTF16(IDS_SHORT_PRODUCT_NAME))); | 269 l10n_util::GetStringUTF16(IDS_SHORT_PRODUCT_NAME))); |
268 values->SetString("login_status_url", chrome::kSyncLearnMoreURL); | 270 values->SetString("login_status_url", chrome::kSyncLearnMoreURL); |
269 values->SetString("login_status_learn_more", | 271 values->SetString("login_status_learn_more", |
270 l10n_util::GetStringUTF16(IDS_LEARN_MORE)); | 272 l10n_util::GetStringUTF16(IDS_LEARN_MORE)); |
271 values->SetString("login_status_advanced", | 273 values->SetString("login_status_advanced", |
272 l10n_util::GetStringUTF16(IDS_SYNC_PROMO_NTP_BUBBLE_ADVANCED)); | 274 l10n_util::GetStringUTF16(IDS_SYNC_PROMO_NTP_BUBBLE_ADVANCED)); |
273 values->SetString("login_status_dismiss", | 275 values->SetString("login_status_dismiss", |
274 l10n_util::GetStringUTF16(IDS_SYNC_PROMO_NTP_BUBBLE_OK)); | 276 l10n_util::GetStringUTF16(IDS_SYNC_PROMO_NTP_BUBBLE_OK)); |
275 } | 277 } |
OLD | NEW |