Chromium Code Reviews| 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 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 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, | 136 NULL, |
| 137 NULL)); | 137 NULL)); |
| 138 chrome::SetViewType(web_contents_.get(), chrome::VIEW_TYPE_NOTIFICATION); | 138 chrome::SetViewType(web_contents_.get(), chrome::VIEW_TYPE_NOTIFICATION); |
| 139 web_contents_->SetDelegate(this); | 139 web_contents_->SetDelegate(this); |
| 140 Observe(web_contents_.get()); | 140 Observe(web_contents_.get()); |
| 141 renderer_preferences_util::UpdateFromSystemSettings( | |
| 142 web_contents_->GetMutableRendererPrefs(), balloon_->profile()); | |
|
stevenjb
2012/08/02 17:17:34
Is this modifying web_contents_->GetMutableRendere
kinaba
2012/08/03 01:39:23
Yes, this is how the function is defined in 2 or 3
| |
| 143 web_contents_->GetRenderViewHost()->SyncRendererPrefs(); | |
| 141 | 144 |
| 142 web_contents_->GetController().LoadURL( | 145 web_contents_->GetController().LoadURL( |
| 143 balloon_->notification().content_url(), content::Referrer(), | 146 balloon_->notification().content_url(), content::Referrer(), |
| 144 content::PAGE_TRANSITION_LINK, std::string()); | 147 content::PAGE_TRANSITION_LINK, std::string()); |
| 145 | 148 |
| 146 initialized_ = true; | 149 initialized_ = true; |
| 147 } | 150 } |
| 148 | 151 |
| 149 void BalloonHost::EnableWebUI() { | 152 void BalloonHost::EnableWebUI() { |
| 150 DCHECK(!web_contents_.get()) << | 153 DCHECK(!web_contents_.get()) << |
| (...skipping 22 matching lines...) Expand all Loading... | |
| 173 bool BalloonHost::CanLoadDataURLsInWebUI() const { | 176 bool BalloonHost::CanLoadDataURLsInWebUI() const { |
| 174 #if defined(OS_CHROMEOS) | 177 #if defined(OS_CHROMEOS) |
| 175 // Chrome OS uses data URLs in WebUI BalloonHosts. We normally do not allow | 178 // 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, | 179 // data URLs in WebUI renderers, but normal pages cannot target BalloonHosts, |
| 177 // so this should be safe. | 180 // so this should be safe. |
| 178 return true; | 181 return true; |
| 179 #else | 182 #else |
| 180 return false; | 183 return false; |
| 181 #endif | 184 #endif |
| 182 } | 185 } |
| OLD | NEW |