| 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/policy/managed_prefs_banner_base.h" | 5 #include "chrome/browser/policy/managed_prefs_banner_base.h" |
| 6 | 6 |
| 7 #include "chrome/browser/browser_process.h" | 7 #include "chrome/browser/browser_process.h" |
| 8 #include "chrome/browser/prefs/pref_service.h" | 8 #include "chrome/browser/prefs/pref_service.h" |
| 9 #include "chrome/browser/prefs/pref_set_observer.h" | 9 #include "chrome/browser/prefs/pref_set_observer.h" |
| 10 #include "chrome/common/chrome_notification_types.h" |
| 10 #include "chrome/common/pref_names.h" | 11 #include "chrome/common/pref_names.h" |
| 11 #include "content/common/notification_details.h" | 12 #include "content/common/notification_details.h" |
| 12 #include "content/common/notification_type.h" | |
| 13 | 13 |
| 14 #if defined(OS_CHROMEOS) | 14 #if defined(OS_CHROMEOS) |
| 15 #include "chrome/browser/chromeos/cros_settings_names.h" | 15 #include "chrome/browser/chromeos/cros_settings_names.h" |
| 16 #endif | 16 #endif |
| 17 | 17 |
| 18 namespace policy { | 18 namespace policy { |
| 19 | 19 |
| 20 ManagedPrefsBannerBase::ManagedPrefsBannerBase(PrefService* user_prefs, | 20 ManagedPrefsBannerBase::ManagedPrefsBannerBase(PrefService* user_prefs, |
| 21 OptionsPage page) { | 21 OptionsPage page) { |
| 22 Init(g_browser_process->local_state(), user_prefs, page); | 22 Init(g_browser_process->local_state(), user_prefs, page); |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 break; | 107 break; |
| 108 #endif | 108 #endif |
| 109 default: | 109 default: |
| 110 NOTREACHED(); | 110 NOTREACHED(); |
| 111 } | 111 } |
| 112 } | 112 } |
| 113 | 113 |
| 114 void ManagedPrefsBannerBase::Observe(NotificationType type, | 114 void ManagedPrefsBannerBase::Observe(NotificationType type, |
| 115 const NotificationSource& source, | 115 const NotificationSource& source, |
| 116 const NotificationDetails& details) { | 116 const NotificationDetails& details) { |
| 117 if (NotificationType::PREF_CHANGED == type) { | 117 if (chrome::PREF_CHANGED == type) { |
| 118 std::string* pref = Details<std::string>(details).ptr(); | 118 std::string* pref = Details<std::string>(details).ptr(); |
| 119 if (pref && (local_state_set_->IsObserved(*pref) || | 119 if (pref && (local_state_set_->IsObserved(*pref) || |
| 120 user_pref_set_->IsObserved(*pref))) | 120 user_pref_set_->IsObserved(*pref))) |
| 121 OnUpdateVisibility(); | 121 OnUpdateVisibility(); |
| 122 } | 122 } |
| 123 } | 123 } |
| 124 | 124 |
| 125 } // namespace policy | 125 } // namespace policy |
| OLD | NEW |