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

Side by Side Diff: ui/views/views_delegate.cc

Issue 2750063002: views: implement dialog width snapping (Closed)
Patch Set: width -> min_width and improve tests 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) 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 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 return kRelatedControlVerticalSpacing; 155 return kRelatedControlVerticalSpacing;
156 case DistanceMetric::DIALOG_BUTTON_MINIMUM_WIDTH: 156 case DistanceMetric::DIALOG_BUTTON_MINIMUM_WIDTH:
157 return kDialogMinimumButtonWidth; 157 return kDialogMinimumButtonWidth;
158 case DistanceMetric::BUTTON_HORIZONTAL_PADDING: 158 case DistanceMetric::BUTTON_HORIZONTAL_PADDING:
159 return kButtonHorizontalPadding; 159 return kButtonHorizontalPadding;
160 } 160 }
161 NOTREACHED(); 161 NOTREACHED();
162 return 0; 162 return 0;
163 } 163 }
164 164
165 int ViewsDelegate::GetSnappedDialogWidth(int min_width) const {
166 return min_width;
167 }
168
165 ViewsDelegate::ViewsDelegate() 169 ViewsDelegate::ViewsDelegate()
166 : views_tsc_factory_(new ViewsTouchEditingControllerFactory) { 170 : views_tsc_factory_(new ViewsTouchEditingControllerFactory) {
167 DCHECK(!views_delegate); 171 DCHECK(!views_delegate);
168 views_delegate = this; 172 views_delegate = this;
169 173
170 ui::TouchEditingControllerFactory::SetInstance(views_tsc_factory_.get()); 174 ui::TouchEditingControllerFactory::SetInstance(views_tsc_factory_.get());
171 175
172 #if defined(USE_AURA) 176 #if defined(USE_AURA)
173 touch_selection_menu_runner_.reset(new TouchSelectionMenuRunnerViews()); 177 touch_selection_menu_runner_.reset(new TouchSelectionMenuRunnerViews());
174 #endif 178 #endif
175 } 179 }
176 180
177 } // namespace views 181 } // namespace views
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698