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 |
| 224 // No need to proceed when the panel window was not shown previously. |
| 225 // We either show the panel window or do not show it depending on current |
| 226 // full screen state. |
| 227 return; |
| 228 } |
215 [controller_ fullScreenModeChanged:is_full_screen]; | 229 [controller_ fullScreenModeChanged:is_full_screen]; |
216 } | 230 } |
217 | 231 |
218 bool PanelCocoa::IsPanelAlwaysOnTop() const { | 232 bool PanelCocoa::IsPanelAlwaysOnTop() const { |
219 return always_on_top_; | 233 return always_on_top_; |
220 } | 234 } |
221 | 235 |
222 void PanelCocoa::SetPanelAlwaysOnTop(bool on_top) { | 236 void PanelCocoa::SetPanelAlwaysOnTop(bool on_top) { |
223 if (always_on_top_ == on_top) | 237 if (always_on_top_ == on_top) |
224 return; | 238 return; |
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
400 return ![[titlebar() restoreButton] isHidden]; | 414 return ![[titlebar() restoreButton] isHidden]; |
401 default: | 415 default: |
402 NOTREACHED(); | 416 NOTREACHED(); |
403 } | 417 } |
404 return false; | 418 return false; |
405 } | 419 } |
406 | 420 |
407 panel::CornerStyle CocoaNativePanelTesting::GetWindowCornerStyle() const { | 421 panel::CornerStyle CocoaNativePanelTesting::GetWindowCornerStyle() const { |
408 return native_panel_window_->corner_style_; | 422 return native_panel_window_->corner_style_; |
409 } | 423 } |
OLD | NEW |