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 | |
2612 int RenderWidgetHostViewAura::GetNonClientComponent( | 2606 int RenderWidgetHostViewAura::GetNonClientComponent( |
2613 const gfx::Point& point) const { | 2607 const gfx::Point& point) const { |
2614 return HTCLIENT; | 2608 return HTCLIENT; |
2615 } | 2609 } |
2616 | 2610 |
2617 bool RenderWidgetHostViewAura::ShouldDescendIntoChildForEventHandling( | 2611 bool RenderWidgetHostViewAura::ShouldDescendIntoChildForEventHandling( |
2618 aura::Window* child, | 2612 aura::Window* child, |
2619 const gfx::Point& location) { | 2613 const gfx::Point& location) { |
2620 return true; | 2614 return true; |
2621 } | 2615 } |
(...skipping 476 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3098 } | 3092 } |
3099 | 3093 |
3100 //////////////////////////////////////////////////////////////////////////////// | 3094 //////////////////////////////////////////////////////////////////////////////// |
3101 // RenderWidgetHostViewAura, aura::client::CursorClientObserver implementation: | 3095 // RenderWidgetHostViewAura, aura::client::CursorClientObserver implementation: |
3102 | 3096 |
3103 void RenderWidgetHostViewAura::OnCursorVisibilityChanged(bool is_visible) { | 3097 void RenderWidgetHostViewAura::OnCursorVisibilityChanged(bool is_visible) { |
3104 NotifyRendererOfCursorVisibilityState(is_visible); | 3098 NotifyRendererOfCursorVisibilityState(is_visible); |
3105 } | 3099 } |
3106 | 3100 |
3107 //////////////////////////////////////////////////////////////////////////////// | 3101 //////////////////////////////////////////////////////////////////////////////// |
| 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 //////////////////////////////////////////////////////////////////////////////// |
3108 // RenderWidgetHostViewAura, aura::client::FocusChangeObserver implementation: | 3112 // RenderWidgetHostViewAura, aura::client::FocusChangeObserver implementation: |
3109 | 3113 |
3110 void RenderWidgetHostViewAura::OnWindowFocused(aura::Window* gained_focus, | 3114 void RenderWidgetHostViewAura::OnWindowFocused(aura::Window* gained_focus, |
3111 aura::Window* lost_focus) { | 3115 aura::Window* lost_focus) { |
3112 DCHECK(window_ == gained_focus || window_ == lost_focus); | 3116 DCHECK(window_ == gained_focus || window_ == lost_focus); |
3113 if (window_ == gained_focus) { | 3117 if (window_ == gained_focus) { |
3114 // We need to honor input bypass if the associated tab is does not want | 3118 // We need to honor input bypass if the associated tab is does not want |
3115 // input. This gives the current focused window a chance to be the text | 3119 // input. This gives the current focused window a chance to be the text |
3116 // input client and handle events. | 3120 // input client and handle events. |
3117 if (host_->ignore_input_events()) | 3121 if (host_->ignore_input_events()) |
(...skipping 497 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3615 RenderWidgetHost* widget) { | 3619 RenderWidgetHost* widget) { |
3616 return new RenderWidgetHostViewAura(widget); | 3620 return new RenderWidgetHostViewAura(widget); |
3617 } | 3621 } |
3618 | 3622 |
3619 // static | 3623 // static |
3620 void RenderWidgetHostViewPort::GetDefaultScreenInfo(WebScreenInfo* results) { | 3624 void RenderWidgetHostViewPort::GetDefaultScreenInfo(WebScreenInfo* results) { |
3621 GetScreenInfoForWindow(results, NULL); | 3625 GetScreenInfoForWindow(results, NULL); |
3622 } | 3626 } |
3623 | 3627 |
3624 } // namespace content | 3628 } // namespace content |
OLD | NEW |