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

Side by Side Diff: chrome/browser/background/background_contents.cc

Issue 1303773002: Give the main frame a RenderWidget. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix merge conflicts Created 5 years, 2 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
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 "chrome/browser/background/background_contents.h" 5 #include "chrome/browser/background/background_contents.h"
6 6
7 #include "base/profiler/scoped_tracker.h" 7 #include "base/profiler/scoped_tracker.h"
8 #include "chrome/browser/background/background_contents_service.h" 8 #include "chrome/browser/background/background_contents_service.h"
9 #include "chrome/browser/chrome_notification_types.h" 9 #include "chrome/browser/chrome_notification_types.h"
10 #include "chrome/browser/extensions/chrome_extension_web_contents_observer.h" 10 #include "chrome/browser/extensions/chrome_extension_web_contents_observer.h"
(...skipping 12 matching lines...) Expand all
23 #include "extensions/browser/extension_host_queue.h" 23 #include "extensions/browser/extension_host_queue.h"
24 #include "extensions/browser/extensions_browser_client.h" 24 #include "extensions/browser/extensions_browser_client.h"
25 #include "extensions/browser/view_type_utils.h" 25 #include "extensions/browser/view_type_utils.h"
26 #include "ui/gfx/geometry/rect.h" 26 #include "ui/gfx/geometry/rect.h"
27 27
28 using content::SiteInstance; 28 using content::SiteInstance;
29 using content::WebContents; 29 using content::WebContents;
30 30
31 BackgroundContents::BackgroundContents( 31 BackgroundContents::BackgroundContents(
32 SiteInstance* site_instance, 32 SiteInstance* site_instance,
33 int routing_id, 33 int32_t routing_id,
34 int main_frame_routing_id, 34 int32_t main_frame_routing_id,
35 int32_t main_frame_widget_routing_id,
35 Delegate* delegate, 36 Delegate* delegate,
36 const std::string& partition_id, 37 const std::string& partition_id,
37 content::SessionStorageNamespace* session_storage_namespace) 38 content::SessionStorageNamespace* session_storage_namespace)
38 : delegate_(delegate), 39 : delegate_(delegate),
39 extension_host_delegate_(extensions::ExtensionsBrowserClient::Get() 40 extension_host_delegate_(extensions::ExtensionsBrowserClient::Get()
40 ->CreateExtensionHostDelegate()) { 41 ->CreateExtensionHostDelegate()) {
41 profile_ = Profile::FromBrowserContext( 42 profile_ = Profile::FromBrowserContext(
42 site_instance->GetBrowserContext()); 43 site_instance->GetBrowserContext());
43 44
44 WebContents::CreateParams create_params(profile_, site_instance); 45 WebContents::CreateParams create_params(profile_, site_instance);
45 create_params.routing_id = routing_id; 46 create_params.routing_id = routing_id;
46 create_params.main_frame_routing_id = main_frame_routing_id; 47 create_params.main_frame_routing_id = main_frame_routing_id;
48 create_params.main_frame_widget_routing_id = main_frame_widget_routing_id;
47 create_params.renderer_initiated_creation = routing_id != MSG_ROUTING_NONE; 49 create_params.renderer_initiated_creation = routing_id != MSG_ROUTING_NONE;
48 if (session_storage_namespace) { 50 if (session_storage_namespace) {
49 content::SessionStorageNamespaceMap session_storage_namespace_map; 51 content::SessionStorageNamespaceMap session_storage_namespace_map;
50 session_storage_namespace_map.insert( 52 session_storage_namespace_map.insert(
51 std::make_pair(partition_id, session_storage_namespace)); 53 std::make_pair(partition_id, session_storage_namespace));
52 web_contents_.reset(WebContents::CreateWithSessionStorage( 54 web_contents_.reset(WebContents::CreateWithSessionStorage(
53 create_params, session_storage_namespace_map)); 55 create_params, session_storage_namespace_map));
54 } else { 56 } else {
55 web_contents_.reset(WebContents::Create(create_params)); 57 web_contents_.reset(WebContents::Create(create_params));
56 } 58 }
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
212 214
213 void BackgroundContents::AddDeferredStartRenderHostObserver( 215 void BackgroundContents::AddDeferredStartRenderHostObserver(
214 extensions::DeferredStartRenderHostObserver* observer) { 216 extensions::DeferredStartRenderHostObserver* observer) {
215 deferred_start_render_host_observer_list_.AddObserver(observer); 217 deferred_start_render_host_observer_list_.AddObserver(observer);
216 } 218 }
217 219
218 void BackgroundContents::RemoveDeferredStartRenderHostObserver( 220 void BackgroundContents::RemoveDeferredStartRenderHostObserver(
219 extensions::DeferredStartRenderHostObserver* observer) { 221 extensions::DeferredStartRenderHostObserver* observer) {
220 deferred_start_render_host_observer_list_.RemoveObserver(observer); 222 deferred_start_render_host_observer_list_.RemoveObserver(observer);
221 } 223 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698