OLD | NEW |
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/ui/browser_command_controller.h" | 5 #include "chrome/browser/ui/browser_command_controller.h" |
6 | 6 |
7 #include "chrome/app/chrome_command_ids.h" | 7 #include "chrome/app/chrome_command_ids.h" |
8 #include "chrome/browser/browser_process.h" | 8 #include "chrome/browser/browser_process.h" |
9 #include "chrome/browser/defaults.h" | 9 #include "chrome/browser/defaults.h" |
10 #include "chrome/browser/extensions/extension_service.h" | 10 #include "chrome/browser/extensions/extension_service.h" |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 BrowserCommandController::BrowserCommandController(Browser* browser) | 78 BrowserCommandController::BrowserCommandController(Browser* browser) |
79 : browser_(browser), | 79 : browser_(browser), |
80 ALLOW_THIS_IN_INITIALIZER_LIST(command_updater_(this)), | 80 ALLOW_THIS_IN_INITIALIZER_LIST(command_updater_(this)), |
81 block_command_execution_(false), | 81 block_command_execution_(false), |
82 last_blocked_command_id_(-1), | 82 last_blocked_command_id_(-1), |
83 last_blocked_command_disposition_(CURRENT_TAB) { | 83 last_blocked_command_disposition_(CURRENT_TAB) { |
84 browser_->tab_strip_model()->AddObserver(this); | 84 browser_->tab_strip_model()->AddObserver(this); |
85 PrefService* local_state = g_browser_process->local_state(); | 85 PrefService* local_state = g_browser_process->local_state(); |
86 if (local_state) { | 86 if (local_state) { |
87 local_pref_registrar_.Init(local_state); | 87 local_pref_registrar_.Init(local_state); |
88 local_pref_registrar_.Add(prefs::kPrintingEnabled, this); | |
89 local_pref_registrar_.Add(prefs::kAllowFileSelectionDialogs, this); | 88 local_pref_registrar_.Add(prefs::kAllowFileSelectionDialogs, this); |
90 local_pref_registrar_.Add(prefs::kInManagedMode, this); | 89 local_pref_registrar_.Add(prefs::kInManagedMode, this); |
91 } | 90 } |
92 | 91 |
93 profile_pref_registrar_.Init(profile()->GetPrefs()); | 92 profile_pref_registrar_.Init(profile()->GetPrefs()); |
94 profile_pref_registrar_.Add(prefs::kDevToolsDisabled, this); | 93 profile_pref_registrar_.Add(prefs::kDevToolsDisabled, this); |
95 profile_pref_registrar_.Add(prefs::kEditBookmarksEnabled, this); | 94 profile_pref_registrar_.Add(prefs::kEditBookmarksEnabled, this); |
96 profile_pref_registrar_.Add(prefs::kShowBookmarkBar, this); | 95 profile_pref_registrar_.Add(prefs::kShowBookmarkBar, this); |
97 profile_pref_registrar_.Add(prefs::kIncognitoModeAvailability, this); | 96 profile_pref_registrar_.Add(prefs::kIncognitoModeAvailability, this); |
| 97 profile_pref_registrar_.Add(prefs::kPrintingEnabled, this); |
98 | 98 |
99 InitCommandState(); | 99 InitCommandState(); |
100 | 100 |
101 TabRestoreService* tab_restore_service = | 101 TabRestoreService* tab_restore_service = |
102 TabRestoreServiceFactory::GetForProfile(profile()); | 102 TabRestoreServiceFactory::GetForProfile(profile()); |
103 if (tab_restore_service) { | 103 if (tab_restore_service) { |
104 tab_restore_service->AddObserver(this); | 104 tab_restore_service->AddObserver(this); |
105 TabRestoreServiceChanged(tab_restore_service); | 105 TabRestoreServiceChanged(tab_restore_service); |
106 } | 106 } |
107 | 107 |
(...skipping 958 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1066 | 1066 |
1067 BrowserWindow* BrowserCommandController::window() { | 1067 BrowserWindow* BrowserCommandController::window() { |
1068 return browser_->window(); | 1068 return browser_->window(); |
1069 } | 1069 } |
1070 | 1070 |
1071 Profile* BrowserCommandController::profile() { | 1071 Profile* BrowserCommandController::profile() { |
1072 return browser_->profile(); | 1072 return browser_->profile(); |
1073 } | 1073 } |
1074 | 1074 |
1075 } // namespace chrome | 1075 } // namespace chrome |
OLD | NEW |