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

Side by Side Diff: ui/views/views_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 (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 "ui/views/views_delegate.h" 5 #include "ui/views/views_delegate.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "build/build_config.h" 8 #include "build/build_config.h"
9 #include "ui/views/layout/layout_constants.h" 9 #include "ui/views/layout/layout_constants.h"
10 #include "ui/views/views_touch_selection_controller_factory.h" 10 #include "ui/views/views_touch_selection_controller_factory.h"
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 case DistanceMetric::RELATED_BUTTON_HORIZONTAL: 148 case DistanceMetric::RELATED_BUTTON_HORIZONTAL:
149 return kRelatedButtonHSpacing; 149 return kRelatedButtonHSpacing;
150 case DistanceMetric::RELATED_CONTROL_HORIZONTAL: 150 case DistanceMetric::RELATED_CONTROL_HORIZONTAL:
151 return kRelatedControlHorizontalSpacing; 151 return kRelatedControlHorizontalSpacing;
152 case DistanceMetric::RELATED_CONTROL_VERTICAL: 152 case DistanceMetric::RELATED_CONTROL_VERTICAL:
153 return kRelatedControlVerticalSpacing; 153 return kRelatedControlVerticalSpacing;
154 case DistanceMetric::DIALOG_BUTTON_MINIMUM_WIDTH: 154 case DistanceMetric::DIALOG_BUTTON_MINIMUM_WIDTH:
155 return kDialogMinimumButtonWidth; 155 return kDialogMinimumButtonWidth;
156 case DistanceMetric::BUTTON_HORIZONTAL_PADDING: 156 case DistanceMetric::BUTTON_HORIZONTAL_PADDING:
157 return kButtonHorizontalPadding; 157 return kButtonHorizontalPadding;
158 case DistanceMetric::DIALOG_WIDTH_SNAPPING_UNIT:
159 return 1;
158 } 160 }
159 NOTREACHED(); 161 NOTREACHED();
160 return 0; 162 return 0;
161 } 163 }
162 164
163 ViewsDelegate::ViewsDelegate() 165 ViewsDelegate::ViewsDelegate()
164 : views_tsc_factory_(new ViewsTouchEditingControllerFactory) { 166 : views_tsc_factory_(new ViewsTouchEditingControllerFactory) {
165 DCHECK(!views_delegate); 167 DCHECK(!views_delegate);
166 views_delegate = this; 168 views_delegate = this;
167 169
168 ui::TouchEditingControllerFactory::SetInstance(views_tsc_factory_.get()); 170 ui::TouchEditingControllerFactory::SetInstance(views_tsc_factory_.get());
169 171
170 #if defined(USE_AURA) 172 #if defined(USE_AURA)
171 touch_selection_menu_runner_.reset(new TouchSelectionMenuRunnerViews()); 173 touch_selection_menu_runner_.reset(new TouchSelectionMenuRunnerViews());
172 #endif 174 #endif
173 } 175 }
174 176
175 } // namespace views 177 } // namespace views
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698