Chromium Code Reviews| Index: chrome/browser/ui/panels/panel.cc |
| diff --git a/chrome/browser/ui/panels/panel.cc b/chrome/browser/ui/panels/panel.cc |
| index a2e60a33583cc4873f7aef89f77fa85b5900a538..2dab1775c7f80a8009d6e92c513894788dc6ef50 100644 |
| --- a/chrome/browser/ui/panels/panel.cc |
| +++ b/chrome/browser/ui/panels/panel.cc |
| @@ -63,6 +63,8 @@ void Panel::Initialize(const gfx::Rect& bounds) { |
| DCHECK(!bounds.IsEmpty()); |
| initialized_ = true; |
| native_panel_ = CreateNativePanel(browser_, this, bounds); |
| + if (panel_strip_ != NULL) |
| + native_panel_->PreventActivationByOS(panel_strip_->IsPanelMinimized(this)); |
| } |
| void Panel::OnNativePanelClosed() { |
| @@ -156,6 +158,12 @@ void Panel::SetAppIconVisibility(bool visible) { |
| native_panel_->SetPanelAppIconVisibility(visible); |
| } |
| +void Panel::set_panel_strip(PanelStrip* new_strip) { |
| + panel_strip_ = new_strip; |
| + if (panel_strip_ != NULL && initialized_) |
| + native_panel_->PreventActivationByOS(panel_strip_->IsPanelMinimized(this)); |
|
jennb
2012/03/06 21:56:44
This makes more sense in AddPanel where the panel
|
| +} |
| + |
| void Panel::SetExpansionState(ExpansionState new_state) { |
| if (expansion_state_ == new_state) |
| return; |
| @@ -168,6 +176,9 @@ void Panel::SetExpansionState(ExpansionState new_state) { |
| if (expansion_state_ == MINIMIZED) |
| Deactivate(); |
| + DCHECK(initialized_ && panel_strip_ != NULL); |
|
jennb
2012/03/06 21:56:44
Move this to the beginning of the method? Both the
|
| + native_panel_->PreventActivationByOS(panel_strip_->IsPanelMinimized(this)); |
| + |
| content::NotificationService::current()->Notify( |
| chrome::NOTIFICATION_PANEL_CHANGED_EXPANSION_STATE, |
| content::Source<Panel>(this), |