| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/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/pref_service.h" | 8 #include "chrome/browser/prefs/pref_service.h" |
| 9 #include "chrome/common/notification_details.h" | 9 #include "chrome/common/notification_details.h" |
| 10 #include "chrome/common/notification_type.h" | 10 #include "chrome/common/notification_type.h" |
| 11 #include "chrome/common/pref_names.h" | 11 #include "chrome/common/pref_names.h" |
| 12 | 12 |
| 13 ManagedPrefsBannerBase::ManagedPrefsBannerBase(PrefService* user_prefs, | 13 ManagedPrefsBannerBase::ManagedPrefsBannerBase(PrefService* user_prefs, |
| 14 OptionsPage page) { | 14 OptionsPage page) { |
| 15 Init(g_browser_process->local_state(), user_prefs, page); | 15 Init(g_browser_process->local_state(), user_prefs, page); |
| 16 } | 16 } |
| 17 | 17 |
| 18 ManagedPrefsBannerBase::ManagedPrefsBannerBase(PrefService* local_state, | 18 ManagedPrefsBannerBase::ManagedPrefsBannerBase(PrefService* local_state, |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 void ManagedPrefsBannerBase::Observe(NotificationType type, | 80 void ManagedPrefsBannerBase::Observe(NotificationType type, |
| 81 const NotificationSource& source, | 81 const NotificationSource& source, |
| 82 const NotificationDetails& details) { | 82 const NotificationDetails& details) { |
| 83 if (NotificationType::PREF_CHANGED == type) { | 83 if (NotificationType::PREF_CHANGED == type) { |
| 84 std::string* pref = Details<std::string>(details).ptr(); | 84 std::string* pref = Details<std::string>(details).ptr(); |
| 85 if (pref && (local_state_set_->IsObserved(*pref) || | 85 if (pref && (local_state_set_->IsObserved(*pref) || |
| 86 user_pref_set_->IsObserved(*pref))) | 86 user_pref_set_->IsObserved(*pref))) |
| 87 OnUpdateVisibility(); | 87 OnUpdateVisibility(); |
| 88 } | 88 } |
| 89 } | 89 } |
| OLD | NEW |