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/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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 44 PanelCocoa::~PanelCocoa() { | 44 PanelCocoa::~PanelCocoa() { |
| 45 } | 45 } |
| 46 | 46 |
| 47 bool PanelCocoa::isClosed() { | 47 bool PanelCocoa::isClosed() { |
| 48 return !controller_; | 48 return !controller_; |
| 49 } | 49 } |
| 50 | 50 |
| 51 void PanelCocoa::ShowPanel() { | 51 void PanelCocoa::ShowPanel() { |
| 52 ShowPanelInactive(); | 52 ShowPanelInactive(); |
| 53 ActivatePanel(); | 53 ActivatePanel(); |
| 54 | |
| 55 // |-makeKeyAndOrderFront:| won't send |-windowDidBecomeKey:| until we | |
| 56 // return to the runloop. This causes extension tests that wait for the | |
| 57 // active status change notification to fail, so we send an active status | |
| 58 // notification here. | |
| 59 panel_->OnActiveStateChanged(true); | |
|
Dmitry Titov
2012/07/13 18:24:17
oy.
Can it be that the consumers of that call are
jennb
2012/07/13 18:47:48
I had the same concerns, therefore I added the EXP
| |
| 54 } | 60 } |
| 55 | 61 |
| 56 void PanelCocoa::ShowPanelInactive() { | 62 void PanelCocoa::ShowPanelInactive() { |
| 57 if (isClosed()) | 63 if (isClosed()) |
| 58 return; | 64 return; |
| 59 | 65 |
| 60 // This method may be called several times, meaning 'ensure it's shown'. | 66 // This method may be called several times, meaning 'ensure it's shown'. |
| 61 // Animations don't look good when repeated - hence this flag is needed. | 67 // Animations don't look good when repeated - hence this flag is needed. |
| 62 if (is_shown_) { | 68 if (is_shown_) { |
| 63 return; | 69 return; |
| (...skipping 309 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 |