Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(60)

Side by Side Diff: chrome/browser/managed_mode.cc

Issue 10626007: Move ExtensionSystem into extensions namespace (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Master merge; moved class declaration Created 8 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/managed_mode.h" 5 #include "chrome/browser/managed_mode.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "chrome/browser/browser_process.h" 8 #include "chrome/browser/browser_process.h"
9 #include "chrome/browser/extensions/extension_system.h" 9 #include "chrome/browser/extensions/extension_system.h"
10 #include "chrome/browser/prefs/pref_service.h" 10 #include "chrome/browser/prefs/pref_service.h"
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after
243 // TODO(bauerb): Show platform-specific confirmation dialog. 243 // TODO(bauerb): Show platform-specific confirmation dialog.
244 return true; 244 return true;
245 } 245 }
246 246
247 void ManagedMode::SetInManagedMode(Profile* newly_managed_profile) { 247 void ManagedMode::SetInManagedMode(Profile* newly_managed_profile) {
248 // Register the ManagementPolicy::Provider before changing the pref when 248 // Register the ManagementPolicy::Provider before changing the pref when
249 // setting it, and unregister it after changing the pref when clearing it, 249 // setting it, and unregister it after changing the pref when clearing it,
250 // so pref observers see the correct ManagedMode state. 250 // so pref observers see the correct ManagedMode state.
251 if (newly_managed_profile) { 251 if (newly_managed_profile) {
252 DCHECK(!managed_profile_ || managed_profile_ == newly_managed_profile); 252 DCHECK(!managed_profile_ || managed_profile_ == newly_managed_profile);
253 ExtensionSystem::Get( 253 extensions::ExtensionSystem::Get(
254 newly_managed_profile)->management_policy()->RegisterProvider(this); 254 newly_managed_profile)->management_policy()->RegisterProvider(this);
255 g_browser_process->local_state()->SetBoolean(prefs::kInManagedMode, true); 255 g_browser_process->local_state()->SetBoolean(prefs::kInManagedMode, true);
256 } else { 256 } else {
257 ExtensionSystem::Get( 257 extensions::ExtensionSystem::Get(
258 managed_profile_)->management_policy()->UnregisterProvider(this); 258 managed_profile_)->management_policy()->UnregisterProvider(this);
259 g_browser_process->local_state()->SetBoolean(prefs::kInManagedMode, false); 259 g_browser_process->local_state()->SetBoolean(prefs::kInManagedMode, false);
260 } 260 }
261 managed_profile_ = newly_managed_profile; 261 managed_profile_ = newly_managed_profile;
262 262
263 // This causes the avatar and the profile menu to get updated. 263 // This causes the avatar and the profile menu to get updated.
264 content::NotificationService::current()->Notify( 264 content::NotificationService::current()->Notify(
265 chrome::NOTIFICATION_PROFILE_CACHED_INFO_CHANGED, 265 chrome::NOTIFICATION_PROFILE_CACHED_INFO_CHANGED,
266 content::NotificationService::AllBrowserContextsAndSources(), 266 content::NotificationService::AllBrowserContextsAndSources(),
267 content::NotificationService::NoDetails()); 267 content::NotificationService::NoDetails());
268 } 268 }
OLDNEW
« no previous file with comments | « chrome/browser/intents/web_intents_registry_factory.cc ('k') | chrome/browser/prerender/prerender_manager_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698