OLD | NEW |
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/touchui/touch_selection_controller_impl.h" | 5 #include "ui/views/touchui/touch_selection_controller_impl.h" |
6 | 6 |
7 #include "base/command_line.h" | |
8 #include "base/time.h" | 7 #include "base/time.h" |
9 #include "grit/ui_strings.h" | 8 #include "grit/ui_strings.h" |
10 #include "ui/base/ui_base_switches.h" | 9 #include "ui/base/ui_base_switches_util.h" |
11 #include "ui/gfx/canvas.h" | 10 #include "ui/gfx/canvas.h" |
12 #include "ui/gfx/rect.h" | 11 #include "ui/gfx/rect.h" |
13 #include "ui/gfx/screen.h" | 12 #include "ui/gfx/screen.h" |
14 #include "ui/gfx/size.h" | 13 #include "ui/gfx/size.h" |
15 #include "ui/views/corewm/shadow_types.h" | 14 #include "ui/views/corewm/shadow_types.h" |
16 #include "ui/views/widget/widget.h" | 15 #include "ui/views/widget/widget.h" |
17 | 16 |
18 namespace { | 17 namespace { |
19 | 18 |
20 // Constants defining the visual attributes of selection handles | 19 // Constants defining the visual attributes of selection handles |
(...skipping 392 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
413 | 412 |
414 bool TouchSelectionControllerImpl::IsCursorHandleVisible() { | 413 bool TouchSelectionControllerImpl::IsCursorHandleVisible() { |
415 return cursor_handle_->visible(); | 414 return cursor_handle_->visible(); |
416 } | 415 } |
417 | 416 |
418 ViewsTouchSelectionControllerFactory::ViewsTouchSelectionControllerFactory() { | 417 ViewsTouchSelectionControllerFactory::ViewsTouchSelectionControllerFactory() { |
419 } | 418 } |
420 | 419 |
421 ui::TouchSelectionController* ViewsTouchSelectionControllerFactory::create( | 420 ui::TouchSelectionController* ViewsTouchSelectionControllerFactory::create( |
422 ui::TouchEditable* client_view) { | 421 ui::TouchEditable* client_view) { |
423 #if defined(OS_CHROMEOS) | 422 if (switches::IsTouchEditingEnabled()) |
424 if (CommandLine::ForCurrentProcess()->HasSwitch( | |
425 switches::kEnableTouchEditing)) | |
426 return new views::TouchSelectionControllerImpl(client_view); | 423 return new views::TouchSelectionControllerImpl(client_view); |
427 #endif | |
428 return NULL; | 424 return NULL; |
429 } | 425 } |
430 | 426 |
431 } // namespace views | 427 } // namespace views |
OLD | NEW |