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

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

Issue 9546001: Support detaching/attaching panels via inter-strip drags. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Patch to land 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
« no previous file with comments | « chrome/browser/ui/panels/panel.h ('k') | chrome/browser/ui/panels/panel_browser_view.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 web_app::GetExtensionIdFromApplicationName(browser->app_name()), false); 43 web_app::GetExtensionIdFromApplicationName(browser->app_name()), false);
44 } 44 }
45 45
46 Panel::Panel(Browser* browser, const gfx::Size& requested_size) 46 Panel::Panel(Browser* browser, const gfx::Size& requested_size)
47 : browser_(browser), 47 : browser_(browser),
48 panel_strip_(NULL), 48 panel_strip_(NULL),
49 initialized_(false), 49 initialized_(false),
50 has_temporary_layout_(false), 50 has_temporary_layout_(false),
51 restored_size_(requested_size), 51 restored_size_(requested_size),
52 auto_resizable_(false), 52 auto_resizable_(false),
53 always_on_top_(false),
54 in_preview_mode_(false),
53 expansion_state_(EXPANDED), 55 expansion_state_(EXPANDED),
54 old_expansion_state_(EXPANDED), 56 old_expansion_state_(EXPANDED) {
55 app_icon_visible_(true) {
56 } 57 }
57 58
58 Panel::~Panel() { 59 Panel::~Panel() {
59 // Invoked by native panel destructor. Do not access native_panel_ here. 60 // Invoked by native panel destructor. Do not access native_panel_ here.
60 } 61 }
61 62
62 void Panel::Initialize(const gfx::Rect& bounds) { 63 void Panel::Initialize(const gfx::Rect& bounds) {
63 DCHECK(!initialized_); 64 DCHECK(!initialized_);
64 DCHECK(!bounds.IsEmpty()); 65 DCHECK(!bounds.IsEmpty());
65 initialized_ = true; 66 initialized_ = true;
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 147
147 DCHECK(min_size.width() <= max_size.width()); 148 DCHECK(min_size.width() <= max_size.width());
148 DCHECK(min_size.height() <= max_size.height()); 149 DCHECK(min_size.height() <= max_size.height());
149 min_size_ = min_size; 150 min_size_ = min_size;
150 max_size_ = max_size; 151 max_size_ = max_size;
151 152
152 ConfigureAutoResize(browser()->GetSelectedWebContents()); 153 ConfigureAutoResize(browser()->GetSelectedWebContents());
153 } 154 }
154 155
155 void Panel::SetAppIconVisibility(bool visible) { 156 void Panel::SetAppIconVisibility(bool visible) {
156 if (app_icon_visible_ == visible) 157 native_panel_->SetPanelAppIconVisibility(visible);
158 }
159
160 void Panel::SetAlwaysOnTop(bool on_top) {
161 if (always_on_top_ == on_top)
157 return; 162 return;
158 app_icon_visible_ = visible; 163 always_on_top_ = on_top;
159 native_panel_->SetPanelAppIconVisibility(visible); 164 native_panel_->SetPanelAlwaysOnTop(on_top);
165 }
166
167 void Panel::SetPreviewMode(bool in_preview) {
168 DCHECK_NE(in_preview_mode_, in_preview);
169 in_preview_mode_ = in_preview;
160 } 170 }
161 171
162 void Panel::SetPanelStrip(PanelStrip* new_strip) { 172 void Panel::SetPanelStrip(PanelStrip* new_strip) {
163 panel_strip_ = new_strip; 173 panel_strip_ = new_strip;
164 if (panel_strip_ != NULL && initialized_) 174 if (panel_strip_ != NULL && initialized_)
165 native_panel_->PreventActivationByOS(panel_strip_->IsPanelMinimized(this)); 175 native_panel_->PreventActivationByOS(panel_strip_->IsPanelMinimized(this));
166 } 176 }
167 177
168 void Panel::SetExpansionState(ExpansionState new_state) { 178 void Panel::SetExpansionState(ExpansionState new_state) {
169 if (expansion_state_ == new_state) 179 if (expansion_state_ == new_state)
(...skipping 519 matching lines...) Expand 10 before | Expand all | Expand 10 after
689 native_panel_->ContentSizeFromWindowSize(max_size_)); 699 native_panel_->ContentSizeFromWindowSize(max_size_));
690 } 700 }
691 701
692 void Panel::OnWindowSizeAvailable() { 702 void Panel::OnWindowSizeAvailable() {
693 ConfigureAutoResize(browser()->GetSelectedWebContents()); 703 ConfigureAutoResize(browser()->GetSelectedWebContents());
694 } 704 }
695 705
696 void Panel::DestroyBrowser() { 706 void Panel::DestroyBrowser() {
697 native_panel_->DestroyPanelBrowser(); 707 native_panel_->DestroyPanelBrowser();
698 } 708 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/panels/panel.h ('k') | chrome/browser/ui/panels/panel_browser_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698