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

Side by Side Diff: chrome/browser/ui/panels/panel.cc

Issue 9593001: Revert 124790 - Minimized panels should not open on Windows when activated by the OS (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 9 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/panels/panel.h" 5 #include "chrome/browser/ui/panels/panel.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "chrome/browser/extensions/extension_prefs.h" 8 #include "chrome/browser/extensions/extension_prefs.h"
9 #include "chrome/browser/extensions/extension_service.h" 9 #include "chrome/browser/extensions/extension_service.h"
10 #include "chrome/browser/profiles/profile.h" 10 #include "chrome/browser/profiles/profile.h"
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 } 157 }
158 158
159 void Panel::MoveToStrip(PanelStrip* new_strip) { 159 void Panel::MoveToStrip(PanelStrip* new_strip) {
160 DCHECK_NE(panel_strip_, new_strip); 160 DCHECK_NE(panel_strip_, new_strip);
161 if (panel_strip_) 161 if (panel_strip_)
162 panel_strip_->RemovePanel(this); 162 panel_strip_->RemovePanel(this);
163 163
164 panel_strip_ = new_strip; 164 panel_strip_ = new_strip;
165 panel_strip_->AddPanel(this); 165 panel_strip_->AddPanel(this);
166 166
167 native_panel_->PreventActivationByOS(panel_strip_->IsPanelMinimized(this));
168
169 content::NotificationService::current()->Notify( 167 content::NotificationService::current()->Notify(
170 chrome::NOTIFICATION_PANEL_CHANGED_LAYOUT_MODE, 168 chrome::NOTIFICATION_PANEL_CHANGED_LAYOUT_MODE,
171 content::Source<Panel>(this), 169 content::Source<Panel>(this),
172 content::NotificationService::NoDetails()); 170 content::NotificationService::NoDetails());
173 } 171 }
174 172
175 void Panel::SetExpansionState(ExpansionState new_state) { 173 void Panel::SetExpansionState(ExpansionState new_state) {
176 if (expansion_state_ == new_state) 174 if (expansion_state_ == new_state)
177 return; 175 return;
178 old_expansion_state_ = expansion_state_; 176 old_expansion_state_ = expansion_state_;
179 expansion_state_ = new_state; 177 expansion_state_ = new_state;
180 178
181 manager()->OnPanelExpansionStateChanged(this); 179 manager()->OnPanelExpansionStateChanged(this);
182 180
183 // The minimized panel should not get the focus. 181 // The minimized panel should not get the focus.
184 if (expansion_state_ == MINIMIZED) 182 if (expansion_state_ == MINIMIZED)
185 Deactivate(); 183 Deactivate();
186 184
187 native_panel_->PreventActivationByOS(panel_strip_->IsPanelMinimized(this));
188
189 content::NotificationService::current()->Notify( 185 content::NotificationService::current()->Notify(
190 chrome::NOTIFICATION_PANEL_CHANGED_EXPANSION_STATE, 186 chrome::NOTIFICATION_PANEL_CHANGED_EXPANSION_STATE,
191 content::Source<Panel>(this), 187 content::Source<Panel>(this),
192 content::NotificationService::NoDetails()); 188 content::NotificationService::NoDetails());
193 } 189 }
194 190
195 bool Panel::IsDrawingAttention() const { 191 bool Panel::IsDrawingAttention() const {
196 return native_panel_->IsDrawingAttention(); 192 return native_panel_->IsDrawingAttention();
197 } 193 }
198 194
(...skipping 493 matching lines...) Expand 10 before | Expand all | Expand 10 after
692 native_panel_->ContentSizeFromWindowSize(max_size_)); 688 native_panel_->ContentSizeFromWindowSize(max_size_));
693 } 689 }
694 690
695 void Panel::OnWindowSizeAvailable() { 691 void Panel::OnWindowSizeAvailable() {
696 ConfigureAutoResize(browser()->GetSelectedWebContents()); 692 ConfigureAutoResize(browser()->GetSelectedWebContents());
697 } 693 }
698 694
699 void Panel::DestroyBrowser() { 695 void Panel::DestroyBrowser() {
700 native_panel_->DestroyPanelBrowser(); 696 native_panel_->DestroyPanelBrowser();
701 } 697 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/panels/overflow_panel_strip.cc ('k') | chrome/browser/ui/panels/panel_browser_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698