| 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/panels/panel_window_controller_cocoa.h" | 5 #include "chrome/browser/ui/panels/panel_window_controller_cocoa.h" |
| 6 | 6 |
| 7 #import <Cocoa/Cocoa.h> | 7 #import <Cocoa/Cocoa.h> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/mac/bundle_locations.h" | 10 #include "base/mac/bundle_locations.h" |
| (...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 279 action == @selector(commandDispatchUsingKeyModifiers:)) { | 279 action == @selector(commandDispatchUsingKeyModifiers:)) { |
| 280 NSInteger tag = [item tag]; | 280 NSInteger tag = [item tag]; |
| 281 CommandUpdater* command_updater = windowShim_->browser()->command_updater(); | 281 CommandUpdater* command_updater = windowShim_->browser()->command_updater(); |
| 282 if (command_updater->SupportsCommand(tag)) { | 282 if (command_updater->SupportsCommand(tag)) { |
| 283 enable = command_updater->IsCommandEnabled(tag); | 283 enable = command_updater->IsCommandEnabled(tag); |
| 284 // Disable commands that do not apply to Panels. | 284 // Disable commands that do not apply to Panels. |
| 285 switch (tag) { | 285 switch (tag) { |
| 286 case IDC_CLOSE_TAB: | 286 case IDC_CLOSE_TAB: |
| 287 case IDC_FULLSCREEN: | 287 case IDC_FULLSCREEN: |
| 288 case IDC_PRESENTATION_MODE: | 288 case IDC_PRESENTATION_MODE: |
| 289 case IDC_SYNC_BOOKMARKS: | 289 case IDC_SHOW_SYNC_SETUP: |
| 290 enable = NO; | 290 enable = NO; |
| 291 break; | 291 break; |
| 292 default: | 292 default: |
| 293 // Special handling for the contents of the Text Encoding submenu. On | 293 // Special handling for the contents of the Text Encoding submenu. On |
| 294 // Mac OS, instead of enabling/disabling the top-level menu item, we | 294 // Mac OS, instead of enabling/disabling the top-level menu item, we |
| 295 // enable/disable the submenu's contents (per Apple's HIG). | 295 // enable/disable the submenu's contents (per Apple's HIG). |
| 296 EncodingMenuController encoding_controller; | 296 EncodingMenuController encoding_controller; |
| 297 if (encoding_controller.DoesCommandBelongToEncodingMenu(tag)) { | 297 if (encoding_controller.DoesCommandBelongToEncodingMenu(tag)) { |
| 298 enable &= command_updater->IsCommandEnabled(IDC_ENCODING_MENU) ? | 298 enable &= command_updater->IsCommandEnabled(IDC_ENCODING_MENU) ? |
| 299 YES : NO; | 299 YES : NO; |
| (...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 618 | 618 |
| 619 - (BOOL)canBecomeKeyWindow { | 619 - (BOOL)canBecomeKeyWindow { |
| 620 // Panel can only gain focus if it is expanded. Minimized panels do not | 620 // Panel can only gain focus if it is expanded. Minimized panels do not |
| 621 // participate in Cmd-~ rotation. | 621 // participate in Cmd-~ rotation. |
| 622 // TODO(dimich): If it will be ever desired to expand/focus the Panel on | 622 // TODO(dimich): If it will be ever desired to expand/focus the Panel on |
| 623 // keyboard navigation or via main menu, the care should be taken to avoid | 623 // keyboard navigation or via main menu, the care should be taken to avoid |
| 624 // cases when minimized Panel is getting keyboard input, invisibly. | 624 // cases when minimized Panel is getting keyboard input, invisibly. |
| 625 return windowShim_->panel()->expansion_state() == Panel::EXPANDED; | 625 return windowShim_->panel()->expansion_state() == Panel::EXPANDED; |
| 626 } | 626 } |
| 627 @end | 627 @end |
| OLD | NEW |