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/browser/browser_plugin/browser_plugin_guest.h" | 5 #include "content/browser/browser_plugin/browser_plugin_guest.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
10 #include "base/pickle.h" | 10 #include "base/pickle.h" |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 if (rwhv) { | 122 if (rwhv) { |
123 ViewHostMsg_TextInputState_Params params; | 123 ViewHostMsg_TextInputState_Params params; |
124 params.type = last_text_input_type_; | 124 params.type = last_text_input_type_; |
125 params.mode = last_input_mode_; | 125 params.mode = last_input_mode_; |
126 params.can_compose_inline = last_can_compose_inline_; | 126 params.can_compose_inline = last_can_compose_inline_; |
127 rwhv->TextInputStateChanged(params); | 127 rwhv->TextInputStateChanged(params); |
128 } | 128 } |
129 } | 129 } |
130 | 130 |
131 void BrowserPluginGuest::SetTooltipText(const base::string16& tooltip_text) { | 131 void BrowserPluginGuest::SetTooltipText(const base::string16& tooltip_text) { |
| 132 if (tooltip_text == current_tooltip_text_) |
| 133 return; |
| 134 current_tooltip_text_ = tooltip_text; |
| 135 |
132 SendMessageToEmbedder(new BrowserPluginMsg_SetTooltipText( | 136 SendMessageToEmbedder(new BrowserPluginMsg_SetTooltipText( |
133 browser_plugin_instance_id_, tooltip_text)); | 137 browser_plugin_instance_id_, tooltip_text)); |
134 } | 138 } |
135 | 139 |
136 bool BrowserPluginGuest::LockMouse(bool allowed) { | 140 bool BrowserPluginGuest::LockMouse(bool allowed) { |
137 if (!attached() || (mouse_locked_ == allowed)) | 141 if (!attached() || (mouse_locked_ == allowed)) |
138 return false; | 142 return false; |
139 | 143 |
140 return embedder_web_contents()->GotResponseToLockMouseRequest(allowed); | 144 return embedder_web_contents()->GotResponseToLockMouseRequest(allowed); |
141 } | 145 } |
(...skipping 667 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
809 void BrowserPluginGuest::OnImeCompositionRangeChanged( | 813 void BrowserPluginGuest::OnImeCompositionRangeChanged( |
810 const gfx::Range& range, | 814 const gfx::Range& range, |
811 const std::vector<gfx::Rect>& character_bounds) { | 815 const std::vector<gfx::Rect>& character_bounds) { |
812 static_cast<RenderWidgetHostViewBase*>( | 816 static_cast<RenderWidgetHostViewBase*>( |
813 web_contents()->GetRenderWidgetHostView())->ImeCompositionRangeChanged( | 817 web_contents()->GetRenderWidgetHostView())->ImeCompositionRangeChanged( |
814 range, character_bounds); | 818 range, character_bounds); |
815 } | 819 } |
816 #endif | 820 #endif |
817 | 821 |
818 } // namespace content | 822 } // namespace content |
OLD | NEW |