OLD | NEW |
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/notifications/balloon_host.h" | 5 #include "chrome/browser/notifications/balloon_host.h" |
6 #include "chrome/browser/extensions/extension_process_manager.h" | 6 #include "chrome/browser/extensions/extension_process_manager.h" |
7 #include "chrome/browser/extensions/extension_service.h" | 7 #include "chrome/browser/extensions/extension_service.h" |
8 #include "chrome/browser/notifications/balloon.h" | 8 #include "chrome/browser/notifications/balloon.h" |
9 #include "chrome/browser/notifications/notification.h" | 9 #include "chrome/browser/notifications/notification.h" |
10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
199 extension_function_dispatcher_.reset( | 199 extension_function_dispatcher_.reset( |
200 ExtensionFunctionDispatcher::Create( | 200 ExtensionFunctionDispatcher::Create( |
201 rvh, this, balloon_->notification().content_url())); | 201 rvh, this, balloon_->notification().content_url())); |
202 } | 202 } |
203 if (extension_function_dispatcher_.get()) { | 203 if (extension_function_dispatcher_.get()) { |
204 rvh->AllowBindings(BindingsPolicy::EXTENSION); | 204 rvh->AllowBindings(BindingsPolicy::EXTENSION); |
205 rvh->set_is_extension_process(true); | 205 rvh->set_is_extension_process(true); |
206 const Extension* installed_app = | 206 const Extension* installed_app = |
207 GetProfile()->GetExtensionService()->GetInstalledApp( | 207 GetProfile()->GetExtensionService()->GetInstalledApp( |
208 balloon_->notification().content_url()); | 208 balloon_->notification().content_url()); |
209 static_cast<BrowserRenderProcessHost*>(rvh->process())->set_installed_app( | 209 if (installed_app) { |
210 installed_app); | 210 GetProfile()->GetExtensionService()->SetInstalledAppForRenderer( |
| 211 installed_app, rvh->process()->id()); |
| 212 } |
211 } else if (enable_web_ui_) { | 213 } else if (enable_web_ui_) { |
212 rvh->AllowBindings(BindingsPolicy::WEB_UI); | 214 rvh->AllowBindings(BindingsPolicy::WEB_UI); |
213 } | 215 } |
214 | 216 |
215 // Do platform-specific initialization. | 217 // Do platform-specific initialization. |
216 render_view_host_ = rvh; | 218 render_view_host_ = rvh; |
217 InitRenderWidgetHostView(); | 219 InitRenderWidgetHostView(); |
218 DCHECK(render_widget_host_view()); | 220 DCHECK(render_widget_host_view()); |
219 | 221 |
220 rvh->set_view(render_widget_host_view()); | 222 rvh->set_view(render_widget_host_view()); |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
260 | 262 |
261 void BalloonHost::NotifyDisconnect() { | 263 void BalloonHost::NotifyDisconnect() { |
262 if (!should_notify_on_disconnect_) | 264 if (!should_notify_on_disconnect_) |
263 return; | 265 return; |
264 | 266 |
265 should_notify_on_disconnect_ = false; | 267 should_notify_on_disconnect_ = false; |
266 NotificationService::current()->Notify( | 268 NotificationService::current()->Notify( |
267 NotificationType::NOTIFY_BALLOON_DISCONNECTED, | 269 NotificationType::NOTIFY_BALLOON_DISCONNECTED, |
268 Source<BalloonHost>(this), NotificationService::NoDetails()); | 270 Source<BalloonHost>(this), NotificationService::NoDetails()); |
269 } | 271 } |
OLD | NEW |