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

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

Issue 2508363003: [refactor] - Move textInputInfo() and textInputType() from WebWidget to WebInputMethodController (Closed)
Patch Set: 'controller' may be nullptr. Created 4 years, 1 month 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 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
(...skipping 5936 matching lines...) Expand 10 before | Expand all | Expand 10 after
5947 } else 5947 } else
5948 #endif 5948 #endif
5949 { 5949 {
5950 WebRange selection = 5950 WebRange selection =
5951 GetRenderWidget()->GetWebWidget()->caretOrSelectionRange(); 5951 GetRenderWidget()->GetWebWidget()->caretOrSelectionRange();
5952 if (selection.isNull()) 5952 if (selection.isNull())
5953 return; 5953 return;
5954 5954
5955 range = gfx::Range(selection.startOffset(), selection.endOffset()); 5955 range = gfx::Range(selection.startOffset(), selection.endOffset());
5956 5956
5957 if (GetRenderWidget()->GetWebWidget()->textInputType() != 5957 if (frame_->inputMethodController()->textInputType() !=
5958 blink::WebTextInputTypeNone) { 5958 blink::WebTextInputTypeNone) {
5959 // If current focused element is editable, we will send 100 more chars 5959 // If current focused element is editable, we will send 100 more chars
5960 // before and after selection. It is for input method surrounding text 5960 // before and after selection. It is for input method surrounding text
5961 // feature. 5961 // feature.
5962 if (selection.startOffset() > kExtraCharsBeforeAndAfterSelection) 5962 if (selection.startOffset() > kExtraCharsBeforeAndAfterSelection)
5963 offset = selection.startOffset() - kExtraCharsBeforeAndAfterSelection; 5963 offset = selection.startOffset() - kExtraCharsBeforeAndAfterSelection;
5964 else 5964 else
5965 offset = 0; 5965 offset = 0;
5966 size_t length = 5966 size_t length =
5967 selection.endOffset() - offset + kExtraCharsBeforeAndAfterSelection; 5967 selection.endOffset() - offset + kExtraCharsBeforeAndAfterSelection;
(...skipping 663 matching lines...) Expand 10 before | Expand all | Expand 10 after
6631 // event target. Potentially a Pepper plugin will receive the event. 6631 // event target. Potentially a Pepper plugin will receive the event.
6632 // In order to tell whether a plugin gets the last mouse event and which it 6632 // In order to tell whether a plugin gets the last mouse event and which it
6633 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets 6633 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets
6634 // the event, it will notify us via DidReceiveMouseEvent() and set itself as 6634 // the event, it will notify us via DidReceiveMouseEvent() and set itself as
6635 // |pepper_last_mouse_event_target_|. 6635 // |pepper_last_mouse_event_target_|.
6636 pepper_last_mouse_event_target_ = nullptr; 6636 pepper_last_mouse_event_target_ = nullptr;
6637 #endif 6637 #endif
6638 } 6638 }
6639 6639
6640 } // namespace content 6640 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/renderer/render_view_browsertest.cc » ('j') | content/renderer/render_widget.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698