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 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 extension_function_dispatcher_.Dispatch(params, | 126 extension_function_dispatcher_.Dispatch(params, |
127 web_contents_->GetRenderViewHost()); | 127 web_contents_->GetRenderViewHost()); |
128 } | 128 } |
129 | 129 |
130 void BalloonHost::Init() { | 130 void BalloonHost::Init() { |
131 DCHECK(!web_contents_.get()) << "BalloonViewHost already initialized."; | 131 DCHECK(!web_contents_.get()) << "BalloonViewHost already initialized."; |
132 web_contents_.reset(WebContents::Create( | 132 web_contents_.reset(WebContents::Create( |
133 balloon_->profile(), | 133 balloon_->profile(), |
134 site_instance_.get(), | 134 site_instance_.get(), |
135 MSG_ROUTING_NONE, | 135 MSG_ROUTING_NONE, |
136 NULL, | |
137 NULL)); | 136 NULL)); |
138 chrome::SetViewType(web_contents_.get(), chrome::VIEW_TYPE_NOTIFICATION); | 137 chrome::SetViewType(web_contents_.get(), chrome::VIEW_TYPE_NOTIFICATION); |
139 web_contents_->SetDelegate(this); | 138 web_contents_->SetDelegate(this); |
140 Observe(web_contents_.get()); | 139 Observe(web_contents_.get()); |
141 | 140 |
142 web_contents_->GetController().LoadURL( | 141 web_contents_->GetController().LoadURL( |
143 balloon_->notification().content_url(), content::Referrer(), | 142 balloon_->notification().content_url(), content::Referrer(), |
144 content::PAGE_TRANSITION_LINK, std::string()); | 143 content::PAGE_TRANSITION_LINK, std::string()); |
145 | 144 |
146 initialized_ = true; | 145 initialized_ = true; |
(...skipping 26 matching lines...) Expand all Loading... |
173 bool BalloonHost::CanLoadDataURLsInWebUI() const { | 172 bool BalloonHost::CanLoadDataURLsInWebUI() const { |
174 #if defined(OS_CHROMEOS) | 173 #if defined(OS_CHROMEOS) |
175 // Chrome OS uses data URLs in WebUI BalloonHosts. We normally do not allow | 174 // Chrome OS uses data URLs in WebUI BalloonHosts. We normally do not allow |
176 // data URLs in WebUI renderers, but normal pages cannot target BalloonHosts, | 175 // data URLs in WebUI renderers, but normal pages cannot target BalloonHosts, |
177 // so this should be safe. | 176 // so this should be safe. |
178 return true; | 177 return true; |
179 #else | 178 #else |
180 return false; | 179 return false; |
181 #endif | 180 #endif |
182 } | 181 } |
OLD | NEW |