Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(232)

Side by Side Diff: content/browser/tab_contents/tab_contents.cc

Issue 9150016: Move creation and ownership of ResourceDispatcherHost and PluginService to content. This gives a ... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: fix chromeos ui_tests Created 8 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/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 2041 matching lines...) Expand 10 before | Expand all | Expand 10 after
2052 web_prefs.accelerated_2d_canvas_enabled = false; 2052 web_prefs.accelerated_2d_canvas_enabled = false;
2053 } 2053 }
2054 2054
2055 return web_prefs; 2055 return web_prefs;
2056 } 2056 }
2057 2057
2058 void TabContents::OnUserGesture() { 2058 void TabContents::OnUserGesture() {
2059 // Notify observers. 2059 // Notify observers.
2060 FOR_EACH_OBSERVER(WebContentsObserver, observers_, DidGetUserGesture()); 2060 FOR_EACH_OBSERVER(WebContentsObserver, observers_, DidGetUserGesture());
2061 2061
2062 ResourceDispatcherHost* rdh = 2062 ResourceDispatcherHost* rdh = ResourceDispatcherHost::Get();
2063 content::GetContentClient()->browser()->GetResourceDispatcherHost();
2064 if (rdh) // NULL in unittests. 2063 if (rdh) // NULL in unittests.
2065 rdh->OnUserGesture(this); 2064 rdh->OnUserGesture(this);
2066 } 2065 }
2067 2066
2068 void TabContents::OnIgnoredUIEvent() { 2067 void TabContents::OnIgnoredUIEvent() {
2069 // Notify observers. 2068 // Notify observers.
2070 FOR_EACH_OBSERVER(WebContentsObserver, observers_, DidGetIgnoredUIEvent()); 2069 FOR_EACH_OBSERVER(WebContentsObserver, observers_, DidGetIgnoredUIEvent());
2071 } 2070 }
2072 2071
2073 void TabContents::RendererUnresponsive(RenderViewHost* rvh, 2072 void TabContents::RendererUnresponsive(RenderViewHost* rvh,
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
2238 encoding_ = content::GetContentClient()->browser()-> 2237 encoding_ = content::GetContentClient()->browser()->
2239 GetCanonicalEncodingNameByAliasName(encoding); 2238 GetCanonicalEncodingNameByAliasName(encoding);
2240 } 2239 }
2241 2240
2242 void TabContents::CreateViewAndSetSizeForRVH(RenderViewHost* rvh) { 2241 void TabContents::CreateViewAndSetSizeForRVH(RenderViewHost* rvh) {
2243 RenderWidgetHostView* rwh_view = GetView()->CreateViewForWidget(rvh); 2242 RenderWidgetHostView* rwh_view = GetView()->CreateViewForWidget(rvh);
2244 // Can be NULL during tests. 2243 // Can be NULL during tests.
2245 if (rwh_view) 2244 if (rwh_view)
2246 rwh_view->SetSize(GetView()->GetContainerSize()); 2245 rwh_view->SetSize(GetView()->GetContainerSize());
2247 } 2246 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698