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 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
275 void BrowserCommandController::PrintingStateChanged() { | 275 void BrowserCommandController::PrintingStateChanged() { |
276 UpdatePrintingState(); | 276 UpdatePrintingState(); |
277 } | 277 } |
278 | 278 |
279 void BrowserCommandController::LoadingStateChanged(bool is_loading, | 279 void BrowserCommandController::LoadingStateChanged(bool is_loading, |
280 bool force) { | 280 bool force) { |
281 UpdateReloadStopState(is_loading, force); | 281 UpdateReloadStopState(is_loading, force); |
282 } | 282 } |
283 | 283 |
284 //////////////////////////////////////////////////////////////////////////////// | 284 //////////////////////////////////////////////////////////////////////////////// |
285 // BrowserCommandController, | 285 // BrowserCommandController, CommandUpdaterDelegate implementation: |
286 // CommandUpdater::CommandUpdaterDelegate implementation: | |
287 | 286 |
288 void BrowserCommandController::ExecuteCommandWithDisposition( | 287 void BrowserCommandController::ExecuteCommandWithDisposition( |
289 int id, WindowOpenDisposition disposition) { | 288 int id, |
| 289 WindowOpenDisposition disposition) { |
290 // No commands are enabled if there is not yet any selected tab. | 290 // No commands are enabled if there is not yet any selected tab. |
291 // TODO(pkasting): It seems like we should not need this, because either | 291 // TODO(pkasting): It seems like we should not need this, because either |
292 // most/all commands should not have been enabled yet anyway or the ones that | 292 // most/all commands should not have been enabled yet anyway or the ones that |
293 // are enabled should be global, or safe themselves against having no selected | 293 // are enabled should be global, or safe themselves against having no selected |
294 // tab. However, Ben says he tried removing this before and got lots of | 294 // tab. However, Ben says he tried removing this before and got lots of |
295 // crashes, e.g. from Windows sending WM_COMMANDs at random times during | 295 // crashes, e.g. from Windows sending WM_COMMANDs at random times during |
296 // window construction. This probably could use closer examination someday. | 296 // window construction. This probably could use closer examination someday. |
297 if (browser_->tab_strip_model()->active_index() == TabStripModel::kNoTab) | 297 if (browser_->tab_strip_model()->active_index() == TabStripModel::kNoTab) |
298 return; | 298 return; |
299 | 299 |
(...skipping 897 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1197 | 1197 |
1198 BrowserWindow* BrowserCommandController::window() { | 1198 BrowserWindow* BrowserCommandController::window() { |
1199 return browser_->window(); | 1199 return browser_->window(); |
1200 } | 1200 } |
1201 | 1201 |
1202 Profile* BrowserCommandController::profile() { | 1202 Profile* BrowserCommandController::profile() { |
1203 return browser_->profile(); | 1203 return browser_->profile(); |
1204 } | 1204 } |
1205 | 1205 |
1206 } // namespace chrome | 1206 } // namespace chrome |
OLD | NEW |