Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1054)

Side by Side Diff: content/renderer/render_frame_impl.cc

Issue 1249013005: Merge ViewHostMsg_TextInputTypeChanged and ViewHostMsg_TextInputStateChanged into one. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nits. Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 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/renderer/render_frame_impl.h" 5 #include "content/renderer/render_frame_impl.h"
6 6
7 #include <map> 7 #include <map>
8 #include <string> 8 #include <string>
9 9
10 #include "base/auto_reset.h" 10 #include "base/auto_reset.h"
(...skipping 781 matching lines...) Expand 10 before | Expand all | Expand 10 after
792 void RenderFrameImpl::PepperDidReceiveMouseEvent( 792 void RenderFrameImpl::PepperDidReceiveMouseEvent(
793 PepperPluginInstanceImpl* instance) { 793 PepperPluginInstanceImpl* instance) {
794 render_view_->set_pepper_last_mouse_event_target(instance); 794 render_view_->set_pepper_last_mouse_event_target(instance);
795 } 795 }
796 796
797 void RenderFrameImpl::PepperTextInputTypeChanged( 797 void RenderFrameImpl::PepperTextInputTypeChanged(
798 PepperPluginInstanceImpl* instance) { 798 PepperPluginInstanceImpl* instance) {
799 if (instance != render_view_->focused_pepper_plugin()) 799 if (instance != render_view_->focused_pepper_plugin())
800 return; 800 return;
801 801
802 GetRenderWidget()->UpdateTextInputType(); 802 GetRenderWidget()->UpdateTextInputState(
803 RenderWidget::NO_SHOW_IME, RenderWidget::FROM_NON_IME);
803 804
804 FocusedNodeChangedForAccessibility(WebNode()); 805 FocusedNodeChangedForAccessibility(WebNode());
805 } 806 }
806 807
807 void RenderFrameImpl::PepperCaretPositionChanged( 808 void RenderFrameImpl::PepperCaretPositionChanged(
808 PepperPluginInstanceImpl* instance) { 809 PepperPluginInstanceImpl* instance) {
809 if (instance != render_view_->focused_pepper_plugin()) 810 if (instance != render_view_->focused_pepper_plugin())
810 return; 811 return;
811 GetRenderWidget()->UpdateSelectionBounds(); 812 GetRenderWidget()->UpdateSelectionBounds();
812 } 813 }
(...skipping 2194 matching lines...) Expand 10 before | Expand all | Expand 10 after
3007 notification_permission_dispatcher_->RequestPermission(origin, callback); 3008 notification_permission_dispatcher_->RequestPermission(origin, callback);
3008 } 3009 }
3009 3010
3010 void RenderFrameImpl::didChangeSelection(bool is_empty_selection) { 3011 void RenderFrameImpl::didChangeSelection(bool is_empty_selection) {
3011 if (!GetRenderWidget()->handling_input_event() && !handling_select_range_) 3012 if (!GetRenderWidget()->handling_input_event() && !handling_select_range_)
3012 return; 3013 return;
3013 3014
3014 if (is_empty_selection) 3015 if (is_empty_selection)
3015 selection_text_.clear(); 3016 selection_text_.clear();
3016 3017
3017 // UpdateTextInputType should be called before SyncSelectionIfRequired. 3018 // UpdateTextInputState should be called before SyncSelectionIfRequired.
3018 // UpdateTextInputType may send TextInputTypeChanged to notify the focus 3019 // UpdateTextInputState may send TextInputStateChanged to notify the focus
3019 // was changed, and SyncSelectionIfRequired may send SelectionChanged 3020 // was changed, and SyncSelectionIfRequired may send SelectionChanged
3020 // to notify the selection was changed. Focus change should be notified 3021 // to notify the selection was changed. Focus change should be notified
3021 // before selection change. 3022 // before selection change.
3022 GetRenderWidget()->UpdateTextInputType(); 3023 GetRenderWidget()->UpdateTextInputState(
3024 RenderWidget::NO_SHOW_IME, RenderWidget::FROM_NON_IME);
3023 SyncSelectionIfRequired(); 3025 SyncSelectionIfRequired();
3024 #if defined(OS_ANDROID)
3025 GetRenderWidget()->UpdateTextInputState(RenderWidget::NO_SHOW_IME,
3026 RenderWidget::FROM_NON_IME);
3027 #endif
3028 } 3026 }
3029 3027
3030 blink::WebColorChooser* RenderFrameImpl::createColorChooser( 3028 blink::WebColorChooser* RenderFrameImpl::createColorChooser(
3031 blink::WebColorChooserClient* client, 3029 blink::WebColorChooserClient* client,
3032 const blink::WebColor& initial_color, 3030 const blink::WebColor& initial_color,
3033 const blink::WebVector<blink::WebColorSuggestion>& suggestions) { 3031 const blink::WebVector<blink::WebColorSuggestion>& suggestions) {
3034 RendererWebColorChooserImpl* color_chooser = 3032 RendererWebColorChooserImpl* color_chooser =
3035 new RendererWebColorChooserImpl(this, client); 3033 new RendererWebColorChooserImpl(this, client);
3036 std::vector<ColorSuggestion> color_suggestions; 3034 std::vector<ColorSuggestion> color_suggestions;
3037 for (size_t i = 0; i < suggestions.size(); i++) { 3035 for (size_t i = 0; i < suggestions.size(); i++) {
(...skipping 2013 matching lines...) Expand 10 before | Expand all | Expand 10 after
5051 void RenderFrameImpl::RegisterMojoServices() { 5049 void RenderFrameImpl::RegisterMojoServices() {
5052 // Only main frame have ImageDownloader service. 5050 // Only main frame have ImageDownloader service.
5053 if (!frame_->parent()) { 5051 if (!frame_->parent()) {
5054 GetServiceRegistry()->AddService<image_downloader::ImageDownloader>( 5052 GetServiceRegistry()->AddService<image_downloader::ImageDownloader>(
5055 base::Bind(&ImageDownloaderImpl::CreateMojoService, 5053 base::Bind(&ImageDownloaderImpl::CreateMojoService,
5056 base::Unretained(this))); 5054 base::Unretained(this)));
5057 } 5055 }
5058 } 5056 }
5059 5057
5060 } // namespace content 5058 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698