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

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

Issue 273223002: views: Make view::Views::GetPreferredSize() const. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: More compile fix for ToT Created 6 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 | 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 "ash/wm/workspace/multi_window_resize_controller.h" 5 #include "ash/wm/workspace/multi_window_resize_controller.h"
6 6
7 #include "ash/screen_util.h" 7 #include "ash/screen_util.h"
8 #include "ash/shell.h" 8 #include "ash/shell.h"
9 #include "ash/shell_window_ids.h" 9 #include "ash/shell_window_ids.h"
10 #include "ash/wm/coordinate_conversion.h" 10 #include "ash/wm/coordinate_conversion.h"
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 direction_(direction), 64 direction_(direction),
65 image_(NULL) { 65 image_(NULL) {
66 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); 66 ResourceBundle& rb = ResourceBundle::GetSharedInstance();
67 int image_id = 67 int image_id =
68 direction == TOP_BOTTOM ? IDR_AURA_MULTI_WINDOW_RESIZE_H : 68 direction == TOP_BOTTOM ? IDR_AURA_MULTI_WINDOW_RESIZE_H :
69 IDR_AURA_MULTI_WINDOW_RESIZE_V; 69 IDR_AURA_MULTI_WINDOW_RESIZE_V;
70 image_ = rb.GetImageNamed(image_id).ToImageSkia(); 70 image_ = rb.GetImageNamed(image_id).ToImageSkia();
71 } 71 }
72 72
73 // views::View overrides: 73 // views::View overrides:
74 virtual gfx::Size GetPreferredSize() OVERRIDE { 74 virtual gfx::Size GetPreferredSize() const OVERRIDE {
75 return gfx::Size(image_->width(), image_->height()); 75 return gfx::Size(image_->width(), image_->height());
76 } 76 }
77 virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE { 77 virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE {
78 canvas->DrawImageInt(*image_, 0, 0); 78 canvas->DrawImageInt(*image_, 0, 0);
79 } 79 }
80 virtual bool OnMousePressed(const ui::MouseEvent& event) OVERRIDE { 80 virtual bool OnMousePressed(const ui::MouseEvent& event) OVERRIDE {
81 gfx::Point location(event.location()); 81 gfx::Point location(event.location());
82 views::View::ConvertPointToScreen(this, &location); 82 views::View::ConvertPointToScreen(this, &location);
83 controller_->StartResize(location); 83 controller_->StartResize(location);
84 return true; 84 return true;
(...skipping 448 matching lines...) Expand 10 before | Expand all | Expand 10 after
533 return false; 533 return false;
534 534
535 gfx::Point window_loc(location_in_screen); 535 gfx::Point window_loc(location_in_screen);
536 aura::Window::ConvertPointToTarget( 536 aura::Window::ConvertPointToTarget(
537 window->GetRootWindow(), window, &window_loc); 537 window->GetRootWindow(), window, &window_loc);
538 return window->ContainsPoint(window_loc) && 538 return window->ContainsPoint(window_loc) &&
539 window->delegate()->GetNonClientComponent(window_loc) == component; 539 window->delegate()->GetNonClientComponent(window_loc) == component;
540 } 540 }
541 541
542 } // namespace ash 542 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698