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 #include "content/browser/renderer_host/render_widget_host_view_aura.h" | 5 #include "content/browser/renderer_host/render_widget_host_view_aura.h" |
6 | 6 |
7 #include "base/auto_reset.h" | 7 #include "base/auto_reset.h" |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/callback_helpers.h" | 10 #include "base/callback_helpers.h" |
(...skipping 2585 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2596 const gfx::Rect& new_bounds) { | 2596 const gfx::Rect& new_bounds) { |
2597 base::AutoReset<bool> in_bounds_changed(&in_bounds_changed_, true); | 2597 base::AutoReset<bool> in_bounds_changed(&in_bounds_changed_, true); |
2598 // We care about this whenever RenderWidgetHostViewAura is not owned by a | 2598 // We care about this whenever RenderWidgetHostViewAura is not owned by a |
2599 // WebContentsViewAura since changes to the Window's bounds need to be | 2599 // WebContentsViewAura since changes to the Window's bounds need to be |
2600 // messaged to the renderer. WebContentsViewAura invokes SetSize() or | 2600 // messaged to the renderer. WebContentsViewAura invokes SetSize() or |
2601 // SetBounds() itself. No matter how we got here, any redundant calls are | 2601 // SetBounds() itself. No matter how we got here, any redundant calls are |
2602 // harmless. | 2602 // harmless. |
2603 SetSize(new_bounds.size()); | 2603 SetSize(new_bounds.size()); |
2604 } | 2604 } |
2605 | 2605 |
| 2606 gfx::NativeCursor RenderWidgetHostViewAura::GetCursor(const gfx::Point& point) { |
| 2607 if (mouse_locked_) |
| 2608 return ui::kCursorNone; |
| 2609 return current_cursor_.GetNativeCursor(); |
| 2610 } |
| 2611 |
2606 int RenderWidgetHostViewAura::GetNonClientComponent( | 2612 int RenderWidgetHostViewAura::GetNonClientComponent( |
2607 const gfx::Point& point) const { | 2613 const gfx::Point& point) const { |
2608 return HTCLIENT; | 2614 return HTCLIENT; |
2609 } | 2615 } |
2610 | 2616 |
2611 bool RenderWidgetHostViewAura::ShouldDescendIntoChildForEventHandling( | 2617 bool RenderWidgetHostViewAura::ShouldDescendIntoChildForEventHandling( |
2612 aura::Window* child, | 2618 aura::Window* child, |
2613 const gfx::Point& location) { | 2619 const gfx::Point& location) { |
2614 return true; | 2620 return true; |
2615 } | 2621 } |
(...skipping 476 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3092 } | 3098 } |
3093 | 3099 |
3094 //////////////////////////////////////////////////////////////////////////////// | 3100 //////////////////////////////////////////////////////////////////////////////// |
3095 // RenderWidgetHostViewAura, aura::client::CursorClientObserver implementation: | 3101 // RenderWidgetHostViewAura, aura::client::CursorClientObserver implementation: |
3096 | 3102 |
3097 void RenderWidgetHostViewAura::OnCursorVisibilityChanged(bool is_visible) { | 3103 void RenderWidgetHostViewAura::OnCursorVisibilityChanged(bool is_visible) { |
3098 NotifyRendererOfCursorVisibilityState(is_visible); | 3104 NotifyRendererOfCursorVisibilityState(is_visible); |
3099 } | 3105 } |
3100 | 3106 |
3101 //////////////////////////////////////////////////////////////////////////////// | 3107 //////////////////////////////////////////////////////////////////////////////// |
3102 // RenderWidgetHostViewAura, wm::CursorDelegate implementation: | |
3103 | |
3104 gfx::NativeCursor RenderWidgetHostViewAura::GetCursorForPoint( | |
3105 const gfx::Point& point) { | |
3106 if (mouse_locked_) | |
3107 return ui::kCursorNone; | |
3108 return current_cursor_.GetNativeCursor(); | |
3109 } | |
3110 | |
3111 //////////////////////////////////////////////////////////////////////////////// | |
3112 // RenderWidgetHostViewAura, aura::client::FocusChangeObserver implementation: | 3108 // RenderWidgetHostViewAura, aura::client::FocusChangeObserver implementation: |
3113 | 3109 |
3114 void RenderWidgetHostViewAura::OnWindowFocused(aura::Window* gained_focus, | 3110 void RenderWidgetHostViewAura::OnWindowFocused(aura::Window* gained_focus, |
3115 aura::Window* lost_focus) { | 3111 aura::Window* lost_focus) { |
3116 DCHECK(window_ == gained_focus || window_ == lost_focus); | 3112 DCHECK(window_ == gained_focus || window_ == lost_focus); |
3117 if (window_ == gained_focus) { | 3113 if (window_ == gained_focus) { |
3118 // We need to honor input bypass if the associated tab is does not want | 3114 // We need to honor input bypass if the associated tab is does not want |
3119 // input. This gives the current focused window a chance to be the text | 3115 // input. This gives the current focused window a chance to be the text |
3120 // input client and handle events. | 3116 // input client and handle events. |
3121 if (host_->ignore_input_events()) | 3117 if (host_->ignore_input_events()) |
(...skipping 497 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3619 RenderWidgetHost* widget) { | 3615 RenderWidgetHost* widget) { |
3620 return new RenderWidgetHostViewAura(widget); | 3616 return new RenderWidgetHostViewAura(widget); |
3621 } | 3617 } |
3622 | 3618 |
3623 // static | 3619 // static |
3624 void RenderWidgetHostViewPort::GetDefaultScreenInfo(WebScreenInfo* results) { | 3620 void RenderWidgetHostViewPort::GetDefaultScreenInfo(WebScreenInfo* results) { |
3625 GetScreenInfoForWindow(results, NULL); | 3621 GetScreenInfoForWindow(results, NULL); |
3626 } | 3622 } |
3627 | 3623 |
3628 } // namespace content | 3624 } // namespace content |
OLD | NEW |