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

Side by Side Diff: chrome/browser/ui/views/harmony/layout_delegate.cc

Issue 2750063002: views: implement dialog width snapping (Closed)
Patch Set: Created 3 years, 9 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/harmony/layout_delegate.h" 5 #include "chrome/browser/ui/views/harmony/layout_delegate.h"
6 6
7 #include "base/lazy_instance.h" 7 #include "base/lazy_instance.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "chrome/browser/ui/views/chrome_views_delegate.h" 9 #include "chrome/browser/ui/views/chrome_views_delegate.h"
10 #include "chrome/browser/ui/views/harmony/harmony_layout_delegate.h" 10 #include "chrome/browser/ui/views/harmony/harmony_layout_delegate.h"
(...skipping 22 matching lines...) Expand all
33 case Metric::DIALOG_BUTTON_MARGIN: 33 case Metric::DIALOG_BUTTON_MARGIN:
34 return views::kButtonHEdgeMarginNew; 34 return views::kButtonHEdgeMarginNew;
35 case Metric::DIALOG_BUTTON_MINIMUM_WIDTH: 35 case Metric::DIALOG_BUTTON_MINIMUM_WIDTH:
36 return ChromeViewsDelegate::GetInstance()->GetDefaultDistanceMetric( 36 return ChromeViewsDelegate::GetInstance()->GetDefaultDistanceMetric(
37 views::DistanceMetric::DIALOG_BUTTON_MINIMUM_WIDTH); 37 views::DistanceMetric::DIALOG_BUTTON_MINIMUM_WIDTH);
38 case Metric::DIALOG_BUTTON_TOP_SPACING: 38 case Metric::DIALOG_BUTTON_TOP_SPACING:
39 return 0; 39 return 0;
40 case Metric::DIALOG_CLOSE_BUTTON_MARGIN: 40 case Metric::DIALOG_CLOSE_BUTTON_MARGIN:
41 return ChromeViewsDelegate::GetInstance()->GetDefaultDistanceMetric( 41 return ChromeViewsDelegate::GetInstance()->GetDefaultDistanceMetric(
42 views::DistanceMetric::CLOSE_BUTTON_MARGIN); 42 views::DistanceMetric::CLOSE_BUTTON_MARGIN);
43 case Metric::DIALOG_WIDTH_SNAPPING_UNIT:
44 return 1;
43 case Metric::PANEL_CONTENT_MARGIN: 45 case Metric::PANEL_CONTENT_MARGIN:
44 return views::kPanelHorizMargin; 46 return views::kPanelHorizMargin;
45 case Metric::RELATED_BUTTON_HORIZONTAL_SPACING: 47 case Metric::RELATED_BUTTON_HORIZONTAL_SPACING:
46 return ChromeViewsDelegate::GetInstance()->GetDefaultDistanceMetric( 48 return ChromeViewsDelegate::GetInstance()->GetDefaultDistanceMetric(
47 views::DistanceMetric::RELATED_BUTTON_HORIZONTAL); 49 views::DistanceMetric::RELATED_BUTTON_HORIZONTAL);
48 case Metric::RELATED_CONTROL_HORIZONTAL_SPACING: 50 case Metric::RELATED_CONTROL_HORIZONTAL_SPACING:
49 return ChromeViewsDelegate::GetInstance()->GetDefaultDistanceMetric( 51 return ChromeViewsDelegate::GetInstance()->GetDefaultDistanceMetric(
50 views::DistanceMetric::RELATED_CONTROL_HORIZONTAL); 52 views::DistanceMetric::RELATED_CONTROL_HORIZONTAL);
51 case Metric::RELATED_CONTROL_VERTICAL_SPACING: 53 case Metric::RELATED_CONTROL_VERTICAL_SPACING:
52 return ChromeViewsDelegate::GetInstance()->GetDefaultDistanceMetric( 54 return ChromeViewsDelegate::GetInstance()->GetDefaultDistanceMetric(
(...skipping 24 matching lines...) Expand all
77 return true; 79 return true;
78 } 80 }
79 81
80 bool LayoutDelegate::IsHarmonyMode() const { 82 bool LayoutDelegate::IsHarmonyMode() const {
81 return false; 83 return false;
82 } 84 }
83 85
84 int LayoutDelegate::GetDialogPreferredWidth(DialogWidth width) const { 86 int LayoutDelegate::GetDialogPreferredWidth(DialogWidth width) const {
85 return 0; 87 return 0;
86 } 88 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698