OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/notifications/balloon_host.h" | 5 #include "chrome/browser/notifications/balloon_host.h" |
6 | 6 |
7 #include "chrome/browser/browser_list.h" | 7 #include "chrome/browser/browser_list.h" |
8 #include "chrome/browser/in_process_webkit/webkit_context.h" | |
9 #include "chrome/browser/extensions/extension_process_manager.h" | 8 #include "chrome/browser/extensions/extension_process_manager.h" |
10 #include "chrome/browser/notifications/balloon.h" | 9 #include "chrome/browser/notifications/balloon.h" |
11 #include "chrome/browser/profile.h" | 10 #include "chrome/browser/profile.h" |
12 #include "chrome/browser/renderer_host/render_view_host.h" | 11 #include "chrome/browser/renderer_host/render_view_host.h" |
13 #include "chrome/browser/renderer_host/site_instance.h" | 12 #include "chrome/browser/renderer_host/site_instance.h" |
14 #include "chrome/browser/renderer_preferences_util.h" | 13 #include "chrome/browser/renderer_preferences_util.h" |
15 #include "chrome/common/bindings_policy.h" | 14 #include "chrome/common/bindings_policy.h" |
16 #include "chrome/common/notification_service.h" | 15 #include "chrome/common/notification_service.h" |
17 #include "chrome/common/notification_type.h" | 16 #include "chrome/common/notification_type.h" |
18 #include "chrome/common/render_messages.h" | 17 #include "chrome/common/render_messages.h" |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 } | 127 } |
129 | 128 |
130 RendererPreferences BalloonHost::GetRendererPrefs(Profile* profile) const { | 129 RendererPreferences BalloonHost::GetRendererPrefs(Profile* profile) const { |
131 RendererPreferences preferences; | 130 RendererPreferences preferences; |
132 renderer_preferences_util::UpdateFromSystemSettings(&preferences, profile); | 131 renderer_preferences_util::UpdateFromSystemSettings(&preferences, profile); |
133 return preferences; | 132 return preferences; |
134 } | 133 } |
135 | 134 |
136 void BalloonHost::Init() { | 135 void BalloonHost::Init() { |
137 DCHECK(!render_view_host_) << "BalloonViewHost already initialized."; | 136 DCHECK(!render_view_host_) << "BalloonViewHost already initialized."; |
138 int64 session_storage_namespace_id = balloon_->profile()->GetWebKitContext()-> | 137 RenderViewHost* rvh = new RenderViewHost( |
139 dom_storage_context()->AllocateSessionStorageNamespaceId(); | 138 site_instance_.get(), this, MSG_ROUTING_NONE, NULL); |
140 RenderViewHost* rvh = new RenderViewHost(site_instance_.get(), | |
141 this, MSG_ROUTING_NONE, | |
142 session_storage_namespace_id); | |
143 if (GetProfile()->GetExtensionsService()) { | 139 if (GetProfile()->GetExtensionsService()) { |
144 extension_function_dispatcher_.reset( | 140 extension_function_dispatcher_.reset( |
145 ExtensionFunctionDispatcher::Create( | 141 ExtensionFunctionDispatcher::Create( |
146 rvh, this, balloon_->notification().content_url())); | 142 rvh, this, balloon_->notification().content_url())); |
147 } | 143 } |
148 if (extension_function_dispatcher_.get()) { | 144 if (extension_function_dispatcher_.get()) { |
149 rvh->AllowBindings(BindingsPolicy::EXTENSION); | 145 rvh->AllowBindings(BindingsPolicy::EXTENSION); |
150 rvh->set_is_extension_process(true); | 146 rvh->set_is_extension_process(true); |
151 } else if (enable_dom_ui_) { | 147 } else if (enable_dom_ui_) { |
152 rvh->AllowBindings(BindingsPolicy::DOM_UI); | 148 rvh->AllowBindings(BindingsPolicy::DOM_UI); |
(...skipping 19 matching lines...) Expand all Loading... |
172 | 168 |
173 void BalloonHost::NotifyDisconnect() { | 169 void BalloonHost::NotifyDisconnect() { |
174 if (!should_notify_on_disconnect_) | 170 if (!should_notify_on_disconnect_) |
175 return; | 171 return; |
176 | 172 |
177 should_notify_on_disconnect_ = false; | 173 should_notify_on_disconnect_ = false; |
178 NotificationService::current()->Notify( | 174 NotificationService::current()->Notify( |
179 NotificationType::NOTIFY_BALLOON_DISCONNECTED, | 175 NotificationType::NOTIFY_BALLOON_DISCONNECTED, |
180 Source<BalloonHost>(this), NotificationService::NoDetails()); | 176 Source<BalloonHost>(this), NotificationService::NoDetails()); |
181 } | 177 } |
OLD | NEW |