| 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/ntp/new_tab_page_handler.h" | 5 #include "chrome/browser/ui/webui/ntp/new_tab_page_handler.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
| 9 #include "base/metrics/field_trial.h" | 9 #include "base/metrics/field_trial.h" |
| 10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
| 11 #include "chrome/browser/extensions/default_apps_trial.h" | 11 #include "chrome/browser/extensions/default_apps_trial.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/sync/profile_sync_service.h" | 14 #include "chrome/browser/sync/profile_sync_service.h" |
| 15 #include "chrome/browser/ui/webui/ntp/new_tab_ui.h" | 15 #include "chrome/browser/ui/webui/ntp/new_tab_ui.h" |
| 16 #include "chrome/browser/web_resource/notification_promo.h" | 16 #include "chrome/browser/web_resource/notification_promo.h" |
| 17 #include "chrome/common/chrome_notification_types.h" | 17 #include "chrome/common/chrome_notification_types.h" |
| 18 #include "chrome/common/pref_names.h" | 18 #include "chrome/common/pref_names.h" |
| 19 #include "content/common/notification_service.h" | 19 #include "content/public/browser/notification_service.h" |
| 20 #include "grit/chromium_strings.h" | 20 #include "grit/chromium_strings.h" |
| 21 #include "grit/generated_resources.h" | 21 #include "grit/generated_resources.h" |
| 22 #include "ui/base/l10n/l10n_util.h" | 22 #include "ui/base/l10n/l10n_util.h" |
| 23 | 23 |
| 24 static const int kIntroDisplayMax = 10; | 24 static const int kIntroDisplayMax = 10; |
| 25 | 25 |
| 26 // The URL of a knowledge-base article about the new NTP. | 26 // The URL of a knowledge-base article about the new NTP. |
| 27 static const char kNTP4IntroURL[] = | 27 static const char kNTP4IntroURL[] = |
| 28 "http://www.google.com/support/chrome/bin/answer.py?answer=95451"; | 28 "http://www.google.com/support/chrome/bin/answer.py?answer=95451"; |
| 29 | 29 |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 150 l10n_util::GetStringUTF16(IDS_LEARN_MORE)); | 150 l10n_util::GetStringUTF16(IDS_LEARN_MORE)); |
| 151 } | 151 } |
| 152 } | 152 } |
| 153 | 153 |
| 154 // static | 154 // static |
| 155 void NewTabPageHandler::DismissIntroMessage(PrefService* prefs) { | 155 void NewTabPageHandler::DismissIntroMessage(PrefService* prefs) { |
| 156 prefs->SetInteger(prefs::kNTP4IntroDisplayCount, kIntroDisplayMax + 1); | 156 prefs->SetInteger(prefs::kNTP4IntroDisplayCount, kIntroDisplayMax + 1); |
| 157 } | 157 } |
| 158 | 158 |
| 159 void NewTabPageHandler::NotifyPromoResourceChanged() { | 159 void NewTabPageHandler::NotifyPromoResourceChanged() { |
| 160 NotificationService* service = NotificationService::current(); | 160 content::NotificationService* service = |
| 161 content::NotificationService::current(); |
| 161 service->Notify(chrome::NOTIFICATION_PROMO_RESOURCE_STATE_CHANGED, | 162 service->Notify(chrome::NOTIFICATION_PROMO_RESOURCE_STATE_CHANGED, |
| 162 content::Source<NewTabPageHandler>(this), | 163 content::Source<NewTabPageHandler>(this), |
| 163 NotificationService::NoDetails()); | 164 content::NotificationService::NoDetails()); |
| 164 } | 165 } |
| OLD | NEW |