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

Side by Side Diff: ash/wm/workspace/multi_window_resize_controller.cc

Issue 2901503003: Rename GetPreferredSize to CalculatePreferredSize in ash/ (Closed)
Patch Set: improvements Created 3 years, 7 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
« no previous file with comments | « ash/wm/window_mirror_view.cc ('k') | no next file » | 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 "ash/wm/workspace/multi_window_resize_controller.h" 5 #include "ash/wm/workspace/multi_window_resize_controller.h"
6 6
7 #include "ash/public/cpp/shell_window_ids.h" 7 #include "ash/public/cpp/shell_window_ids.h"
8 #include "ash/root_window_controller.h" 8 #include "ash/root_window_controller.h"
9 #include "ash/wm/window_state.h" 9 #include "ash/wm/window_state.h"
10 #include "ash/wm/workspace/workspace_window_resizer.h" 10 #include "ash/wm/workspace/workspace_window_resizer.h"
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 84
85 // View contained in the widget. Passes along mouse events to the 85 // View contained in the widget. Passes along mouse events to the
86 // MultiWindowResizeController so that it can start/stop the resize loop. 86 // MultiWindowResizeController so that it can start/stop the resize loop.
87 class MultiWindowResizeController::ResizeView : public views::View { 87 class MultiWindowResizeController::ResizeView : public views::View {
88 public: 88 public:
89 explicit ResizeView(MultiWindowResizeController* controller, 89 explicit ResizeView(MultiWindowResizeController* controller,
90 Direction direction) 90 Direction direction)
91 : controller_(controller), direction_(direction) {} 91 : controller_(controller), direction_(direction) {}
92 92
93 // views::View overrides: 93 // views::View overrides:
94 gfx::Size GetPreferredSize() const override { 94 gfx::Size CalculatePreferredSize() const override {
95 const bool vert = direction_ == LEFT_RIGHT; 95 const bool vert = direction_ == LEFT_RIGHT;
96 return gfx::Size(vert ? kShortSide : kLongSide, 96 return gfx::Size(vert ? kShortSide : kLongSide,
97 vert ? kLongSide : kShortSide); 97 vert ? kLongSide : kShortSide);
98 } 98 }
99 void OnPaint(gfx::Canvas* canvas) override { 99 void OnPaint(gfx::Canvas* canvas) override {
100 cc::PaintFlags flags; 100 cc::PaintFlags flags;
101 flags.setColor(SkColorSetA(SK_ColorBLACK, 0x7F)); 101 flags.setColor(SkColorSetA(SK_ColorBLACK, 0x7F));
102 flags.setAntiAlias(true); 102 flags.setAntiAlias(true);
103 canvas->DrawRoundRect(gfx::RectF(GetLocalBounds()), 2, flags); 103 canvas->DrawRoundRect(gfx::RectF(GetLocalBounds()), 2, flags);
104 104
(...skipping 492 matching lines...) Expand 10 before | Expand all | Expand 10 after
597 const gfx::Point& location_in_screen, 597 const gfx::Point& location_in_screen,
598 int component) const { 598 int component) const {
599 gfx::Point window_loc = ConvertPointFromScreen(window, location_in_screen); 599 gfx::Point window_loc = ConvertPointFromScreen(window, location_in_screen);
600 const int window_component = 600 const int window_component =
601 window->delegate() ? window->delegate()->GetNonClientComponent(window_loc) 601 window->delegate() ? window->delegate()->GetNonClientComponent(window_loc)
602 : HTNOWHERE; 602 : HTNOWHERE;
603 return window_component == component; 603 return window_component == component;
604 } 604 }
605 605
606 } // namespace ash 606 } // namespace ash
OLDNEW
« no previous file with comments | « ash/wm/window_mirror_view.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698