| OLD | NEW |
| 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 "content/renderer/render_view_impl.h" | 5 #include "content/renderer/render_view_impl.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <cmath> | 8 #include <cmath> |
| 9 | 9 |
| 10 #include "base/auto_reset.h" | 10 #include "base/auto_reset.h" |
| (...skipping 2566 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2577 Send(new ViewHostMsg_ImeCancelComposition(routing_id())); | 2577 Send(new ViewHostMsg_ImeCancelComposition(routing_id())); |
| 2578 } | 2578 } |
| 2579 | 2579 |
| 2580 void RenderViewImpl::didChangeSelection(bool is_empty_selection) { | 2580 void RenderViewImpl::didChangeSelection(bool is_empty_selection) { |
| 2581 if (!handling_input_event_ && !handling_select_range_) | 2581 if (!handling_input_event_ && !handling_select_range_) |
| 2582 return; | 2582 return; |
| 2583 | 2583 |
| 2584 if (is_empty_selection) | 2584 if (is_empty_selection) |
| 2585 selection_text_.clear(); | 2585 selection_text_.clear(); |
| 2586 | 2586 |
| 2587 // UpdateTextInputType should be called before SyncSelectionIfRequired. |
| 2588 // UpdateTextInputType may send TextInputTypeChanged to notify the focus |
| 2589 // was changed, and SyncSelectionIfRequired may send SelectionChanged |
| 2590 // to notify the selection was changed. Focus change should be notified |
| 2591 // before selection change. |
| 2592 UpdateTextInputType(); |
| 2587 SyncSelectionIfRequired(); | 2593 SyncSelectionIfRequired(); |
| 2588 UpdateTextInputType(); | |
| 2589 #if defined(OS_ANDROID) | 2594 #if defined(OS_ANDROID) |
| 2590 UpdateTextInputState(false, true); | 2595 UpdateTextInputState(false, true); |
| 2591 #endif | 2596 #endif |
| 2592 } | 2597 } |
| 2593 | 2598 |
| 2594 void RenderViewImpl::didExecuteCommand(const WebString& command_name) { | 2599 void RenderViewImpl::didExecuteCommand(const WebString& command_name) { |
| 2595 const std::string& name = UTF16ToUTF8(command_name); | 2600 const std::string& name = UTF16ToUTF8(command_name); |
| 2596 if (StartsWithASCII(name, "Move", true) || | 2601 if (StartsWithASCII(name, "Move", true) || |
| 2597 StartsWithASCII(name, "Insert", true) || | 2602 StartsWithASCII(name, "Insert", true) || |
| 2598 StartsWithASCII(name, "Delete", true)) | 2603 StartsWithASCII(name, "Delete", true)) |
| (...skipping 4000 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6599 for (size_t i = 0; i < icon_urls.size(); i++) { | 6604 for (size_t i = 0; i < icon_urls.size(); i++) { |
| 6600 WebURL url = icon_urls[i].iconURL(); | 6605 WebURL url = icon_urls[i].iconURL(); |
| 6601 if (!url.isEmpty()) | 6606 if (!url.isEmpty()) |
| 6602 urls.push_back(FaviconURL(url, | 6607 urls.push_back(FaviconURL(url, |
| 6603 ToFaviconType(icon_urls[i].iconType()))); | 6608 ToFaviconType(icon_urls[i].iconType()))); |
| 6604 } | 6609 } |
| 6605 SendUpdateFaviconURL(urls); | 6610 SendUpdateFaviconURL(urls); |
| 6606 } | 6611 } |
| 6607 | 6612 |
| 6608 } // namespace content | 6613 } // namespace content |
| OLD | NEW |