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

Side by Side Diff: chrome/browser/extensions/api/managed_mode/managed_mode_api.cc

Issue 11366074: Coalesce event router Init calls into their constructors. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: aa Created 8 years, 1 month 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 | Annotate | Revision Log
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 // Implementation of the Chrome Extensions Managed Mode API. 5 // Implementation of the Chrome Extensions Managed Mode API.
6 6
7 #include "chrome/browser/extensions/api/managed_mode/managed_mode_api.h" 7 #include "chrome/browser/extensions/api/managed_mode/managed_mode_api.h"
8 8
9 #include <string> 9 #include <string>
10 10
(...skipping 23 matching lines...) Expand all
34 const char kEnterSuccessKey[] = "success"; 34 const char kEnterSuccessKey[] = "success";
35 35
36 } // namespace 36 } // namespace
37 37
38 namespace keys = extensions::preference_api_constants; 38 namespace keys = extensions::preference_api_constants;
39 39
40 namespace extensions { 40 namespace extensions {
41 41
42 ExtensionManagedModeEventRouter::ExtensionManagedModeEventRouter( 42 ExtensionManagedModeEventRouter::ExtensionManagedModeEventRouter(
43 Profile* profile) : profile_(profile) { 43 Profile* profile) : profile_(profile) {
44 }
45
46 void ExtensionManagedModeEventRouter::Init() {
47 registrar_.Init(g_browser_process->local_state()); 44 registrar_.Init(g_browser_process->local_state());
48 registrar_.Add(prefs::kInManagedMode, this); 45 registrar_.Add(prefs::kInManagedMode, this);
49 } 46 }
50 47
51 ExtensionManagedModeEventRouter::~ExtensionManagedModeEventRouter() { 48 ExtensionManagedModeEventRouter::~ExtensionManagedModeEventRouter() {
52 } 49 }
53 50
54 void ExtensionManagedModeEventRouter::OnPreferenceChanged( 51 void ExtensionManagedModeEventRouter::OnPreferenceChanged(
55 PrefServiceBase* service, 52 PrefServiceBase* service,
56 const std::string& pref_name) { 53 const std::string& pref_name) {
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 EXTENSION_FUNCTION_VALIDATE(args_->Get(1, &value)); 118 EXTENSION_FUNCTION_VALIDATE(args_->Get(1, &value));
122 #if defined(ENABLE_CONFIGURATION_POLICY) 119 #if defined(ENABLE_CONFIGURATION_POLICY)
123 policy::ManagedModePolicyProvider* policy_provider = 120 policy::ManagedModePolicyProvider* policy_provider =
124 profile_->GetManagedModePolicyProvider(); 121 profile_->GetManagedModePolicyProvider();
125 policy_provider->SetPolicy(key, value); 122 policy_provider->SetPolicy(key, value);
126 #endif 123 #endif
127 return true; 124 return true;
128 } 125 }
129 126
130 } // namespace extensions 127 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698