Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(61)

Unified Diff: chrome/browser/ui/panels/panel.cc

Issue 7242017: Support minimizing the panel into 3-pixel line on Windows. Also support bringing up/down the titl... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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),
+ 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) {
jennb 2011/06/30 17:33:31 Nit: wonder if code would be a little easier to re
jianli 2011/06/30 18:22:36 I rename it to new_expansion_state.
+ if (expansion_state_ == expansion_state)
+ return;
+ expansion_state_ = expansion_state;
+
+ native_panel_->OnPanelExpansionStateChanged(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)
+ return false;
+
+ // Let the native panel decide.
+ return native_panel_->ShouldBringUpPanelTitleBar(mouse_x, mouse_y);
}
void Panel::Show() {

Powered by Google App Engine
This is Rietveld 408576698