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

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

Issue 9463022: Minimized panels should not open on Windows when activated by the OS (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: merged with the cleanup patch Created 8 years, 10 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 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),

Powered by Google App Engine
This is Rietveld 408576698