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

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

Issue 11669018: Support dragging panels to stack and snap. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Change per feedback Created 7 years, 11 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/detached_panel_collection.h" 5 #include "chrome/browser/ui/panels/detached_panel_collection.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "chrome/browser/ui/panels/panel_drag_controller.h" 9 #include "chrome/browser/ui/panels/panel_drag_controller.h"
10 #include "chrome/browser/ui/panels/panel_manager.h" 10 #include "chrome/browser/ui/panels/panel_manager.h"
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after
198 return panels_.find(panel) != panels_.end(); 198 return panels_.find(panel) != panels_.end();
199 } 199 }
200 200
201 void DetachedPanelCollection::UpdatePanelOnCollectionChange(Panel* panel) { 201 void DetachedPanelCollection::UpdatePanelOnCollectionChange(Panel* panel) {
202 panel->set_attention_mode( 202 panel->set_attention_mode(
203 static_cast<Panel::AttentionMode>(Panel::USE_PANEL_ATTENTION | 203 static_cast<Panel::AttentionMode>(Panel::USE_PANEL_ATTENTION |
204 Panel::USE_SYSTEM_ATTENTION)); 204 Panel::USE_SYSTEM_ATTENTION));
205 panel->SetAlwaysOnTop(false); 205 panel->SetAlwaysOnTop(false);
206 panel->EnableResizeByMouse(true); 206 panel->EnableResizeByMouse(true);
207 panel->UpdateMinimizeRestoreButtonVisibility(); 207 panel->UpdateMinimizeRestoreButtonVisibility();
208 panel->UpdateStackingProperty();
208 } 209 }
209 210
210 void DetachedPanelCollection::OnPanelActiveStateChanged(Panel* panel) { 211 void DetachedPanelCollection::OnPanelActiveStateChanged(Panel* panel) {
211 } 212 }
212 213
213 gfx::Point DetachedPanelCollection::GetDefaultPanelOrigin() { 214 gfx::Point DetachedPanelCollection::GetDefaultPanelOrigin() {
214 if (!default_panel_origin_.x() && !default_panel_origin_.y()) { 215 if (!default_panel_origin_.x() && !default_panel_origin_.y()) {
215 gfx::Rect display_area = 216 gfx::Rect display_area =
216 panel_manager_->display_settings_provider()->GetDisplayArea(); 217 panel_manager_->display_settings_provider()->GetDisplayArea();
217 default_panel_origin_.SetPoint(kPanelTilePixels + display_area.x(), 218 default_panel_origin_.SetPoint(kPanelTilePixels + display_area.x(),
218 kPanelTilePixels + display_area.y()); 219 kPanelTilePixels + display_area.y());
219 } 220 }
220 return default_panel_origin_; 221 return default_panel_origin_;
221 } 222 }
222 223
223 void DetachedPanelCollection::ComputeNextDefaultPanelOrigin() { 224 void DetachedPanelCollection::ComputeNextDefaultPanelOrigin() {
224 default_panel_origin_.Offset(kPanelTilePixels, kPanelTilePixels); 225 default_panel_origin_.Offset(kPanelTilePixels, kPanelTilePixels);
225 gfx::Rect display_area = 226 gfx::Rect display_area =
226 panel_manager_->display_settings_provider()->GetDisplayArea(); 227 panel_manager_->display_settings_provider()->GetDisplayArea();
227 if (!display_area.Contains(default_panel_origin_)) { 228 if (!display_area.Contains(default_panel_origin_)) {
228 default_panel_origin_.SetPoint(kPanelTilePixels + display_area.x(), 229 default_panel_origin_.SetPoint(kPanelTilePixels + display_area.x(),
229 kPanelTilePixels + display_area.y()); 230 kPanelTilePixels + display_area.y());
230 } 231 }
231 } 232 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698