| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/app_list/google_now_extension.h" | 5 #include "chrome/browser/ui/app_list/google_now_extension.h" |
| 6 | 6 |
| 7 #include "base/prefs/pref_service.h" | |
| 8 #include "chrome/browser/notifications/notifier_state_tracker.h" | 7 #include "chrome/browser/notifications/notifier_state_tracker.h" |
| 9 #include "chrome/browser/notifications/notifier_state_tracker_factory.h" | 8 #include "chrome/browser/notifications/notifier_state_tracker_factory.h" |
| 10 #include "chrome/browser/profiles/profile.h" | 9 #include "chrome/browser/profiles/profile.h" |
| 11 #include "chrome/common/pref_names.h" | 10 #include "chrome/common/pref_names.h" |
| 11 #include "components/prefs/pref_service.h" |
| 12 #include "components/variations/variations_associated_data.h" | 12 #include "components/variations/variations_associated_data.h" |
| 13 #include "ui/message_center/notifier_settings.h" | 13 #include "ui/message_center/notifier_settings.h" |
| 14 | 14 |
| 15 namespace { | 15 namespace { |
| 16 const char kGoogleNowExtensionFieldTrialName[] = "GoogleNowExtension"; | 16 const char kGoogleNowExtensionFieldTrialName[] = "GoogleNowExtension"; |
| 17 | 17 |
| 18 // Extension ID for previous Now notifications component. | 18 // Extension ID for previous Now notifications component. |
| 19 const char kNowNotifierId[] = "pafkbggdmjlpgkdkcbjmhmfcdpncadgh"; | 19 const char kNowNotifierId[] = "pafkbggdmjlpgkdkcbjmhmfcdpncadgh"; |
| 20 }; // namespace | 20 }; // namespace |
| 21 | 21 |
| (...skipping 18 matching lines...) Expand all Loading... |
| 40 if (!enabled_pref->IsDefaultValue()) | 40 if (!enabled_pref->IsDefaultValue()) |
| 41 return; | 41 return; |
| 42 | 42 |
| 43 NotifierStateTracker* const notifier_state_tracker = | 43 NotifierStateTracker* const notifier_state_tracker = |
| 44 NotifierStateTrackerFactory::GetForProfile(profile); | 44 NotifierStateTrackerFactory::GetForProfile(profile); |
| 45 bool notifier_enabled = notifier_state_tracker->IsNotifierEnabled( | 45 bool notifier_enabled = notifier_state_tracker->IsNotifierEnabled( |
| 46 message_center::NotifierId( | 46 message_center::NotifierId( |
| 47 message_center::NotifierId::APPLICATION, kNowNotifierId)); | 47 message_center::NotifierId::APPLICATION, kNowNotifierId)); |
| 48 prefs->SetBoolean(prefs::kGoogleNowLauncherEnabled, notifier_enabled); | 48 prefs->SetBoolean(prefs::kGoogleNowLauncherEnabled, notifier_enabled); |
| 49 } | 49 } |
| OLD | NEW |