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

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

Issue 9221017: Hide BrowsingInstance from all but SiteInstance, as intended by design. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase. 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) 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 "chrome/browser/tab_contents/background_contents.h" 5 #include "chrome/browser/tab_contents/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/extensions/extension_message_service.h" 8 #include "chrome/browser/extensions/extension_message_service.h"
9 #include "chrome/browser/profiles/profile.h" 9 #include "chrome/browser/profiles/profile.h"
10 #include "chrome/browser/renderer_preferences_util.h" 10 #include "chrome/browser/renderer_preferences_util.h"
11 #include "chrome/browser/ui/webui/chrome_web_ui_factory.h" 11 #include "chrome/browser/ui/webui/chrome_web_ui_factory.h"
12 #include "chrome/common/chrome_notification_types.h" 12 #include "chrome/common/chrome_notification_types.h"
13 #include "chrome/common/extensions/extension_constants.h" 13 #include "chrome/common/extensions/extension_constants.h"
14 #include "chrome/common/url_constants.h" 14 #include "chrome/common/url_constants.h"
15 #include "chrome/common/chrome_view_type.h" 15 #include "chrome/common/chrome_view_type.h"
16 #include "content/browser/browsing_instance.h"
17 #include "content/browser/renderer_host/render_view_host.h" 16 #include "content/browser/renderer_host/render_view_host.h"
18 #include "content/browser/site_instance.h" 17 #include "content/browser/site_instance.h"
19 #include "content/public/browser/notification_service.h" 18 #include "content/public/browser/notification_service.h"
20 #include "content/public/browser/web_contents.h" 19 #include "content/public/browser/web_contents.h"
21 #include "ui/gfx/rect.h" 20 #include "ui/gfx/rect.h"
22 21
23 using content::WebContents; 22 using content::WebContents;
24 23
25 BackgroundContents::BackgroundContents(SiteInstance* site_instance, 24 BackgroundContents::BackgroundContents(SiteInstance* site_instance,
26 int routing_id, 25 int routing_id,
27 Delegate* delegate) 26 Delegate* delegate)
28 : delegate_(delegate) { 27 : delegate_(delegate) {
29 profile_ = Profile::FromBrowserContext( 28 profile_ = Profile::FromBrowserContext(
30 site_instance->browsing_instance()->browser_context()); 29 site_instance->GetBrowserContext());
31 30
32 // TODO(rafaelw): Implement correct session storage. 31 // TODO(rafaelw): Implement correct session storage.
33 web_contents_.reset(WebContents::Create( 32 web_contents_.reset(WebContents::Create(
34 profile_, site_instance, routing_id, NULL, NULL)); 33 profile_, site_instance, routing_id, NULL, NULL));
35 web_contents_->SetViewType(chrome::VIEW_TYPE_BACKGROUND_CONTENTS); 34 web_contents_->SetViewType(chrome::VIEW_TYPE_BACKGROUND_CONTENTS);
36 web_contents_->SetDelegate(this); 35 web_contents_->SetDelegate(this);
37 content::WebContentsObserver::Observe(web_contents_.get()); 36 content::WebContentsObserver::Observe(web_contents_.get());
38 37
39 // Close ourselves when the application is shutting down. 38 // Close ourselves when the application is shutting down.
40 registrar_.Add(this, content::NOTIFICATION_APP_TERMINATING, 39 registrar_.Add(this, content::NOTIFICATION_APP_TERMINATING,
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 case chrome::NOTIFICATION_PROFILE_DESTROYED: 123 case chrome::NOTIFICATION_PROFILE_DESTROYED:
125 case content::NOTIFICATION_APP_TERMINATING: { 124 case content::NOTIFICATION_APP_TERMINATING: {
126 delete this; 125 delete this;
127 break; 126 break;
128 } 127 }
129 default: 128 default:
130 NOTREACHED() << "Unexpected notification sent."; 129 NOTREACHED() << "Unexpected notification sent.";
131 break; 130 break;
132 } 131 }
133 } 132 }
OLDNEW
« no previous file with comments | « chrome/browser/renderer_host/chrome_render_view_host_observer.cc ('k') | chrome/browser/ui/gtk/web_intent_picker_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698