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

Side by Side Diff: chrome/browser/ui/views/chrome_views_delegate.cc

Issue 2783023002: Use an InsetMetric instead of a constant for vector button padding. (Closed)
Patch Set: revert the stuff that got mixed in from another patch Created 3 years, 8 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
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 "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 213 matching lines...) Expand 10 before | Expand all | Expand 10 after
224 const int top = layout_delegate->GetMetric( 224 const int top = layout_delegate->GetMetric(
225 LayoutDelegate::Metric::PANEL_CONTENT_MARGIN); 225 LayoutDelegate::Metric::PANEL_CONTENT_MARGIN);
226 const int side = layout_delegate->GetMetric( 226 const int side = layout_delegate->GetMetric(
227 LayoutDelegate::Metric::DIALOG_BUTTON_MARGIN); 227 LayoutDelegate::Metric::DIALOG_BUTTON_MARGIN);
228 // Titles are inset at the top and sides, but not at the bottom. 228 // Titles are inset at the top and sides, but not at the bottom.
229 return gfx::Insets(top, side, 0, side); 229 return gfx::Insets(top, side, 0, side);
230 } 230 }
231 case views::InsetsMetric::BUBBLE_DIALOG: 231 case views::InsetsMetric::BUBBLE_DIALOG:
232 return gfx::Insets(layout_delegate->GetMetric( 232 return gfx::Insets(layout_delegate->GetMetric(
233 LayoutDelegate::Metric::PANEL_CONTENT_MARGIN)); 233 LayoutDelegate::Metric::PANEL_CONTENT_MARGIN));
234 case views::InsetsMetric::VECTOR_IMAGE_BUTTON_PADDING:
235 return gfx::Insets(layout_delegate->GetMetric(
236 LayoutDelegate::Metric::VECTOR_IMAGE_BUTTON_PADDING));
234 } 237 }
235 NOTREACHED(); 238 NOTREACHED();
236 return gfx::Insets(); 239 return gfx::Insets();
237 } 240 }
238 241
239 int ChromeViewsDelegate::GetDistanceMetric(views::DistanceMetric metric) const { 242 int ChromeViewsDelegate::GetDistanceMetric(views::DistanceMetric metric) const {
240 switch (metric) { 243 switch (metric) {
241 case views::DistanceMetric::CLOSE_BUTTON_MARGIN: 244 case views::DistanceMetric::CLOSE_BUTTON_MARGIN:
242 return LayoutDelegate::Get()->GetMetric( 245 return LayoutDelegate::Get()->GetMetric(
243 LayoutDelegate::Metric::DIALOG_CLOSE_BUTTON_MARGIN); 246 LayoutDelegate::Metric::DIALOG_CLOSE_BUTTON_MARGIN);
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
278 return views::ViewsDelegate::GetDistanceMetric(metric); 281 return views::ViewsDelegate::GetDistanceMetric(metric);
279 } 282 }
280 283
281 #if !defined(OS_CHROMEOS) 284 #if !defined(OS_CHROMEOS)
282 views::Widget::InitParams::WindowOpacity 285 views::Widget::InitParams::WindowOpacity
283 ChromeViewsDelegate::GetOpacityForInitParams( 286 ChromeViewsDelegate::GetOpacityForInitParams(
284 const views::Widget::InitParams& params) { 287 const views::Widget::InitParams& params) {
285 return views::Widget::InitParams::OPAQUE_WINDOW; 288 return views::Widget::InitParams::OPAQUE_WINDOW;
286 } 289 }
287 #endif 290 #endif
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/views/harmony/harmony_layout_delegate.cc » ('j') | ui/views/layout/layout_constants.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698