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 "base/auto_reset.h" | 7 #include "base/auto_reset.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/files/file_util.h" | 9 #include "base/files/file_util.h" |
10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
(...skipping 928 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
939 | 939 |
940 void WebContentsViewAura::SetOverscrollControllerEnabled(bool enabled) { | 940 void WebContentsViewAura::SetOverscrollControllerEnabled(bool enabled) { |
941 RenderWidgetHostViewAura* view = | 941 RenderWidgetHostViewAura* view = |
942 ToRenderWidgetHostViewAura(web_contents_->GetRenderWidgetHostView()); | 942 ToRenderWidgetHostViewAura(web_contents_->GetRenderWidgetHostView()); |
943 if (view) { | 943 if (view) { |
944 view->SetOverscrollControllerEnabled(enabled); | 944 view->SetOverscrollControllerEnabled(enabled); |
945 if (enabled) | 945 if (enabled) |
946 InstallOverscrollControllerDelegate(view); | 946 InstallOverscrollControllerDelegate(view); |
947 } | 947 } |
948 | 948 |
949 if (!enabled) | 949 if (!enabled) { |
950 navigation_overlay_.reset(); | 950 navigation_overlay_.reset(); |
951 if (!navigation_overlay_) { | 951 } else if (!navigation_overlay_) { |
952 navigation_overlay_.reset( | 952 navigation_overlay_.reset( |
953 new OverscrollNavigationOverlay(web_contents_, window_.get())); | 953 new OverscrollNavigationOverlay(web_contents_, window_.get())); |
954 } | 954 } |
955 } | 955 } |
956 | 956 |
957 //////////////////////////////////////////////////////////////////////////////// | 957 //////////////////////////////////////////////////////////////////////////////// |
958 // WebContentsViewAura, RenderViewHostDelegateView implementation: | 958 // WebContentsViewAura, RenderViewHostDelegateView implementation: |
959 | 959 |
960 void WebContentsViewAura::ShowContextMenu(RenderFrameHost* render_frame_host, | 960 void WebContentsViewAura::ShowContextMenu(RenderFrameHost* render_frame_host, |
961 const ContextMenuParams& params) { | 961 const ContextMenuParams& params) { |
(...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1344 if (visible) { | 1344 if (visible) { |
1345 if (!web_contents_->should_normally_be_visible()) | 1345 if (!web_contents_->should_normally_be_visible()) |
1346 web_contents_->WasShown(); | 1346 web_contents_->WasShown(); |
1347 } else { | 1347 } else { |
1348 if (web_contents_->should_normally_be_visible()) | 1348 if (web_contents_->should_normally_be_visible()) |
1349 web_contents_->WasHidden(); | 1349 web_contents_->WasHidden(); |
1350 } | 1350 } |
1351 } | 1351 } |
1352 | 1352 |
1353 } // namespace content | 1353 } // namespace content |
OLD | NEW |