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/extensions/extension_process_manager.h" | 8 #include "chrome/browser/extensions/extension_process_manager.h" |
9 #include "chrome/browser/notifications/balloon.h" | 9 #include "chrome/browser/notifications/balloon.h" |
10 #include "chrome/browser/notifications/notification.h" | 10 #include "chrome/browser/notifications/notification.h" |
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
209 RendererPreferences BalloonHost::GetRendererPrefs(Profile* profile) const { | 209 RendererPreferences BalloonHost::GetRendererPrefs(Profile* profile) const { |
210 RendererPreferences preferences; | 210 RendererPreferences preferences; |
211 renderer_preferences_util::UpdateFromSystemSettings(&preferences, profile); | 211 renderer_preferences_util::UpdateFromSystemSettings(&preferences, profile); |
212 return preferences; | 212 return preferences; |
213 } | 213 } |
214 | 214 |
215 void BalloonHost::Init() { | 215 void BalloonHost::Init() { |
216 DCHECK(!render_view_host_) << "BalloonViewHost already initialized."; | 216 DCHECK(!render_view_host_) << "BalloonViewHost already initialized."; |
217 RenderViewHost* rvh = new RenderViewHost( | 217 RenderViewHost* rvh = new RenderViewHost( |
218 site_instance_.get(), this, MSG_ROUTING_NONE, NULL); | 218 site_instance_.get(), this, MSG_ROUTING_NONE, NULL); |
219 if (GetProfile()->GetExtensionsService()) { | 219 if (GetProfile()->GetExtensionService()) { |
220 extension_function_dispatcher_.reset( | 220 extension_function_dispatcher_.reset( |
221 ExtensionFunctionDispatcher::Create( | 221 ExtensionFunctionDispatcher::Create( |
222 rvh, this, balloon_->notification().content_url())); | 222 rvh, this, balloon_->notification().content_url())); |
223 } | 223 } |
224 if (extension_function_dispatcher_.get()) { | 224 if (extension_function_dispatcher_.get()) { |
225 rvh->AllowBindings(BindingsPolicy::EXTENSION); | 225 rvh->AllowBindings(BindingsPolicy::EXTENSION); |
226 rvh->set_is_extension_process(true); | 226 rvh->set_is_extension_process(true); |
227 } else if (enable_dom_ui_) { | 227 } else if (enable_dom_ui_) { |
228 rvh->AllowBindings(BindingsPolicy::DOM_UI); | 228 rvh->AllowBindings(BindingsPolicy::DOM_UI); |
229 } | 229 } |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
271 | 271 |
272 void BalloonHost::NotifyDisconnect() { | 272 void BalloonHost::NotifyDisconnect() { |
273 if (!should_notify_on_disconnect_) | 273 if (!should_notify_on_disconnect_) |
274 return; | 274 return; |
275 | 275 |
276 should_notify_on_disconnect_ = false; | 276 should_notify_on_disconnect_ = false; |
277 NotificationService::current()->Notify( | 277 NotificationService::current()->Notify( |
278 NotificationType::NOTIFY_BALLOON_DISCONNECTED, | 278 NotificationType::NOTIFY_BALLOON_DISCONNECTED, |
279 Source<BalloonHost>(this), NotificationService::NoDetails()); | 279 Source<BalloonHost>(this), NotificationService::NoDetails()); |
280 } | 280 } |
OLD | NEW |