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/chrome_views_delegate.h" | 5 #include "chrome/browser/ui/views/chrome_views_delegate.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/single_thread_task_runner.h" | 10 #include "base/single_thread_task_runner.h" |
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
259 } | 259 } |
260 NOTREACHED(); | 260 NOTREACHED(); |
261 return 0; | 261 return 0; |
262 } | 262 } |
263 | 263 |
264 const views::TypographyProvider& ChromeViewsDelegate::GetTypographyProvider() | 264 const views::TypographyProvider& ChromeViewsDelegate::GetTypographyProvider() |
265 const { | 265 const { |
266 return LayoutDelegate::Get()->GetTypographyProvider(); | 266 return LayoutDelegate::Get()->GetTypographyProvider(); |
267 } | 267 } |
268 | 268 |
| 269 int ChromeViewsDelegate::GetSnappedDialogWidth(int width) const { |
| 270 return LayoutDelegate::Get()->GetSnappedDialogWidth(width); |
| 271 } |
| 272 |
269 int ChromeViewsDelegate::GetDefaultDistanceMetric( | 273 int ChromeViewsDelegate::GetDefaultDistanceMetric( |
270 views::DistanceMetric metric) { | 274 views::DistanceMetric metric) { |
271 return views_delegate | 275 return views_delegate |
272 ? views_delegate->InternalGetDefaultDistanceMetric(metric) | 276 ? views_delegate->InternalGetDefaultDistanceMetric(metric) |
273 : views::ViewsDelegate::GetInstance()->GetDistanceMetric(metric); | 277 : views::ViewsDelegate::GetInstance()->GetDistanceMetric(metric); |
274 } | 278 } |
275 | 279 |
276 int ChromeViewsDelegate::InternalGetDefaultDistanceMetric( | 280 int ChromeViewsDelegate::InternalGetDefaultDistanceMetric( |
277 views::DistanceMetric metric) const { | 281 views::DistanceMetric metric) const { |
278 return views::ViewsDelegate::GetDistanceMetric(metric); | 282 return views::ViewsDelegate::GetDistanceMetric(metric); |
279 } | 283 } |
280 | 284 |
281 #if !defined(OS_CHROMEOS) | 285 #if !defined(OS_CHROMEOS) |
282 views::Widget::InitParams::WindowOpacity | 286 views::Widget::InitParams::WindowOpacity |
283 ChromeViewsDelegate::GetOpacityForInitParams( | 287 ChromeViewsDelegate::GetOpacityForInitParams( |
284 const views::Widget::InitParams& params) { | 288 const views::Widget::InitParams& params) { |
285 return views::Widget::InitParams::OPAQUE_WINDOW; | 289 return views::Widget::InitParams::OPAQUE_WINDOW; |
286 } | 290 } |
287 #endif | 291 #endif |
OLD | NEW |