OLD | NEW |
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/views/constrained_window_frame_simple.h" | 5 #include "chrome/browser/ui/views/constrained_window_frame_simple.h" |
6 | 6 |
7 #include "chrome/browser/ui/constrained_window.h" | 7 #include "chrome/browser/ui/constrained_window.h" |
8 #include "chrome/browser/ui/views/constrained_window_views.h" | 8 #include "chrome/browser/ui/views/constrained_window_views.h" |
9 #include "grit/ui_resources.h" | 9 #include "grit/ui_resources.h" |
10 #include "grit/chromium_strings.h" | 10 #include "grit/chromium_strings.h" |
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
183 | 183 |
184 int ConstrainedWindowFrameSimple::NonClientHitTest(const gfx::Point& point) { | 184 int ConstrainedWindowFrameSimple::NonClientHitTest(const gfx::Point& point) { |
185 if (!bounds().Contains(point)) | 185 if (!bounds().Contains(point)) |
186 return HTNOWHERE; | 186 return HTNOWHERE; |
187 return HTCLIENT; | 187 return HTCLIENT; |
188 } | 188 } |
189 | 189 |
190 void ConstrainedWindowFrameSimple::GetWindowMask(const gfx::Size& size, | 190 void ConstrainedWindowFrameSimple::GetWindowMask(const gfx::Size& size, |
191 gfx::Path* window_mask) { | 191 gfx::Path* window_mask) { |
192 #if defined(USE_AURA) | 192 #if defined(USE_AURA) |
193 SkRect rect = {0, 0, size.width() - 1, size.height() - 1}; | 193 SkRect rect = {0, 0, static_cast<SkScalar>(size.width() - 1), |
| 194 static_cast<SkScalar>(size.height() - 1)}; |
194 #else | 195 #else |
195 // There appears to be a bug in the window mask calculation on Windows | 196 // There appears to be a bug in the window mask calculation on Windows |
196 // which causes the width, but not the height, to be off by one. | 197 // which causes the width, but not the height, to be off by one. |
197 SkRect rect = {0, 0, size.width(), size.height() - 1}; | 198 SkRect rect = {0, 0, size.width(), size.height() - 1}; |
198 #endif | 199 #endif |
199 SkScalar radius = SkIntToScalar(ConstrainedWindow::kBorderRadius); | 200 SkScalar radius = SkIntToScalar(ConstrainedWindow::kBorderRadius); |
200 SkScalar radii[8] = {radius, radius, radius, radius, | 201 SkScalar radii[8] = {radius, radius, radius, radius, |
201 radius, radius, radius, radius}; | 202 radius, radius, radius, radius}; |
202 | 203 |
203 // NB: We're not using the addRoundRect uniform radius overload as it | 204 // NB: We're not using the addRoundRect uniform radius overload as it |
(...skipping 30 matching lines...) Expand all Loading... |
234 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); | 235 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); |
235 views::ImageButton* close_button = new views::ImageButton(this); | 236 views::ImageButton* close_button = new views::ImageButton(this); |
236 close_button->SetImage(views::CustomButton::BS_NORMAL, | 237 close_button->SetImage(views::CustomButton::BS_NORMAL, |
237 rb.GetImageSkiaNamed(IDR_SHARED_IMAGES_X)); | 238 rb.GetImageSkiaNamed(IDR_SHARED_IMAGES_X)); |
238 close_button->SetImage(views::CustomButton::BS_HOT, | 239 close_button->SetImage(views::CustomButton::BS_HOT, |
239 rb.GetImageSkiaNamed(IDR_SHARED_IMAGES_X_HOVER)); | 240 rb.GetImageSkiaNamed(IDR_SHARED_IMAGES_X_HOVER)); |
240 close_button->SetImage(views::CustomButton::BS_PUSHED, | 241 close_button->SetImage(views::CustomButton::BS_PUSHED, |
241 rb.GetImageSkiaNamed(IDR_SHARED_IMAGES_X_HOVER)); | 242 rb.GetImageSkiaNamed(IDR_SHARED_IMAGES_X_HOVER)); |
242 return close_button; | 243 return close_button; |
243 } | 244 } |
OLD | NEW |