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 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
262 } | 262 } |
263 NOTREACHED(); | 263 NOTREACHED(); |
264 return 0; | 264 return 0; |
265 } | 265 } |
266 | 266 |
267 const views::TypographyProvider& ChromeViewsDelegate::GetTypographyProvider() | 267 const views::TypographyProvider& ChromeViewsDelegate::GetTypographyProvider() |
268 const { | 268 const { |
269 return LayoutDelegate::Get()->GetTypographyProvider(); | 269 return LayoutDelegate::Get()->GetTypographyProvider(); |
270 } | 270 } |
271 | 271 |
| 272 int ChromeViewsDelegate::GetSnappedDialogWidth(int min_width) const { |
| 273 return LayoutDelegate::Get()->GetSnappedDialogWidth(min_width); |
| 274 } |
| 275 |
272 int ChromeViewsDelegate::GetDefaultDistanceMetric( | 276 int ChromeViewsDelegate::GetDefaultDistanceMetric( |
273 views::DistanceMetric metric) { | 277 views::DistanceMetric metric) { |
274 return views_delegate | 278 return views_delegate |
275 ? views_delegate->InternalGetDefaultDistanceMetric(metric) | 279 ? views_delegate->InternalGetDefaultDistanceMetric(metric) |
276 : views::ViewsDelegate::GetInstance()->GetDistanceMetric(metric); | 280 : views::ViewsDelegate::GetInstance()->GetDistanceMetric(metric); |
277 } | 281 } |
278 | 282 |
279 int ChromeViewsDelegate::InternalGetDefaultDistanceMetric( | 283 int ChromeViewsDelegate::InternalGetDefaultDistanceMetric( |
280 views::DistanceMetric metric) const { | 284 views::DistanceMetric metric) const { |
281 return views::ViewsDelegate::GetDistanceMetric(metric); | 285 return views::ViewsDelegate::GetDistanceMetric(metric); |
282 } | 286 } |
283 | 287 |
284 #if !defined(OS_CHROMEOS) | 288 #if !defined(OS_CHROMEOS) |
285 views::Widget::InitParams::WindowOpacity | 289 views::Widget::InitParams::WindowOpacity |
286 ChromeViewsDelegate::GetOpacityForInitParams( | 290 ChromeViewsDelegate::GetOpacityForInitParams( |
287 const views::Widget::InitParams& params) { | 291 const views::Widget::InitParams& params) { |
288 return views::Widget::InitParams::OPAQUE_WINDOW; | 292 return views::Widget::InitParams::OPAQUE_WINDOW; |
289 } | 293 } |
290 #endif | 294 #endif |
OLD | NEW |