Index: chrome/browser/ui/panels/panel.cc |
=================================================================== |
--- chrome/browser/ui/panels/panel.cc (revision 90982) |
+++ chrome/browser/ui/panels/panel.cc (working copy) |
@@ -25,7 +25,9 @@ |
web_app::GetExtensionIdFromApplicationName(browser->app_name()), false); |
} |
-Panel::Panel(Browser* browser, const gfx::Rect& bounds) { |
+Panel::Panel(Browser* browser, const gfx::Rect& bounds) |
+ : native_panel_(NULL), |
jennb
2011/06/29 23:17:54
Why does native_panel_ need to be set to NULL here
jianli
2011/06/30 01:28:33
I think it is good to initialize the pointer here,
|
+ expansion_state_(EXPANDED) { |
native_panel_ = CreateNativePanel(browser, this, bounds); |
} |
@@ -41,12 +43,21 @@ |
native_panel_->SetPanelBounds(bounds); |
} |
-void Panel::Minimize() { |
- native_panel_->MinimizePanel(); |
+void Panel::SetExpansionState(ExpansionState expansion_state) { |
+ if (expansion_state_ == expansion_state) |
+ return; |
+ expansion_state_ = expansion_state; |
+ |
+ native_panel_->SetPanelExpansionState(expansion_state); |
} |
-void Panel::Restore() { |
- native_panel_->RestorePanel(); |
+bool Panel::ShouldBringUpTitleBar(int mouse_x, int mouse_y) const { |
+ // Skip the expanded panel. |
+ if (expansion_state_ == Panel::EXPANDED) |
jennb
2011/06/29 23:17:54
if (expansion_state_ != Panel::MINIMIZED)
jianli
2011/06/30 01:28:33
If the panel state is TITLEBAR_ONLY, we still want
|
+ return false; |
+ |
+ // Let the native panel decide. |
+ return native_panel_->ShouldBringUpPanelTitleBar(mouse_x, mouse_y); |
} |
void Panel::Show() { |