| 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 "content/browser/web_contents/touch_editable_impl_aura.h" | 5 #include "content/browser/web_contents/touch_editable_impl_aura.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" |
| 7 #include "content/browser/renderer_host/render_widget_host_impl.h" | 8 #include "content/browser/renderer_host/render_widget_host_impl.h" |
| 8 #include "content/browser/renderer_host/render_widget_host_view_aura.h" | 9 #include "content/browser/renderer_host/render_widget_host_view_aura.h" |
| 9 #include "content/common/view_messages.h" | 10 #include "content/common/view_messages.h" |
| 10 #include "content/public/browser/render_widget_host.h" | 11 #include "content/public/browser/render_widget_host.h" |
| 11 #include "grit/ui_strings.h" | 12 #include "grit/ui_strings.h" |
| 12 #include "ui/aura/client/activation_client.h" | 13 #include "ui/aura/client/activation_client.h" |
| 13 #include "ui/aura/client/screen_position_client.h" | 14 #include "ui/aura/client/screen_position_client.h" |
| 14 #include "ui/aura/root_window.h" | 15 #include "ui/aura/root_window.h" |
| 15 #include "ui/aura/window.h" | 16 #include "ui/aura/window.h" |
| 16 #include "ui/base/clipboard/clipboard.h" | 17 #include "ui/base/clipboard/clipboard.h" |
| 17 #include "ui/base/range/range.h" | 18 #include "ui/base/range/range.h" |
| 18 #include "ui/base/ui_base_switches_util.h" | 19 #include "ui/base/ui_base_switches.h" |
| 19 | 20 |
| 20 namespace content { | 21 namespace content { |
| 21 | 22 |
| 22 //////////////////////////////////////////////////////////////////////////////// | 23 //////////////////////////////////////////////////////////////////////////////// |
| 23 // TouchEditableImplAura, public: | 24 // TouchEditableImplAura, public: |
| 24 | 25 |
| 25 TouchEditableImplAura::~TouchEditableImplAura() { | 26 TouchEditableImplAura::~TouchEditableImplAura() { |
| 26 Cleanup(); | 27 Cleanup(); |
| 27 } | 28 } |
| 28 | 29 |
| 29 // static | 30 // static |
| 30 TouchEditableImplAura* TouchEditableImplAura::Create() { | 31 TouchEditableImplAura* TouchEditableImplAura::Create() { |
| 31 if (switches::IsTouchEditingEnabled()) | 32 #if defined(OS_CHROMEOS) |
| 33 if (CommandLine::ForCurrentProcess()->HasSwitch( |
| 34 switches::kEnableTouchEditing)) |
| 32 return new TouchEditableImplAura(); | 35 return new TouchEditableImplAura(); |
| 36 #endif |
| 33 return NULL; | 37 return NULL; |
| 34 } | 38 } |
| 35 | 39 |
| 36 void TouchEditableImplAura::AttachToView(RenderWidgetHostViewAura* view) { | 40 void TouchEditableImplAura::AttachToView(RenderWidgetHostViewAura* view) { |
| 37 if (rwhva_ == view) | 41 if (rwhva_ == view) |
| 38 return; | 42 return; |
| 39 | 43 |
| 40 Cleanup(); | 44 Cleanup(); |
| 41 if (!view) | 45 if (!view) |
| 42 return; | 46 return; |
| (...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 301 | 305 |
| 302 void TouchEditableImplAura::Cleanup() { | 306 void TouchEditableImplAura::Cleanup() { |
| 303 if (rwhva_) { | 307 if (rwhva_) { |
| 304 rwhva_->set_touch_editing_client(NULL); | 308 rwhva_->set_touch_editing_client(NULL); |
| 305 rwhva_ = NULL; | 309 rwhva_ = NULL; |
| 306 } | 310 } |
| 307 touch_selection_controller_.reset(); | 311 touch_selection_controller_.reset(); |
| 308 } | 312 } |
| 309 | 313 |
| 310 } // namespace content | 314 } // namespace content |
| OLD | NEW |