| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/notifications/balloon.h" | 7 #include "chrome/browser/notifications/balloon.h" |
| 8 #include "chrome/browser/notifications/balloon_collection_impl.h" | 8 #include "chrome/browser/notifications/balloon_collection_impl.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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 extension_function_dispatcher_(balloon_->profile(), this)) { | 42 extension_function_dispatcher_(balloon_->profile(), this)) { |
| 43 site_instance_ = SiteInstance::CreateForURL( | 43 site_instance_ = SiteInstance::CreateForURL( |
| 44 balloon_->profile(), balloon_->notification().content_url()); | 44 balloon_->profile(), balloon_->notification().content_url()); |
| 45 } | 45 } |
| 46 | 46 |
| 47 void BalloonHost::Shutdown() { | 47 void BalloonHost::Shutdown() { |
| 48 NotifyDisconnect(); | 48 NotifyDisconnect(); |
| 49 web_contents_.reset(); | 49 web_contents_.reset(); |
| 50 } | 50 } |
| 51 | 51 |
| 52 ExtensionWindowController* BalloonHost::GetExtensionWindowController() const { | 52 extensions::WindowController* |
| 53 BalloonHost::GetExtensionWindowController() const { |
| 53 // Notifications don't have a window controller. | 54 // Notifications don't have a window controller. |
| 54 return NULL; | 55 return NULL; |
| 55 } | 56 } |
| 56 | 57 |
| 57 content::WebContents* BalloonHost::GetAssociatedWebContents() const { | 58 content::WebContents* BalloonHost::GetAssociatedWebContents() const { |
| 58 return NULL; | 59 return NULL; |
| 59 } | 60 } |
| 60 | 61 |
| 61 const string16& BalloonHost::GetSource() const { | 62 const string16& BalloonHost::GetSource() const { |
| 62 return balloon_->notification().display_source(); | 63 return balloon_->notification().display_source(); |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 172 bool BalloonHost::CanLoadDataURLsInWebUI() const { | 173 bool BalloonHost::CanLoadDataURLsInWebUI() const { |
| 173 #if defined(OS_CHROMEOS) | 174 #if defined(OS_CHROMEOS) |
| 174 // Chrome OS uses data URLs in WebUI BalloonHosts. We normally do not allow | 175 // Chrome OS uses data URLs in WebUI BalloonHosts. We normally do not allow |
| 175 // data URLs in WebUI renderers, but normal pages cannot target BalloonHosts, | 176 // data URLs in WebUI renderers, but normal pages cannot target BalloonHosts, |
| 176 // so this should be safe. | 177 // so this should be safe. |
| 177 return true; | 178 return true; |
| 178 #else | 179 #else |
| 179 return false; | 180 return false; |
| 180 #endif | 181 #endif |
| 181 } | 182 } |
| OLD | NEW |