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

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

Issue 23416003: Add content::RenderWidgetHost::MouseEventCallback (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Use a callback instead of a single-method interface Created 7 years, 3 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 (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_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_IMPL_H_ 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_IMPL_H_
6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_IMPL_H_ 6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_IMPL_H_
7 7
8 #include <deque> 8 #include <deque>
9 #include <list> 9 #include <list>
10 #include <map> 10 #include <map>
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 const gfx::Size& desired_size) OVERRIDE; 168 const gfx::Size& desired_size) OVERRIDE;
169 virtual void Replace(const string16& word) OVERRIDE; 169 virtual void Replace(const string16& word) OVERRIDE;
170 virtual void ReplaceMisspelling(const string16& word) OVERRIDE; 170 virtual void ReplaceMisspelling(const string16& word) OVERRIDE;
171 virtual void ResizeRectChanged(const gfx::Rect& new_rect) OVERRIDE; 171 virtual void ResizeRectChanged(const gfx::Rect& new_rect) OVERRIDE;
172 virtual void RestartHangMonitorTimeout() OVERRIDE; 172 virtual void RestartHangMonitorTimeout() OVERRIDE;
173 virtual void SetIgnoreInputEvents(bool ignore_input_events) OVERRIDE; 173 virtual void SetIgnoreInputEvents(bool ignore_input_events) OVERRIDE;
174 virtual void Stop() OVERRIDE; 174 virtual void Stop() OVERRIDE;
175 virtual void WasResized() OVERRIDE; 175 virtual void WasResized() OVERRIDE;
176 virtual void AddKeyboardListener(KeyboardListener* listener) OVERRIDE; 176 virtual void AddKeyboardListener(KeyboardListener* listener) OVERRIDE;
177 virtual void RemoveKeyboardListener(KeyboardListener* listener) OVERRIDE; 177 virtual void RemoveKeyboardListener(KeyboardListener* listener) OVERRIDE;
178 virtual void AddMouseEventCallback(
179 const MouseEventCallback& callback) OVERRIDE;
180 virtual void RemoveMouseEventCallback(
181 const MouseEventCallback& callback) OVERRIDE;
178 virtual void GetWebScreenInfo(WebKit::WebScreenInfo* result) OVERRIDE; 182 virtual void GetWebScreenInfo(WebKit::WebScreenInfo* result) OVERRIDE;
179 virtual void GetSnapshotFromRenderer( 183 virtual void GetSnapshotFromRenderer(
180 const gfx::Rect& src_subrect, 184 const gfx::Rect& src_subrect,
181 const base::Callback<void(bool, const SkBitmap&)>& callback) OVERRIDE; 185 const base::Callback<void(bool, const SkBitmap&)>& callback) OVERRIDE;
182 186
183 const NativeWebKeyboardEvent* GetLastKeyboardEvent() const; 187 const NativeWebKeyboardEvent* GetLastKeyboardEvent() const;
184 188
185 // Notification that the screen info has changed. 189 // Notification that the screen info has changed.
186 void NotifyScreenInfoChanged(); 190 void NotifyScreenInfoChanged();
187 191
(...skipping 510 matching lines...) Expand 10 before | Expand all | Expand 10 after
698 // |dib| and its corresponding location |bitmap_rect| in the backing store 702 // |dib| and its corresponding location |bitmap_rect| in the backing store
699 // is the newly painted pixels by the renderer. 703 // is the newly painted pixels by the renderer.
700 void ScrollBackingStoreRect(const gfx::Vector2d& delta, 704 void ScrollBackingStoreRect(const gfx::Vector2d& delta,
701 const gfx::Rect& clip_rect, 705 const gfx::Rect& clip_rect,
702 const gfx::Size& view_size); 706 const gfx::Size& view_size);
703 707
704 // Give key press listeners a chance to handle this key press. This allow 708 // Give key press listeners a chance to handle this key press. This allow
705 // widgets that don't have focus to still handle key presses. 709 // widgets that don't have focus to still handle key presses.
706 bool KeyPressListenersHandleEvent(const NativeWebKeyboardEvent& event); 710 bool KeyPressListenersHandleEvent(const NativeWebKeyboardEvent& event);
707 711
712 // Give mouse event callbacks a chance to handle this mouse event.
713 bool MouseEventCallbacksHandleEvent(const WebKit::WebMouseEvent& event);
714
708 // InputRouterClient 715 // InputRouterClient
709 virtual InputEventAckState FilterInputEvent( 716 virtual InputEventAckState FilterInputEvent(
710 const WebKit::WebInputEvent& event, 717 const WebKit::WebInputEvent& event,
711 const ui::LatencyInfo& latency_info) OVERRIDE; 718 const ui::LatencyInfo& latency_info) OVERRIDE;
712 virtual void IncrementInFlightEventCount() OVERRIDE; 719 virtual void IncrementInFlightEventCount() OVERRIDE;
713 virtual void DecrementInFlightEventCount() OVERRIDE; 720 virtual void DecrementInFlightEventCount() OVERRIDE;
714 virtual void OnHasTouchEventHandlers(bool has_handlers) OVERRIDE; 721 virtual void OnHasTouchEventHandlers(bool has_handlers) OVERRIDE;
715 virtual bool OnSendKeyboardEvent( 722 virtual bool OnSendKeyboardEvent(
716 const NativeWebKeyboardEvent& key_event, 723 const NativeWebKeyboardEvent& key_event,
717 const ui::LatencyInfo& latency_info, 724 const ui::LatencyInfo& latency_info,
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
817 824
818 bool waiting_for_screen_rects_ack_; 825 bool waiting_for_screen_rects_ack_;
819 gfx::Rect last_view_screen_rect_; 826 gfx::Rect last_view_screen_rect_;
820 gfx::Rect last_window_screen_rect_; 827 gfx::Rect last_window_screen_rect_;
821 828
822 AccessibilityMode accessibility_mode_; 829 AccessibilityMode accessibility_mode_;
823 830
824 // Keyboard event listeners. 831 // Keyboard event listeners.
825 ObserverList<KeyboardListener> keyboard_listeners_; 832 ObserverList<KeyboardListener> keyboard_listeners_;
826 833
834 // Mouse event callbacks.
835 std::vector<MouseEventCallback> mouse_event_callbacks_;
836
827 // If true, then we should repaint when restoring even if we have a 837 // If true, then we should repaint when restoring even if we have a
828 // backingstore. This flag is set to true if we receive a paint message 838 // backingstore. This flag is set to true if we receive a paint message
829 // while is_hidden_ to true. Even though we tell the render widget to hide 839 // while is_hidden_ to true. Even though we tell the render widget to hide
830 // itself, a paint message could already be in flight at that point. 840 // itself, a paint message could already be in flight at that point.
831 bool needs_repainting_on_restore_; 841 bool needs_repainting_on_restore_;
832 842
833 // This is true if the renderer is currently unresponsive. 843 // This is true if the renderer is currently unresponsive.
834 bool is_unresponsive_; 844 bool is_unresponsive_;
835 845
836 // The following value indicates a time in the future when we would consider 846 // The following value indicates a time in the future when we would consider
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
917 int64 last_input_number_; 927 int64 last_input_number_;
918 928
919 BrowserRenderingStats rendering_stats_; 929 BrowserRenderingStats rendering_stats_;
920 930
921 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostImpl); 931 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostImpl);
922 }; 932 };
923 933
924 } // namespace content 934 } // namespace content
925 935
926 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_IMPL_H_ 936 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698