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

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

Issue 7863003: Mouse lock implementation, including the renderer side and the Windows version of the browser side. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove two tab chars. Created 9 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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_H_ 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_H_
6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_H_ 6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_H_
7 #pragma once 7 #pragma once
8 8
9 #include <deque> 9 #include <deque>
10 #include <string> 10 #include <string>
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
184 184
185 // Called to notify the RenderWidget that its associated native window got 185 // Called to notify the RenderWidget that its associated native window got
186 // focused. 186 // focused.
187 virtual void GotFocus(); 187 virtual void GotFocus();
188 188
189 // Tells the renderer it got/lost focus. 189 // Tells the renderer it got/lost focus.
190 void Focus(); 190 void Focus();
191 void Blur(); 191 void Blur();
192 virtual void LostCapture(); 192 virtual void LostCapture();
193 193
194 // Called to notify the RenderWidget that it has lost the mouse lock.
195 virtual void LostMouseLock();
196
194 // Tells us whether the page is rendered directly via the GPU process. 197 // Tells us whether the page is rendered directly via the GPU process.
195 bool is_accelerated_compositing_active() { 198 bool is_accelerated_compositing_active() {
196 return is_accelerated_compositing_active_; 199 return is_accelerated_compositing_active_;
197 } 200 }
198 201
199 // Notifies the RenderWidgetHost that the View was destroyed. 202 // Notifies the RenderWidgetHost that the View was destroyed.
200 void ViewDestroyed(); 203 void ViewDestroyed();
201 204
202 // Indicates if the page has finished loading. 205 // Indicates if the page has finished loading.
203 void SetIsLoading(bool is_loading); 206 void SetIsLoading(bool is_loading);
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after
413 // RenderViewHostDelegate). The gestures that count are 1) any mouse down 416 // RenderViewHostDelegate). The gestures that count are 1) any mouse down
414 // event and 2) enter or space key presses. 417 // event and 2) enter or space key presses.
415 virtual void OnUserGesture() {} 418 virtual void OnUserGesture() {}
416 419
417 // Callbacks for notification when the renderer becomes unresponsive to user 420 // Callbacks for notification when the renderer becomes unresponsive to user
418 // input events, and subsequently responsive again. RenderViewHost overrides 421 // input events, and subsequently responsive again. RenderViewHost overrides
419 // these to tell its delegate to show the user a warning. 422 // these to tell its delegate to show the user a warning.
420 virtual void NotifyRendererUnresponsive() {} 423 virtual void NotifyRendererUnresponsive() {}
421 virtual void NotifyRendererResponsive() {} 424 virtual void NotifyRendererResponsive() {}
422 425
426 bool IsMouseLocked() const;
427
423 protected: 428 protected:
424 // true if a renderer has once been valid. We use this flag to display a sad 429 // true if a renderer has once been valid. We use this flag to display a sad
425 // tab only when we lose our renderer and not if a paint occurs during 430 // tab only when we lose our renderer and not if a paint occurs during
426 // initialization. 431 // initialization.
427 bool renderer_initialized_; 432 bool renderer_initialized_;
428 433
429 private: 434 private:
430 FRIEND_TEST_ALL_PREFIXES(RenderWidgetHostTest, Resize); 435 FRIEND_TEST_ALL_PREFIXES(RenderWidgetHostTest, Resize);
431 FRIEND_TEST_ALL_PREFIXES(RenderWidgetHostTest, ResizeThenCrash); 436 FRIEND_TEST_ALL_PREFIXES(RenderWidgetHostTest, ResizeThenCrash);
432 FRIEND_TEST_ALL_PREFIXES(RenderWidgetHostTest, HiddenPaint); 437 FRIEND_TEST_ALL_PREFIXES(RenderWidgetHostTest, HiddenPaint);
(...skipping 26 matching lines...) Expand all
459 464
460 void OnMsgSetCursor(const WebCursor& cursor); 465 void OnMsgSetCursor(const WebCursor& cursor);
461 void OnMsgImeUpdateTextInputState(ui::TextInputType type, 466 void OnMsgImeUpdateTextInputState(ui::TextInputType type,
462 bool can_compose_inline, 467 bool can_compose_inline,
463 const gfx::Rect& caret_rect); 468 const gfx::Rect& caret_rect);
464 void OnMsgImeCompositionRangeChanged(const ui::Range& range); 469 void OnMsgImeCompositionRangeChanged(const ui::Range& range);
465 void OnMsgImeCancelComposition(); 470 void OnMsgImeCancelComposition();
466 471
467 void OnMsgDidActivateAcceleratedCompositing(bool activated); 472 void OnMsgDidActivateAcceleratedCompositing(bool activated);
468 473
474 void OnMsgLockMouse();
475 void OnMsgUnlockMouse();
476
469 #if defined(OS_POSIX) 477 #if defined(OS_POSIX)
470 void OnMsgGetScreenInfo(gfx::NativeViewId view, 478 void OnMsgGetScreenInfo(gfx::NativeViewId view,
471 WebKit::WebScreenInfo* results); 479 WebKit::WebScreenInfo* results);
472 void OnMsgGetWindowRect(gfx::NativeViewId window_id, gfx::Rect* results); 480 void OnMsgGetWindowRect(gfx::NativeViewId window_id, gfx::Rect* results);
473 void OnMsgGetRootWindowRect(gfx::NativeViewId window_id, gfx::Rect* results); 481 void OnMsgGetRootWindowRect(gfx::NativeViewId window_id, gfx::Rect* results);
474 #endif 482 #endif
475 #if defined(OS_MACOSX) 483 #if defined(OS_MACOSX)
476 void OnMsgPluginFocusChanged(bool focused, int plugin_id); 484 void OnMsgPluginFocusChanged(bool focused, int plugin_id);
477 void OnMsgStartPluginIme(); 485 void OnMsgStartPluginIme();
478 void OnAllocateFakePluginWindowHandle(bool opaque, 486 void OnAllocateFakePluginWindowHandle(bool opaque,
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after
674 682
675 std::vector<gfx::PluginWindowHandle> deferred_plugin_handles_; 683 std::vector<gfx::PluginWindowHandle> deferred_plugin_handles_;
676 684
677 // The last scroll offset of the render widget. 685 // The last scroll offset of the render widget.
678 gfx::Point last_scroll_offset_; 686 gfx::Point last_scroll_offset_;
679 687
680 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHost); 688 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHost);
681 }; 689 };
682 690
683 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_H_ 691 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698