| 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_cocoa.h" | 5 #include "chrome/browser/ui/panels/panel_cocoa.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #import "chrome/browser/ui/cocoa/chrome_event_processing_window.h" | 8 #import "chrome/browser/ui/cocoa/chrome_event_processing_window.h" |
| 9 #include "chrome/browser/ui/panels/panel.h" | 9 #include "chrome/browser/ui/panels/panel.h" |
| 10 #import "chrome/browser/ui/panels/panel_titlebar_view_cocoa.h" | 10 #import "chrome/browser/ui/panels/panel_titlebar_view_cocoa.h" |
| (...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 192 } | 192 } |
| 193 } | 193 } |
| 194 | 194 |
| 195 bool PanelCocoa::IsDrawingAttention() const { | 195 bool PanelCocoa::IsDrawingAttention() const { |
| 196 PanelTitlebarViewCocoa* titlebar = [controller_ titlebarView]; | 196 PanelTitlebarViewCocoa* titlebar = [controller_ titlebarView]; |
| 197 return [titlebar isDrawingAttention]; | 197 return [titlebar isDrawingAttention]; |
| 198 } | 198 } |
| 199 | 199 |
| 200 bool PanelCocoa::PreHandlePanelKeyboardEvent( | 200 bool PanelCocoa::PreHandlePanelKeyboardEvent( |
| 201 const NativeWebKeyboardEvent& event, bool* is_keyboard_shortcut) { | 201 const NativeWebKeyboardEvent& event, bool* is_keyboard_shortcut) { |
| 202 // TODO(jennb): any shortcut handling needed for Panel? | 202 // No need to prehandle as no keys are reserved. |
| 203 return false; | 203 return false; |
| 204 } | 204 } |
| 205 | 205 |
| 206 void PanelCocoa::HandlePanelKeyboardEvent( | 206 void PanelCocoa::HandlePanelKeyboardEvent( |
| 207 const NativeWebKeyboardEvent& event) { | 207 const NativeWebKeyboardEvent& event) { |
| 208 // TODO(jennb): any shortcut handling needed for Panel? | 208 if (event.skip_in_browser || event.type == NativeWebKeyboardEvent::Char) |
| 209 return; |
| 210 |
| 211 ChromeEventProcessingWindow* event_window = |
| 212 static_cast<ChromeEventProcessingWindow*>([controller_ window]); |
| 213 DCHECK([event_window isKindOfClass:[ChromeEventProcessingWindow class]]); |
| 214 [event_window redispatchKeyEvent:event.os_event]; |
| 209 } | 215 } |
| 210 | 216 |
| 211 void PanelCocoa::FullScreenModeChanged( | 217 void PanelCocoa::FullScreenModeChanged( |
| 212 bool is_full_screen) { | 218 bool is_full_screen) { |
| 213 [controller_ fullScreenModeChanged:is_full_screen]; | 219 [controller_ fullScreenModeChanged:is_full_screen]; |
| 214 } | 220 } |
| 215 | 221 |
| 216 Browser* PanelCocoa::GetPanelBrowser() const { | 222 Browser* PanelCocoa::GetPanelBrowser() const { |
| 217 NOTREACHED(); // legacy API from BrowserWindow. N/A for refactored panels. | 223 NOTREACHED(); // legacy API from BrowserWindow. N/A for refactored panels. |
| 218 return NULL; | 224 return NULL; |
| (...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 373 return ![[titlebar() closeButton] isHidden]; | 379 return ![[titlebar() closeButton] isHidden]; |
| 374 case panel::MINIMIZE_BUTTON: | 380 case panel::MINIMIZE_BUTTON: |
| 375 return ![[titlebar() minimizeButton] isHidden]; | 381 return ![[titlebar() minimizeButton] isHidden]; |
| 376 case panel::RESTORE_BUTTON: | 382 case panel::RESTORE_BUTTON: |
| 377 return ![[titlebar() restoreButton] isHidden]; | 383 return ![[titlebar() restoreButton] isHidden]; |
| 378 default: | 384 default: |
| 379 NOTREACHED(); | 385 NOTREACHED(); |
| 380 } | 386 } |
| 381 return false; | 387 return false; |
| 382 } | 388 } |
| OLD | NEW |