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

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

Issue 8775022: Add Panel::SetPanelBoundsInstantly for all platforms. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix per feedback Created 9 years 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 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 restored_size_ = bounds.size(); 71 restored_size_ = bounds.size();
72 72
73 native_panel_->SetPanelBounds(bounds); 73 native_panel_->SetPanelBounds(bounds);
74 74
75 content::NotificationService::current()->Notify( 75 content::NotificationService::current()->Notify(
76 chrome::NOTIFICATION_PANEL_CHANGED_BOUNDS, 76 chrome::NOTIFICATION_PANEL_CHANGED_BOUNDS,
77 content::Source<Panel>(this), 77 content::Source<Panel>(this),
78 content::NotificationService::NoDetails()); 78 content::NotificationService::NoDetails());
79 } 79 }
80 80
81 void Panel::SetPanelBoundsInstantly(const gfx::Rect& bounds) {
82 if (expansion_state_ == Panel::EXPANDED)
83 restored_size_ = bounds.size();
84
85 native_panel_->SetPanelBoundsInstantly(bounds);
86
87 content::NotificationService::current()->Notify(
88 chrome::NOTIFICATION_PANEL_CHANGED_BOUNDS,
89 content::Source<Panel>(this),
90 content::NotificationService::NoDetails());
91 }
92
81 void Panel::SetAutoResizable(bool resizable) { 93 void Panel::SetAutoResizable(bool resizable) {
82 if (auto_resizable_ == resizable) 94 if (auto_resizable_ == resizable)
83 return; 95 return;
84 96
85 auto_resizable_ = resizable; 97 auto_resizable_ = resizable;
86 if (auto_resizable_) { 98 if (auto_resizable_) {
87 browser()->tabstrip_model()->AddObserver(this); 99 browser()->tabstrip_model()->AddObserver(this);
88 TabContents* tab_contents = browser()->GetSelectedTabContents(); 100 TabContents* tab_contents = browser()->GetSelectedTabContents();
89 if (tab_contents) 101 if (tab_contents)
90 EnableTabContentsAutoResize(tab_contents); 102 EnableTabContentsAutoResize(tab_contents);
(...skipping 544 matching lines...) Expand 10 before | Expand all | Expand 10 after
635 if (auto_resizable_) { 647 if (auto_resizable_) {
636 RenderViewHost* render_view_host = GetRenderViewHost(); 648 RenderViewHost* render_view_host = GetRenderViewHost();
637 if (render_view_host) 649 if (render_view_host)
638 RequestRenderViewHostToDisableScrollbars(render_view_host); 650 RequestRenderViewHostToDisableScrollbars(render_view_host);
639 } 651 }
640 } 652 }
641 653
642 void Panel::DestroyBrowser() { 654 void Panel::DestroyBrowser() {
643 native_panel_->DestroyPanelBrowser(); 655 native_panel_->DestroyPanelBrowser();
644 } 656 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698