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