| 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 "content/browser/renderer_host/render_widget_host_impl.h" | 7 #include "content/browser/renderer_host/render_widget_host_impl.h" |
| 8 #include "content/browser/renderer_host/render_widget_host_view_aura.h" | 8 #include "content/browser/renderer_host/render_widget_host_view_aura.h" |
| 9 #include "content/common/view_messages.h" | 9 #include "content/common/view_messages.h" |
| 10 #include "content/public/browser/render_widget_host.h" | 10 #include "content/public/browser/render_widget_host.h" |
| (...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 300 bool editable = rwhva_->GetTextInputType() != ui::TEXT_INPUT_TYPE_NONE; | 300 bool editable = rwhva_->GetTextInputType() != ui::TEXT_INPUT_TYPE_NONE; |
| 301 gfx::Range selection_range; | 301 gfx::Range selection_range; |
| 302 rwhva_->GetSelectionRange(&selection_range); | 302 rwhva_->GetSelectionRange(&selection_range); |
| 303 bool has_selection = !selection_range.is_empty(); | 303 bool has_selection = !selection_range.is_empty(); |
| 304 switch (command_id) { | 304 switch (command_id) { |
| 305 case IDS_APP_CUT: | 305 case IDS_APP_CUT: |
| 306 return editable && has_selection; | 306 return editable && has_selection; |
| 307 case IDS_APP_COPY: | 307 case IDS_APP_COPY: |
| 308 return has_selection; | 308 return has_selection; |
| 309 case IDS_APP_PASTE: { | 309 case IDS_APP_PASTE: { |
| 310 string16 result; | 310 base::string16 result; |
| 311 ui::Clipboard::GetForCurrentThread()->ReadText( | 311 ui::Clipboard::GetForCurrentThread()->ReadText( |
| 312 ui::CLIPBOARD_TYPE_COPY_PASTE, &result); | 312 ui::CLIPBOARD_TYPE_COPY_PASTE, &result); |
| 313 return editable && !result.empty(); | 313 return editable && !result.empty(); |
| 314 } | 314 } |
| 315 case IDS_APP_DELETE: | 315 case IDS_APP_DELETE: |
| 316 return editable && has_selection; | 316 return editable && has_selection; |
| 317 case IDS_APP_SELECT_ALL: | 317 case IDS_APP_SELECT_ALL: |
| 318 return true; | 318 return true; |
| 319 default: | 319 default: |
| 320 return false; | 320 return false; |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 373 rwhva_ = NULL; | 373 rwhva_ = NULL; |
| 374 } | 374 } |
| 375 text_input_type_ = ui::TEXT_INPUT_TYPE_NONE; | 375 text_input_type_ = ui::TEXT_INPUT_TYPE_NONE; |
| 376 touch_selection_controller_.reset(); | 376 touch_selection_controller_.reset(); |
| 377 handles_hidden_due_to_scroll_ = false; | 377 handles_hidden_due_to_scroll_ = false; |
| 378 scroll_in_progress_ = false; | 378 scroll_in_progress_ = false; |
| 379 overscroll_in_progress_ = false; | 379 overscroll_in_progress_ = false; |
| 380 } | 380 } |
| 381 | 381 |
| 382 } // namespace content | 382 } // namespace content |
| OLD | NEW |