Chromium Code Reviews| 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/cocoa/panels/panel_cocoa.h" | 5 #include "chrome/browser/ui/cocoa/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 #import "chrome/browser/ui/cocoa/panels/panel_titlebar_view_cocoa.h" | 9 #import "chrome/browser/ui/cocoa/panels/panel_titlebar_view_cocoa.h" |
| 10 #import "chrome/browser/ui/cocoa/panels/panel_utils_cocoa.h" | 10 #import "chrome/browser/ui/cocoa/panels/panel_utils_cocoa.h" |
| (...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 203 const NativeWebKeyboardEvent& event) { | 203 const NativeWebKeyboardEvent& event) { |
| 204 if (event.skip_in_browser || event.type == NativeWebKeyboardEvent::Char) | 204 if (event.skip_in_browser || event.type == NativeWebKeyboardEvent::Char) |
| 205 return; | 205 return; |
| 206 | 206 |
| 207 ChromeEventProcessingWindow* event_window = | 207 ChromeEventProcessingWindow* event_window = |
| 208 static_cast<ChromeEventProcessingWindow*>([controller_ window]); | 208 static_cast<ChromeEventProcessingWindow*>([controller_ window]); |
| 209 DCHECK([event_window isKindOfClass:[ChromeEventProcessingWindow class]]); | 209 DCHECK([event_window isKindOfClass:[ChromeEventProcessingWindow class]]); |
| 210 [event_window redispatchKeyEvent:event.os_event]; | 210 [event_window redispatchKeyEvent:event.os_event]; |
| 211 } | 211 } |
| 212 | 212 |
| 213 void PanelCocoa::FullScreenModeChanged( | 213 void PanelCocoa::FullScreenModeChanged(bool is_full_screen) { |
| 214 bool is_full_screen) { | 214 if (!is_shown_) { |
| 215 // If the panel window is not shown due to that a Chrome tab window is in | |
| 216 // fullscreen mode when the panel is being created, we need to show the | |
| 217 // panel window now. In addition, its titlebar needs to be updated since it | |
| 218 // is not done at the panel creation time. | |
| 219 if (!is_full_screen) { | |
| 220 ShowPanelInactive(); | |
| 221 UpdatePanelTitleBar(); | |
| 222 } | |
| 223 return; | |
|
Dmitry Titov
2013/03/14 01:10:25
why this return? don't we need to do the controlle
jianli
2013/03/14 19:11:48
No, we do not need the call. If the panel window h
| |
| 224 } | |
| 215 [controller_ fullScreenModeChanged:is_full_screen]; | 225 [controller_ fullScreenModeChanged:is_full_screen]; |
| 216 } | 226 } |
| 217 | 227 |
| 218 bool PanelCocoa::IsPanelAlwaysOnTop() const { | 228 bool PanelCocoa::IsPanelAlwaysOnTop() const { |
| 219 return always_on_top_; | 229 return always_on_top_; |
| 220 } | 230 } |
| 221 | 231 |
| 222 void PanelCocoa::SetPanelAlwaysOnTop(bool on_top) { | 232 void PanelCocoa::SetPanelAlwaysOnTop(bool on_top) { |
| 223 if (always_on_top_ == on_top) | 233 if (always_on_top_ == on_top) |
| 224 return; | 234 return; |
| (...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 400 return ![[titlebar() restoreButton] isHidden]; | 410 return ![[titlebar() restoreButton] isHidden]; |
| 401 default: | 411 default: |
| 402 NOTREACHED(); | 412 NOTREACHED(); |
| 403 } | 413 } |
| 404 return false; | 414 return false; |
| 405 } | 415 } |
| 406 | 416 |
| 407 panel::CornerStyle CocoaNativePanelTesting::GetWindowCornerStyle() const { | 417 panel::CornerStyle CocoaNativePanelTesting::GetWindowCornerStyle() const { |
| 408 return native_panel_window_->corner_style_; | 418 return native_panel_window_->corner_style_; |
| 409 } | 419 } |
| OLD | NEW |