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_impl.h" | 5 #include "content/browser/renderer_host/render_widget_host_impl.h" |
6 | 6 |
7 #include <math.h> | 7 #include <math.h> |
8 #include <set> | 8 #include <set> |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 637 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
648 } | 648 } |
649 | 649 |
650 if (delegate_) | 650 if (delegate_) |
651 delegate_->RenderWidgetWasResized(this, width_changed); | 651 delegate_->RenderWidgetWasResized(this, width_changed); |
652 } | 652 } |
653 | 653 |
654 void RenderWidgetHostImpl::ResizeRectChanged(const gfx::Rect& new_rect) { | 654 void RenderWidgetHostImpl::ResizeRectChanged(const gfx::Rect& new_rect) { |
655 Send(new ViewMsg_ChangeResizeRect(routing_id_, new_rect)); | 655 Send(new ViewMsg_ChangeResizeRect(routing_id_, new_rect)); |
656 } | 656 } |
657 | 657 |
| 658 base::TimeTicks RenderWidgetHostImpl::LastFocusTime() const { |
| 659 return last_focus_time_; |
| 660 } |
| 661 |
658 void RenderWidgetHostImpl::GotFocus() { | 662 void RenderWidgetHostImpl::GotFocus() { |
659 Focus(); | 663 Focus(); |
660 if (delegate_) | 664 if (delegate_) |
661 delegate_->RenderWidgetGotFocus(this); | 665 delegate_->RenderWidgetGotFocus(this); |
662 } | 666 } |
663 | 667 |
664 void RenderWidgetHostImpl::Focus() { | 668 void RenderWidgetHostImpl::Focus() { |
| 669 last_focus_time_ = base::TimeTicks::Now(); |
665 is_focused_ = true; | 670 is_focused_ = true; |
666 | 671 |
667 Send(new InputMsg_SetFocus(routing_id_, true)); | 672 Send(new InputMsg_SetFocus(routing_id_, true)); |
668 } | 673 } |
669 | 674 |
670 void RenderWidgetHostImpl::Blur() { | 675 void RenderWidgetHostImpl::Blur() { |
671 is_focused_ = false; | 676 is_focused_ = false; |
672 | 677 |
673 // If there is a pending mouse lock request, we don't want to reject it at | 678 // If there is a pending mouse lock request, we don't want to reject it at |
674 // this point. The user can switch focus back to this view and approve the | 679 // this point. The user can switch focus back to this view and approve the |
(...skipping 1414 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2089 } | 2094 } |
2090 | 2095 |
2091 #if defined(OS_WIN) | 2096 #if defined(OS_WIN) |
2092 gfx::NativeViewAccessible | 2097 gfx::NativeViewAccessible |
2093 RenderWidgetHostImpl::GetParentNativeViewAccessible() { | 2098 RenderWidgetHostImpl::GetParentNativeViewAccessible() { |
2094 return delegate_ ? delegate_->GetParentNativeViewAccessible() : NULL; | 2099 return delegate_ ? delegate_->GetParentNativeViewAccessible() : NULL; |
2095 } | 2100 } |
2096 #endif | 2101 #endif |
2097 | 2102 |
2098 } // namespace content | 2103 } // namespace content |
OLD | NEW |