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

Side by Side Diff: chrome/browser/ui/panels/docked_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/docked_panel_collection.h" 5 #include "chrome/browser/ui/panels/docked_panel_collection.h"
6 6
7 #include <math.h> 7 #include <math.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <vector> 10 #include <vector>
(...skipping 747 matching lines...) Expand 10 before | Expand all | Expand 10 after
758 758
759 // Start from the bottom to avoid reshuffling. 759 // Start from the bottom to avoid reshuffling.
760 for (Panels::reverse_iterator iter = panels_copy.rbegin(); 760 for (Panels::reverse_iterator iter = panels_copy.rbegin();
761 iter != panels_copy.rend(); ++iter) 761 iter != panels_copy.rend(); ++iter)
762 (*iter)->Close(); 762 (*iter)->Close();
763 } 763 }
764 764
765 void DockedPanelCollection::UpdatePanelOnCollectionChange(Panel* panel) { 765 void DockedPanelCollection::UpdatePanelOnCollectionChange(Panel* panel) {
766 panel->set_attention_mode(Panel::USE_PANEL_ATTENTION); 766 panel->set_attention_mode(Panel::USE_PANEL_ATTENTION);
767 panel->ShowShadow(true); 767 panel->ShowShadow(true);
768 panel->EnableResizeByMouse(true);
769 panel->UpdateMinimizeRestoreButtonVisibility(); 768 panel->UpdateMinimizeRestoreButtonVisibility();
770 panel->SetWindowCornerStyle(panel::TOP_ROUNDED); 769 panel->SetWindowCornerStyle(panel::TOP_ROUNDED);
771 } 770 }
772 771
773 void DockedPanelCollection::ScheduleLayoutRefresh() { 772 void DockedPanelCollection::ScheduleLayoutRefresh() {
774 refresh_action_factory_.InvalidateWeakPtrs(); 773 refresh_action_factory_.InvalidateWeakPtrs();
775 base::MessageLoop::current()->PostDelayedTask( 774 base::MessageLoop::current()->PostDelayedTask(
776 FROM_HERE, 775 FROM_HERE,
777 base::Bind(&DockedPanelCollection::RefreshLayout, 776 base::Bind(&DockedPanelCollection::RefreshLayout,
778 refresh_action_factory_.GetWeakPtr()), 777 refresh_action_factory_.GetWeakPtr()),
(...skipping 12 matching lines...) Expand all
791 const gfx::Rect& requested_bounds) const { 790 const gfx::Rect& requested_bounds) const {
792 gfx::Rect initial_bounds = requested_bounds; 791 gfx::Rect initial_bounds = requested_bounds;
793 initial_bounds.set_origin( 792 initial_bounds.set_origin(
794 GetDefaultPositionForPanel(requested_bounds.size())); 793 GetDefaultPositionForPanel(requested_bounds.size()));
795 return initial_bounds; 794 return initial_bounds;
796 } 795 }
797 796
798 bool DockedPanelCollection::HasPanel(Panel* panel) const { 797 bool DockedPanelCollection::HasPanel(Panel* panel) const {
799 return find(panels_.begin(), panels_.end(), panel) != panels_.end(); 798 return find(panels_.begin(), panels_.end(), panel) != panels_.end();
800 } 799 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/panels/detached_panel_collection.cc ('k') | chrome/browser/ui/panels/native_panel.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698