| 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 | 6 |
| 7 #include "chrome/browser/browser_list.h" | 7 #include "chrome/browser/browser_list.h" |
| 8 #include "chrome/browser/extensions/extension_process_manager.h" | 8 #include "chrome/browser/extensions/extension_process_manager.h" |
| 9 #include "chrome/browser/extensions/extension_service.h" |
| 9 #include "chrome/browser/notifications/balloon.h" | 10 #include "chrome/browser/notifications/balloon.h" |
| 10 #include "chrome/browser/notifications/notification.h" | 11 #include "chrome/browser/notifications/notification.h" |
| 11 #include "chrome/browser/profiles/profile.h" | 12 #include "chrome/browser/profiles/profile.h" |
| 12 #include "chrome/browser/renderer_preferences_util.h" | 13 #include "chrome/browser/renderer_preferences_util.h" |
| 13 #include "chrome/common/bindings_policy.h" | 14 #include "chrome/common/bindings_policy.h" |
| 14 #include "chrome/common/notification_service.h" | 15 #include "chrome/common/notification_service.h" |
| 15 #include "chrome/common/notification_source.h" | 16 #include "chrome/common/notification_source.h" |
| 16 #include "chrome/common/notification_type.h" | 17 #include "chrome/common/notification_type.h" |
| 17 #include "chrome/common/render_messages.h" | 18 #include "chrome/common/render_messages.h" |
| 18 #include "chrome/common/render_messages_params.h" | 19 #include "chrome/common/render_messages_params.h" |
| (...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 194 RenderViewHost* rvh = new RenderViewHost( | 195 RenderViewHost* rvh = new RenderViewHost( |
| 195 site_instance_.get(), this, MSG_ROUTING_NONE, NULL); | 196 site_instance_.get(), this, MSG_ROUTING_NONE, NULL); |
| 196 if (GetProfile()->GetExtensionService()) { | 197 if (GetProfile()->GetExtensionService()) { |
| 197 extension_function_dispatcher_.reset( | 198 extension_function_dispatcher_.reset( |
| 198 ExtensionFunctionDispatcher::Create( | 199 ExtensionFunctionDispatcher::Create( |
| 199 rvh, this, balloon_->notification().content_url())); | 200 rvh, this, balloon_->notification().content_url())); |
| 200 } | 201 } |
| 201 if (extension_function_dispatcher_.get()) { | 202 if (extension_function_dispatcher_.get()) { |
| 202 rvh->AllowBindings(BindingsPolicy::EXTENSION); | 203 rvh->AllowBindings(BindingsPolicy::EXTENSION); |
| 203 rvh->set_is_extension_process(true); | 204 rvh->set_is_extension_process(true); |
| 205 const Extension* installed_app = |
| 206 GetProfile()->GetExtensionService()->GetInstalledApp( |
| 207 balloon_->notification().content_url()); |
| 208 rvh->set_installed_app(installed_app); |
| 204 } else if (enable_web_ui_) { | 209 } else if (enable_web_ui_) { |
| 205 rvh->AllowBindings(BindingsPolicy::WEB_UI); | 210 rvh->AllowBindings(BindingsPolicy::WEB_UI); |
| 206 } | 211 } |
| 207 | 212 |
| 208 // Do platform-specific initialization. | 213 // Do platform-specific initialization. |
| 209 render_view_host_ = rvh; | 214 render_view_host_ = rvh; |
| 210 InitRenderWidgetHostView(); | 215 InitRenderWidgetHostView(); |
| 211 DCHECK(render_widget_host_view()); | 216 DCHECK(render_widget_host_view()); |
| 212 | 217 |
| 213 rvh->set_view(render_widget_host_view()); | 218 rvh->set_view(render_widget_host_view()); |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 253 | 258 |
| 254 void BalloonHost::NotifyDisconnect() { | 259 void BalloonHost::NotifyDisconnect() { |
| 255 if (!should_notify_on_disconnect_) | 260 if (!should_notify_on_disconnect_) |
| 256 return; | 261 return; |
| 257 | 262 |
| 258 should_notify_on_disconnect_ = false; | 263 should_notify_on_disconnect_ = false; |
| 259 NotificationService::current()->Notify( | 264 NotificationService::current()->Notify( |
| 260 NotificationType::NOTIFY_BALLOON_DISCONNECTED, | 265 NotificationType::NOTIFY_BALLOON_DISCONNECTED, |
| 261 Source<BalloonHost>(this), NotificationService::NoDetails()); | 266 Source<BalloonHost>(this), NotificationService::NoDetails()); |
| 262 } | 267 } |
| OLD | NEW |