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

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

Issue 9195003: Move IN_OVERFLOW from Panel::ExpansionState to new enum. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 11 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
diff --git a/chrome/browser/ui/panels/panel.cc b/chrome/browser/ui/panels/panel.cc
index ed3cca0caf6c3ced9b9b3d28217a608c968b1d5b..69192b40bb83c155a5d6e9616d5f6ce5afd4c094 100644
--- a/chrome/browser/ui/panels/panel.cc
+++ b/chrome/browser/ui/panels/panel.cc
@@ -48,8 +48,8 @@ Panel::Panel(Browser* browser, const gfx::Size& requested_size)
restored_size_(requested_size),
auto_resizable_(false),
draggable_(true),
+ strip_owner_(DOCKED),
expansion_state_(EXPANDED),
- old_expansion_state_(EXPANDED),
app_icon_visible_(true) {
}
@@ -79,7 +79,7 @@ const Extension* Panel::GetExtension() const {
}
void Panel::SetPanelBounds(const gfx::Rect& bounds) {
- if (expansion_state_ == Panel::EXPANDED)
+ if (strip_owner_ == DOCKED && expansion_state_ == EXPANDED)
restored_size_ = bounds.size();
native_panel_->SetPanelBounds(bounds);
@@ -91,7 +91,7 @@ void Panel::SetPanelBounds(const gfx::Rect& bounds) {
}
void Panel::SetPanelBoundsInstantly(const gfx::Rect& bounds) {
- if (expansion_state_ == Panel::EXPANDED)
+ if (strip_owner_ == DOCKED && expansion_state_ == EXPANDED)
restored_size_ = bounds.size();
native_panel_->SetPanelBoundsInstantly(bounds);
@@ -137,16 +137,30 @@ void Panel::SetAppIconVisibility(bool visible) {
native_panel_->SetPanelAppIconVisibility(visible);
}
+void Panel::SetStripOwner(StripOwner new_owner) {
+ if (strip_owner_ == new_owner)
+ return;
+ StripOwner old_owner = strip_owner_;
+ strip_owner_ = new_owner;
+
+ manager()->OnPanelStripOwnerChanged(this, old_owner);
+
+ content::NotificationService::current()->Notify(
+ chrome::NOTIFICATION_PANEL_CHANGED_STRIP_OWNER,
+ content::Source<Panel>(this),
+ content::NotificationService::NoDetails());
+}
+
void Panel::SetExpansionState(ExpansionState new_state) {
if (expansion_state_ == new_state)
return;
- old_expansion_state_ = expansion_state_;
+ ExpansionState old_state = expansion_state_;
expansion_state_ = new_state;
- manager()->OnPanelExpansionStateChanged(this);
+ manager()->OnPanelExpansionStateChanged(this, old_state);
// The minimized panel should not get the focus.
- if (expansion_state_ == MINIMIZED)
+ if (expansion_state_ == MINIMIZED && strip_owner_ == DOCKED)
Deactivate();
content::NotificationService::current()->Notify(
@@ -165,7 +179,7 @@ void Panel::FullScreenModeChanged(bool is_full_screen) {
void Panel::Show() {
// Don't show panel as active if it is in overflow state.
- if (expansion_state_ == IN_OVERFLOW)
+ if (strip_owner_ == IN_OVERFLOW)
ShowInactive();
else
native_panel_->ShowPanel();
@@ -190,6 +204,7 @@ void Panel::Activate() {
// Make sure the panel is expanded when activated programmatically,
// so the user input does not go into collapsed window.
SetExpansionState(Panel::EXPANDED);
+ SetStripOwner(Panel::DOCKED);
native_panel_->ActivatePanel();
}

Powered by Google App Engine
This is Rietveld 408576698