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 #ifndef CONTENT_RENDERER_RENDER_VIEW_IMPL_H_ | 5 #ifndef CONTENT_RENDERER_RENDER_VIEW_IMPL_H_ |
6 #define CONTENT_RENDERER_RENDER_VIEW_IMPL_H_ | 6 #define CONTENT_RENDERER_RENDER_VIEW_IMPL_H_ |
7 | 7 |
8 #include <deque> | 8 #include <deque> |
9 #include <map> | 9 #include <map> |
10 #include <set> | 10 #include <set> |
(...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
337 void PluginCrashed(const base::FilePath& plugin_path, | 337 void PluginCrashed(const base::FilePath& plugin_path, |
338 base::ProcessId plugin_pid); | 338 base::ProcessId plugin_pid); |
339 | 339 |
340 // Simulates IME events for testing purpose. | 340 // Simulates IME events for testing purpose. |
341 void SimulateImeSetComposition( | 341 void SimulateImeSetComposition( |
342 const string16& text, | 342 const string16& text, |
343 const std::vector<WebKit::WebCompositionUnderline>& underlines, | 343 const std::vector<WebKit::WebCompositionUnderline>& underlines, |
344 int selection_start, | 344 int selection_start, |
345 int selection_end); | 345 int selection_end); |
346 void SimulateImeConfirmComposition(const string16& text, | 346 void SimulateImeConfirmComposition(const string16& text, |
347 const ui::Range& replacement_range); | 347 const gfx::Range& replacement_range); |
348 | 348 |
349 #if defined(OS_MACOSX) || defined(OS_WIN) | 349 #if defined(OS_MACOSX) || defined(OS_WIN) |
350 // Informs the render view that the given plugin has gained or lost focus. | 350 // Informs the render view that the given plugin has gained or lost focus. |
351 void PluginFocusChanged(bool focused, int plugin_id); | 351 void PluginFocusChanged(bool focused, int plugin_id); |
352 #endif | 352 #endif |
353 | 353 |
354 #if defined(OS_MACOSX) | 354 #if defined(OS_MACOSX) |
355 // Starts plugin IME. | 355 // Starts plugin IME. |
356 void StartPluginIme(); | 356 void StartPluginIme(); |
357 #endif | 357 #endif |
(...skipping 402 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
760 virtual void OnWasHidden() OVERRIDE; | 760 virtual void OnWasHidden() OVERRIDE; |
761 virtual void OnWasShown(bool needs_repainting) OVERRIDE; | 761 virtual void OnWasShown(bool needs_repainting) OVERRIDE; |
762 virtual GURL GetURLForGraphicsContext3D() OVERRIDE; | 762 virtual GURL GetURLForGraphicsContext3D() OVERRIDE; |
763 virtual bool ForceCompositingModeEnabled() OVERRIDE; | 763 virtual bool ForceCompositingModeEnabled() OVERRIDE; |
764 virtual void OnImeSetComposition( | 764 virtual void OnImeSetComposition( |
765 const string16& text, | 765 const string16& text, |
766 const std::vector<WebKit::WebCompositionUnderline>& underlines, | 766 const std::vector<WebKit::WebCompositionUnderline>& underlines, |
767 int selection_start, | 767 int selection_start, |
768 int selection_end) OVERRIDE; | 768 int selection_end) OVERRIDE; |
769 virtual void OnImeConfirmComposition(const string16& text, | 769 virtual void OnImeConfirmComposition(const string16& text, |
770 const ui::Range& replacement_range, | 770 const gfx::Range& replacement_range, |
771 bool keep_selection) OVERRIDE; | 771 bool keep_selection) OVERRIDE; |
772 virtual void SetDeviceScaleFactor(float device_scale_factor) OVERRIDE; | 772 virtual void SetDeviceScaleFactor(float device_scale_factor) OVERRIDE; |
773 virtual ui::TextInputType GetTextInputType() OVERRIDE; | 773 virtual ui::TextInputType GetTextInputType() OVERRIDE; |
774 virtual void GetSelectionBounds(gfx::Rect* start, gfx::Rect* end) OVERRIDE; | 774 virtual void GetSelectionBounds(gfx::Rect* start, gfx::Rect* end) OVERRIDE; |
775 #if defined(OS_MACOSX) || defined(OS_WIN) || defined(USE_AURA) | 775 #if defined(OS_MACOSX) || defined(OS_WIN) || defined(USE_AURA) |
776 virtual void GetCompositionCharacterBounds( | 776 virtual void GetCompositionCharacterBounds( |
777 std::vector<gfx::Rect>* character_bounds) OVERRIDE; | 777 std::vector<gfx::Rect>* character_bounds) OVERRIDE; |
778 virtual void GetCompositionRange(ui::Range* range) OVERRIDE; | 778 virtual void GetCompositionRange(gfx::Range* range) OVERRIDE; |
779 #endif | 779 #endif |
780 virtual bool CanComposeInline() OVERRIDE; | 780 virtual bool CanComposeInline() OVERRIDE; |
781 virtual void DidCommitCompositorFrame() OVERRIDE; | 781 virtual void DidCommitCompositorFrame() OVERRIDE; |
782 virtual void InstrumentWillBeginFrame() OVERRIDE; | 782 virtual void InstrumentWillBeginFrame() OVERRIDE; |
783 virtual void InstrumentDidBeginFrame() OVERRIDE; | 783 virtual void InstrumentDidBeginFrame() OVERRIDE; |
784 virtual void InstrumentDidCancelFrame() OVERRIDE; | 784 virtual void InstrumentDidCancelFrame() OVERRIDE; |
785 virtual void InstrumentWillComposite() OVERRIDE; | 785 virtual void InstrumentWillComposite() OVERRIDE; |
786 virtual bool AllowPartialSwap() const OVERRIDE; | 786 virtual bool AllowPartialSwap() const OVERRIDE; |
787 | 787 |
788 protected: | 788 protected: |
(...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1133 int match_count, | 1133 int match_count, |
1134 int ordinal, | 1134 int ordinal, |
1135 const WebKit::WebRect& selection_rect, | 1135 const WebKit::WebRect& selection_rect, |
1136 bool final_status_update); | 1136 bool final_status_update); |
1137 | 1137 |
1138 // Returns whether |params.selection_text| should be synchronized to the | 1138 // Returns whether |params.selection_text| should be synchronized to the |
1139 // browser before bringing up the context menu. Static for testing. | 1139 // browser before bringing up the context menu. Static for testing. |
1140 static bool ShouldUpdateSelectionTextFromContextMenuParams( | 1140 static bool ShouldUpdateSelectionTextFromContextMenuParams( |
1141 const string16& selection_text, | 1141 const string16& selection_text, |
1142 size_t selection_text_offset, | 1142 size_t selection_text_offset, |
1143 const ui::Range& selection_range, | 1143 const gfx::Range& selection_range, |
1144 const ContextMenuParams& params); | 1144 const ContextMenuParams& params); |
1145 | 1145 |
1146 // Starts nav_state_sync_timer_ if it isn't already running. | 1146 // Starts nav_state_sync_timer_ if it isn't already running. |
1147 void StartNavStateSyncTimerIfNecessary(); | 1147 void StartNavStateSyncTimerIfNecessary(); |
1148 | 1148 |
1149 // Dispatches the current state of selection on the webpage to the browser if | 1149 // Dispatches the current state of selection on the webpage to the browser if |
1150 // it has changed. | 1150 // it has changed. |
1151 // TODO(varunjain): delete this method once we figure out how to keep | 1151 // TODO(varunjain): delete this method once we figure out how to keep |
1152 // selection handles in sync with the webpage. | 1152 // selection handles in sync with the webpage. |
1153 void SyncSelectionIfRequired(); | 1153 void SyncSelectionIfRequired(); |
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1306 // The text selection the last time DidChangeSelection got called. May contain | 1306 // The text selection the last time DidChangeSelection got called. May contain |
1307 // additional characters before and after the selected text, for IMEs. The | 1307 // additional characters before and after the selected text, for IMEs. The |
1308 // portion of this string that is the actual selected text starts at index | 1308 // portion of this string that is the actual selected text starts at index |
1309 // |selection_range_.GetMin() - selection_text_offset_| and has length | 1309 // |selection_range_.GetMin() - selection_text_offset_| and has length |
1310 // |selection_range_.length()|. | 1310 // |selection_range_.length()|. |
1311 string16 selection_text_; | 1311 string16 selection_text_; |
1312 // The offset corresponding to the start of |selection_text_| in the document. | 1312 // The offset corresponding to the start of |selection_text_| in the document. |
1313 size_t selection_text_offset_; | 1313 size_t selection_text_offset_; |
1314 // Range over the document corresponding to the actual selected text (which | 1314 // Range over the document corresponding to the actual selected text (which |
1315 // could correspond to a substring of |selection_text_|; see above). | 1315 // could correspond to a substring of |selection_text_|; see above). |
1316 ui::Range selection_range_; | 1316 gfx::Range selection_range_; |
1317 | 1317 |
1318 // External context menu requests we're waiting for. "Internal" | 1318 // External context menu requests we're waiting for. "Internal" |
1319 // (WebKit-originated) context menu events will have an ID of 0 and will not | 1319 // (WebKit-originated) context menu events will have an ID of 0 and will not |
1320 // be in this map. | 1320 // be in this map. |
1321 // | 1321 // |
1322 // We don't want to add internal ones since some of the "special" page | 1322 // We don't want to add internal ones since some of the "special" page |
1323 // handlers in the browser process just ignore the context menu requests so | 1323 // handlers in the browser process just ignore the context menu requests so |
1324 // avoid showing context menus, and so this will cause right clicks to leak | 1324 // avoid showing context menus, and so this will cause right clicks to leak |
1325 // entries in this map. Most users of the custom context menu (e.g. Pepper | 1325 // entries in this map. Most users of the custom context menu (e.g. Pepper |
1326 // plugins) are normally only on "regular" pages and the regular pages will | 1326 // plugins) are normally only on "regular" pages and the regular pages will |
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1553 // use the Observer interface to filter IPC messages and receive frame change | 1553 // use the Observer interface to filter IPC messages and receive frame change |
1554 // notifications. | 1554 // notifications. |
1555 // --------------------------------------------------------------------------- | 1555 // --------------------------------------------------------------------------- |
1556 | 1556 |
1557 DISALLOW_COPY_AND_ASSIGN(RenderViewImpl); | 1557 DISALLOW_COPY_AND_ASSIGN(RenderViewImpl); |
1558 }; | 1558 }; |
1559 | 1559 |
1560 } // namespace content | 1560 } // namespace content |
1561 | 1561 |
1562 #endif // CONTENT_RENDERER_RENDER_VIEW_IMPL_H_ | 1562 #endif // CONTENT_RENDERER_RENDER_VIEW_IMPL_H_ |
OLD | NEW |