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/web_contents/web_contents_view_aura.h" | 5 #include "content/browser/web_contents/web_contents_view_aura.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include "base/auto_reset.h" | 10 #include "base/auto_reset.h" |
(...skipping 865 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
876 } | 876 } |
877 | 877 |
878 void WebContentsViewAura::TakeFocus(bool reverse) { | 878 void WebContentsViewAura::TakeFocus(bool reverse) { |
879 if (web_contents_->GetDelegate() && | 879 if (web_contents_->GetDelegate() && |
880 !web_contents_->GetDelegate()->TakeFocus(web_contents_, reverse) && | 880 !web_contents_->GetDelegate()->TakeFocus(web_contents_, reverse) && |
881 delegate_.get()) { | 881 delegate_.get()) { |
882 delegate_->TakeFocus(reverse); | 882 delegate_->TakeFocus(reverse); |
883 } | 883 } |
884 } | 884 } |
885 | 885 |
886 void WebContentsViewAura::ShowDisambiguationPopup( | |
887 const gfx::Rect& target_rect, | |
888 const SkBitmap& zoomed_bitmap, | |
889 const base::Callback<void(ui::GestureEvent*)>& gesture_cb, | |
890 const base::Callback<void(ui::MouseEvent*)>& mouse_cb) { | |
891 if (delegate_) { | |
892 delegate_->ShowDisambiguationPopup(target_rect, zoomed_bitmap, | |
893 window_.get(), gesture_cb, mouse_cb); | |
894 } | |
895 } | |
896 | |
897 void WebContentsViewAura::HideDisambiguationPopup() { | |
898 if (delegate_) | |
899 delegate_->HideDisambiguationPopup(); | |
900 } | |
901 | |
902 //////////////////////////////////////////////////////////////////////////////// | 886 //////////////////////////////////////////////////////////////////////////////// |
903 // WebContentsViewAura, OverscrollControllerDelegate implementation: | 887 // WebContentsViewAura, OverscrollControllerDelegate implementation: |
904 | 888 |
905 gfx::Rect WebContentsViewAura::GetVisibleBounds() const { | 889 gfx::Rect WebContentsViewAura::GetVisibleBounds() const { |
906 RenderWidgetHostView* rwhv = web_contents_->GetRenderWidgetHostView(); | 890 RenderWidgetHostView* rwhv = web_contents_->GetRenderWidgetHostView(); |
907 if (!rwhv || !rwhv->IsShowing()) | 891 if (!rwhv || !rwhv->IsShowing()) |
908 return gfx::Rect(); | 892 return gfx::Rect(); |
909 | 893 |
910 return rwhv->GetViewBounds(); | 894 return rwhv->GetViewBounds(); |
911 } | 895 } |
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1137 void WebContentsViewAura::OnWindowVisibilityChanged(aura::Window* window, | 1121 void WebContentsViewAura::OnWindowVisibilityChanged(aura::Window* window, |
1138 bool visible) { | 1122 bool visible) { |
1139 // Ignore any visibility changes in the hierarchy below. | 1123 // Ignore any visibility changes in the hierarchy below. |
1140 if (window != window_.get() && window_->Contains(window)) | 1124 if (window != window_.get() && window_->Contains(window)) |
1141 return; | 1125 return; |
1142 | 1126 |
1143 web_contents_->UpdateWebContentsVisibility(visible); | 1127 web_contents_->UpdateWebContentsVisibility(visible); |
1144 } | 1128 } |
1145 | 1129 |
1146 } // namespace content | 1130 } // namespace content |
OLD | NEW |