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

Side by Side Diff: ui/views/touchui/touch_selection_controller_impl.cc

Issue 10358013: views: Mark single-argument constructors as explicit. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « ui/views/paint_lock.h ('k') | ui/views/widget/native_widget_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "ui/views/touchui/touch_selection_controller_impl.h" 5 #include "ui/views/touchui/touch_selection_controller_impl.h"
6 6
7 #include "base/time.h" 7 #include "base/time.h"
8 #include "base/utf_string_conversions.h" 8 #include "base/utf_string_conversions.h"
9 #include "grit/ui_strings.h" 9 #include "grit/ui_strings.h"
10 #include "third_party/skia/include/effects/SkGradientShader.h" 10 #include "third_party/skia/include/effects/SkGradientShader.h"
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 return (abs(delta_x) < kMinSelectionSize && abs(delta_y) < kMinSelectionSize); 82 return (abs(delta_x) < kMinSelectionSize && abs(delta_y) < kMinSelectionSize);
83 } 83 }
84 84
85 } // namespace 85 } // namespace
86 86
87 namespace views { 87 namespace views {
88 88
89 // A View that displays the text selection handle. 89 // A View that displays the text selection handle.
90 class TouchSelectionControllerImpl::SelectionHandleView : public View { 90 class TouchSelectionControllerImpl::SelectionHandleView : public View {
91 public: 91 public:
92 SelectionHandleView(TouchSelectionControllerImpl* controller) 92 explicit SelectionHandleView(TouchSelectionControllerImpl* controller)
93 : controller_(controller) { 93 : controller_(controller) {
94 widget_.reset(CreateTouchSelectionPopupWidget()); 94 widget_.reset(CreateTouchSelectionPopupWidget());
95 widget_->SetContentsView(this); 95 widget_->SetContentsView(this);
96 widget_->SetAlwaysOnTop(true); 96 widget_->SetAlwaysOnTop(true);
97 97
98 // We are owned by the TouchSelectionController. 98 // We are owned by the TouchSelectionController.
99 set_parent_owned(false); 99 set_parent_owned(false);
100 } 100 }
101 101
102 virtual ~SelectionHandleView() { 102 virtual ~SelectionHandleView() {
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 193
194 private: 194 private:
195 DISALLOW_COPY_AND_ASSIGN(ContextMenuButtonBackground); 195 DISALLOW_COPY_AND_ASSIGN(ContextMenuButtonBackground);
196 }; 196 };
197 197
198 // A View that displays the touch context menu. 198 // A View that displays the touch context menu.
199 class TouchSelectionControllerImpl::TouchContextMenuView 199 class TouchSelectionControllerImpl::TouchContextMenuView
200 : public ButtonListener, 200 : public ButtonListener,
201 public View { 201 public View {
202 public: 202 public:
203 TouchContextMenuView(TouchSelectionControllerImpl* controller) 203 explicit TouchContextMenuView(TouchSelectionControllerImpl* controller)
204 : controller_(controller) { 204 : controller_(controller) {
205 widget_.reset(CreateTouchSelectionPopupWidget()); 205 widget_.reset(CreateTouchSelectionPopupWidget());
206 widget_->SetContentsView(this); 206 widget_->SetContentsView(this);
207 widget_->SetAlwaysOnTop(true); 207 widget_->SetAlwaysOnTop(true);
208 208
209 // We are owned by the TouchSelectionController. 209 // We are owned by the TouchSelectionController.
210 set_parent_owned(false); 210 set_parent_owned(false);
211 SetLayoutManager(new BoxLayout(BoxLayout::kHorizontal, kContextMenuPadding, 211 SetLayoutManager(new BoxLayout(BoxLayout::kHorizontal, kContextMenuPadding,
212 kContextMenuPadding, kContextMenuPadding)); 212 kContextMenuPadding, kContextMenuPadding));
213 } 213 }
(...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after
488 bool TouchSelectionControllerImpl::IsSelectionHandle2Visible() { 488 bool TouchSelectionControllerImpl::IsSelectionHandle2Visible() {
489 return selection_handle_2_->visible(); 489 return selection_handle_2_->visible();
490 } 490 }
491 491
492 TouchSelectionController* TouchSelectionController::create( 492 TouchSelectionController* TouchSelectionController::create(
493 TouchSelectionClientView* client_view) { 493 TouchSelectionClientView* client_view) {
494 return new TouchSelectionControllerImpl(client_view); 494 return new TouchSelectionControllerImpl(client_view);
495 } 495 }
496 496
497 } // namespace views 497 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/paint_lock.h ('k') | ui/views/widget/native_widget_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698