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

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

Issue 921443003: Fix RenderFrameCreated and RenderFrameDeleted WebContentsObserver methods (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix Geolocation unit tests to create TestWebContents instead of regular WebContents. Created 5 years, 10 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 "chrome/browser/background/background_contents_service.h" 7 #include "chrome/browser/background/background_contents_service.h"
8 #include "chrome/browser/chrome_notification_types.h" 8 #include "chrome/browser/chrome_notification_types.h"
9 #include "chrome/browser/extensions/chrome_extension_web_contents_observer.h" 9 #include "chrome/browser/extensions/chrome_extension_web_contents_observer.h"
10 #include "chrome/browser/profiles/profile.h" 10 #include "chrome/browser/profiles/profile.h"
(...skipping 18 matching lines...) Expand all
29 Delegate* delegate, 29 Delegate* delegate,
30 const std::string& partition_id, 30 const std::string& partition_id,
31 content::SessionStorageNamespace* session_storage_namespace) 31 content::SessionStorageNamespace* session_storage_namespace)
32 : delegate_(delegate) { 32 : delegate_(delegate) {
33 profile_ = Profile::FromBrowserContext( 33 profile_ = Profile::FromBrowserContext(
34 site_instance->GetBrowserContext()); 34 site_instance->GetBrowserContext());
35 35
36 WebContents::CreateParams create_params(profile_, site_instance); 36 WebContents::CreateParams create_params(profile_, site_instance);
37 create_params.routing_id = routing_id; 37 create_params.routing_id = routing_id;
38 create_params.main_frame_routing_id = main_frame_routing_id; 38 create_params.main_frame_routing_id = main_frame_routing_id;
39 create_params.renderer_created = true;
39 if (session_storage_namespace) { 40 if (session_storage_namespace) {
40 content::SessionStorageNamespaceMap session_storage_namespace_map; 41 content::SessionStorageNamespaceMap session_storage_namespace_map;
41 session_storage_namespace_map.insert( 42 session_storage_namespace_map.insert(
42 std::make_pair(partition_id, session_storage_namespace)); 43 std::make_pair(partition_id, session_storage_namespace));
43 web_contents_.reset(WebContents::CreateWithSessionStorage( 44 web_contents_.reset(WebContents::CreateWithSessionStorage(
44 create_params, session_storage_namespace_map)); 45 create_params, session_storage_namespace_map));
45 } else { 46 } else {
46 web_contents_.reset(WebContents::Create(create_params)); 47 web_contents_.reset(WebContents::Create(create_params));
47 } 48 }
48 extensions::SetViewType( 49 extensions::SetViewType(
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
153 case chrome::NOTIFICATION_PROFILE_DESTROYED: 154 case chrome::NOTIFICATION_PROFILE_DESTROYED:
154 case chrome::NOTIFICATION_APP_TERMINATING: { 155 case chrome::NOTIFICATION_APP_TERMINATING: {
155 delete this; 156 delete this;
156 break; 157 break;
157 } 158 }
158 default: 159 default:
159 NOTREACHED() << "Unexpected notification sent."; 160 NOTREACHED() << "Unexpected notification sent.";
160 break; 161 break;
161 } 162 }
162 } 163 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698