OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/tab_contents/tab_contents.h" | 5 #include "content/browser/tab_contents/tab_contents.h" |
6 | 6 |
7 #include <cmath> | 7 #include <cmath> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
(...skipping 2037 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2048 web_prefs.accelerated_2d_canvas_enabled = false; | 2048 web_prefs.accelerated_2d_canvas_enabled = false; |
2049 } | 2049 } |
2050 | 2050 |
2051 return web_prefs; | 2051 return web_prefs; |
2052 } | 2052 } |
2053 | 2053 |
2054 void TabContents::OnUserGesture() { | 2054 void TabContents::OnUserGesture() { |
2055 // Notify observers. | 2055 // Notify observers. |
2056 FOR_EACH_OBSERVER(WebContentsObserver, observers_, DidGetUserGesture()); | 2056 FOR_EACH_OBSERVER(WebContentsObserver, observers_, DidGetUserGesture()); |
2057 | 2057 |
2058 ResourceDispatcherHost* rdh = | 2058 ResourceDispatcherHost::Get()->OnUserGesture(this); |
2059 content::GetContentClient()->browser()->GetResourceDispatcherHost(); | |
2060 if (rdh) // NULL in unittests. | |
2061 rdh->OnUserGesture(this); | |
2062 } | 2059 } |
2063 | 2060 |
2064 void TabContents::OnIgnoredUIEvent() { | 2061 void TabContents::OnIgnoredUIEvent() { |
2065 // Notify observers. | 2062 // Notify observers. |
2066 FOR_EACH_OBSERVER(WebContentsObserver, observers_, DidGetIgnoredUIEvent()); | 2063 FOR_EACH_OBSERVER(WebContentsObserver, observers_, DidGetIgnoredUIEvent()); |
2067 } | 2064 } |
2068 | 2065 |
2069 void TabContents::RendererUnresponsive(RenderViewHost* rvh, | 2066 void TabContents::RendererUnresponsive(RenderViewHost* rvh, |
2070 bool is_during_unload) { | 2067 bool is_during_unload) { |
2071 // Don't show hung renderer dialog for a swapped out RVH. | 2068 // Don't show hung renderer dialog for a swapped out RVH. |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2234 encoding_ = content::GetContentClient()->browser()-> | 2231 encoding_ = content::GetContentClient()->browser()-> |
2235 GetCanonicalEncodingNameByAliasName(encoding); | 2232 GetCanonicalEncodingNameByAliasName(encoding); |
2236 } | 2233 } |
2237 | 2234 |
2238 void TabContents::CreateViewAndSetSizeForRVH(RenderViewHost* rvh) { | 2235 void TabContents::CreateViewAndSetSizeForRVH(RenderViewHost* rvh) { |
2239 RenderWidgetHostView* rwh_view = GetView()->CreateViewForWidget(rvh); | 2236 RenderWidgetHostView* rwh_view = GetView()->CreateViewForWidget(rvh); |
2240 // Can be NULL during tests. | 2237 // Can be NULL during tests. |
2241 if (rwh_view) | 2238 if (rwh_view) |
2242 rwh_view->SetSize(GetView()->GetContainerSize()); | 2239 rwh_view->SetSize(GetView()->GetContainerSize()); |
2243 } | 2240 } |
OLD | NEW |