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

Side by Side Diff: content/browser/renderer_host/text_input_manager.h

Issue 2240553003: Track text selection on the browser side (Mac) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added #ifdef Created 4 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 #ifndef CONTENT_BROWSER_RENDERER_HOST_TEXT_INPUT_MANAGER_H__ 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_TEXT_INPUT_MANAGER_H__
6 #define CONTENT_BROWSER_RENDERER_HOST_TEXT_INPUT_MANAGER_H__ 6 #define CONTENT_BROWSER_RENDERER_HOST_TEXT_INPUT_MANAGER_H__
7 7
8 #include <unordered_map> 8 #include <unordered_map>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 TextInputManager* text_input_manager, 61 TextInputManager* text_input_manager,
62 RenderWidgetHostViewBase* updated_view) {} 62 RenderWidgetHostViewBase* updated_view) {}
63 }; 63 };
64 64
65 // This struct is used to store text selection related information for views. 65 // This struct is used to store text selection related information for views.
66 struct TextSelection { 66 struct TextSelection {
67 TextSelection(); 67 TextSelection();
68 TextSelection(const TextSelection& other); 68 TextSelection(const TextSelection& other);
69 ~TextSelection(); 69 ~TextSelection();
70 70
71 // If text selection is valid, |text| will be populated with the selected
72 // text and the method will return true. Otherwise, it will return false.
73 bool GetSelectedText(base::string16* text) const;
74
71 // The offset of the text stored in |text| relative to the start of the web 75 // The offset of the text stored in |text| relative to the start of the web
72 // page. 76 // page.
73 size_t offset; 77 size_t offset;
74 78
75 // The current selection range relative to the start of the web page. 79 // The current selection range relative to the start of the web page.
76 gfx::Range range; 80 gfx::Range range;
77 81
78 // The text inside and around the current selection range. 82 // The text inside and around the current selection range.
79 base::string16 text; 83 base::string16 text;
80 }; 84 };
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
215 ViewMap<CompositionRangeInfo> composition_range_info_map_; 219 ViewMap<CompositionRangeInfo> composition_range_info_map_;
216 ViewMap<TextSelection> text_selection_map_; 220 ViewMap<TextSelection> text_selection_map_;
217 221
218 base::ObserverList<Observer> observer_list_; 222 base::ObserverList<Observer> observer_list_;
219 223
220 DISALLOW_COPY_AND_ASSIGN(TextInputManager); 224 DISALLOW_COPY_AND_ASSIGN(TextInputManager);
221 }; 225 };
222 } 226 }
223 227
224 #endif // CONTENT_BROWSER_RENDERER_HOST_TEXT_INPUT_MANAGER_H__ 228 #endif // CONTENT_BROWSER_RENDERER_HOST_TEXT_INPUT_MANAGER_H__
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698