| 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 #include "chrome/browser/notifications/balloon.h" | 6 #include "chrome/browser/notifications/balloon.h" |
| 7 #include "chrome/browser/notifications/notification.h" | 7 #include "chrome/browser/notifications/notification.h" |
| 8 #include "chrome/browser/profiles/profile.h" | 8 #include "chrome/browser/profiles/profile.h" |
| 9 #include "chrome/browser/renderer_preferences_util.h" | 9 #include "chrome/browser/renderer_preferences_util.h" |
| 10 #include "chrome/browser/ui/browser_list.h" | 10 #include "chrome/browser/ui/browser_list.h" |
| (...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 189 RenderViewHost* rvh = new RenderViewHost( | 189 RenderViewHost* rvh = new RenderViewHost( |
| 190 site_instance_.get(), this, MSG_ROUTING_NONE, NULL); | 190 site_instance_.get(), this, MSG_ROUTING_NONE, NULL); |
| 191 if (enable_web_ui_) | 191 if (enable_web_ui_) |
| 192 rvh->AllowBindings(BindingsPolicy::WEB_UI); | 192 rvh->AllowBindings(BindingsPolicy::WEB_UI); |
| 193 | 193 |
| 194 // Do platform-specific initialization. | 194 // Do platform-specific initialization. |
| 195 render_view_host_ = rvh; | 195 render_view_host_ = rvh; |
| 196 InitRenderWidgetHostView(); | 196 InitRenderWidgetHostView(); |
| 197 DCHECK(render_widget_host_view()); | 197 DCHECK(render_widget_host_view()); |
| 198 | 198 |
| 199 rvh->set_view(render_widget_host_view()); | 199 rvh->SetView(render_widget_host_view()); |
| 200 rvh->CreateRenderView(string16()); | 200 rvh->CreateRenderView(string16()); |
| 201 rvh->NavigateToURL(balloon_->notification().content_url()); | 201 rvh->NavigateToURL(balloon_->notification().content_url()); |
| 202 | 202 |
| 203 initialized_ = true; | 203 initialized_ = true; |
| 204 } | 204 } |
| 205 | 205 |
| 206 void BalloonHost::EnableWebUI() { | 206 void BalloonHost::EnableWebUI() { |
| 207 DCHECK(render_view_host_ == NULL) << | 207 DCHECK(render_view_host_ == NULL) << |
| 208 "EnableWebUI has to be called before a renderer is created."; | 208 "EnableWebUI has to be called before a renderer is created."; |
| 209 enable_web_ui_ = true; | 209 enable_web_ui_ = true; |
| (...skipping 19 matching lines...) Expand all Loading... |
| 229 | 229 |
| 230 should_notify_on_disconnect_ = false; | 230 should_notify_on_disconnect_ = false; |
| 231 NotificationService::current()->Notify( | 231 NotificationService::current()->Notify( |
| 232 NotificationType::NOTIFY_BALLOON_DISCONNECTED, | 232 NotificationType::NOTIFY_BALLOON_DISCONNECTED, |
| 233 Source<BalloonHost>(this), NotificationService::NoDetails()); | 233 Source<BalloonHost>(this), NotificationService::NoDetails()); |
| 234 } | 234 } |
| 235 | 235 |
| 236 bool BalloonHost::IsRenderViewReady() const { | 236 bool BalloonHost::IsRenderViewReady() const { |
| 237 return should_notify_on_disconnect_; | 237 return should_notify_on_disconnect_; |
| 238 } | 238 } |
| OLD | NEW |