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

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

Issue 23918002: Switch to doing user-resizing via system for panels on Mac (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Patch to reland Created 7 years, 3 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/display_settings_provider.h" 9 #include "chrome/browser/ui/panels/display_settings_provider.h"
10 #include "chrome/browser/ui/panels/panel_drag_controller.h" 10 #include "chrome/browser/ui/panels/panel_drag_controller.h"
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after
232 232
233 void DetachedPanelCollection::SortPanels(PanelsComparer comparer) { 233 void DetachedPanelCollection::SortPanels(PanelsComparer comparer) {
234 panels_.sort(comparer); 234 panels_.sort(comparer);
235 } 235 }
236 236
237 void DetachedPanelCollection::UpdatePanelOnCollectionChange(Panel* panel) { 237 void DetachedPanelCollection::UpdatePanelOnCollectionChange(Panel* panel) {
238 panel->set_attention_mode( 238 panel->set_attention_mode(
239 static_cast<Panel::AttentionMode>(Panel::USE_PANEL_ATTENTION | 239 static_cast<Panel::AttentionMode>(Panel::USE_PANEL_ATTENTION |
240 Panel::USE_SYSTEM_ATTENTION)); 240 Panel::USE_SYSTEM_ATTENTION));
241 panel->ShowShadow(true); 241 panel->ShowShadow(true);
242 panel->EnableResizeByMouse(true);
243 panel->UpdateMinimizeRestoreButtonVisibility(); 242 panel->UpdateMinimizeRestoreButtonVisibility();
244 panel->SetWindowCornerStyle(panel::ALL_ROUNDED); 243 panel->SetWindowCornerStyle(panel::ALL_ROUNDED);
245 } 244 }
246 245
247 void DetachedPanelCollection::OnPanelExpansionStateChanged(Panel* panel) { 246 void DetachedPanelCollection::OnPanelExpansionStateChanged(Panel* panel) {
248 // This should only be reached when a minimized stacked panel is dragged out 247 // This should only be reached when a minimized stacked panel is dragged out
249 // of the stack to become detached. For this case, the panel needs to be 248 // of the stack to become detached. For this case, the panel needs to be
250 // restored. 249 // restored.
251 DCHECK_EQ(Panel::EXPANDED, panel->expansion_state()); 250 DCHECK_EQ(Panel::EXPANDED, panel->expansion_state());
252 251
(...skipping 30 matching lines...) Expand all
283 282
284 void DetachedPanelCollection::ComputeNextDefaultPanelOrigin() { 283 void DetachedPanelCollection::ComputeNextDefaultPanelOrigin() {
285 default_panel_origin_.Offset(kPanelTilePixels, kPanelTilePixels); 284 default_panel_origin_.Offset(kPanelTilePixels, kPanelTilePixels);
286 gfx::Rect work_area = 285 gfx::Rect work_area =
287 panel_manager_->display_settings_provider()->GetPrimaryWorkArea(); 286 panel_manager_->display_settings_provider()->GetPrimaryWorkArea();
288 if (!work_area.Contains(default_panel_origin_)) { 287 if (!work_area.Contains(default_panel_origin_)) {
289 default_panel_origin_.SetPoint(kPanelTilePixels + work_area.x(), 288 default_panel_origin_.SetPoint(kPanelTilePixels + work_area.x(),
290 kPanelTilePixels + work_area.y()); 289 kPanelTilePixels + work_area.y());
291 } 290 }
292 } 291 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/gtk/panels/panel_gtk.cc ('k') | chrome/browser/ui/panels/docked_panel_collection.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698