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

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

Issue 8505047: Fix panels being removed from PanelManager prematurely. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Change test from using notification to timeout. Created 9 years, 1 month 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 166
167 void Panel::SetBounds(const gfx::Rect& bounds) { 167 void Panel::SetBounds(const gfx::Rect& bounds) {
168 // Ignore any SetBounds requests since the bounds are completely controlled 168 // Ignore any SetBounds requests since the bounds are completely controlled
169 // by panel manager. 169 // by panel manager.
170 } 170 }
171 171
172 // Close() may be called multiple times if the browser window is not ready to 172 // Close() may be called multiple times if the browser window is not ready to
173 // close on the first attempt. 173 // close on the first attempt.
174 void Panel::Close() { 174 void Panel::Close() {
175 native_panel_->ClosePanel(); 175 native_panel_->ClosePanel();
176
177 // TODO(dimich): Only implemented fully async on Mac. Need to update other
178 // platforms. The panel should be removed from PanelManager when and if it
179 // was actually closed. The closing can be cancelled because of onbeforeunload
180 // handler on the web page. http://crbug.com/102720
181 #if !defined(OS_MACOSX)
182 manager()->Remove(this);
183 #endif
184 } 176 }
185 177
186 void Panel::Activate() { 178 void Panel::Activate() {
187 // Make sure the panel is expanded when activated programmatically, 179 // Make sure the panel is expanded when activated programmatically,
188 // so the user input does not go into collapsed window. 180 // so the user input does not go into collapsed window.
189 SetExpansionState(Panel::EXPANDED); 181 SetExpansionState(Panel::EXPANDED);
190 native_panel_->ActivatePanel(); 182 native_panel_->ActivatePanel();
191 } 183 }
192 184
193 void Panel::Deactivate() { 185 void Panel::Deactivate() {
(...skipping 404 matching lines...) Expand 10 before | Expand all | Expand 10 after
598 RequestRenderViewHostToDisableScrollbars(GetRenderViewHost()); 590 RequestRenderViewHostToDisableScrollbars(GetRenderViewHost());
599 } 591 }
600 592
601 Browser* Panel::browser() const { 593 Browser* Panel::browser() const {
602 return native_panel_->GetPanelBrowser(); 594 return native_panel_->GetPanelBrowser();
603 } 595 }
604 596
605 void Panel::DestroyBrowser() { 597 void Panel::DestroyBrowser() {
606 native_panel_->DestroyPanelBrowser(); 598 native_panel_->DestroyPanelBrowser();
607 } 599 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/panels/base_panel_browser_test.cc ('k') | chrome/browser/ui/panels/panel_browser_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698