| 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/chromeos/notifications/balloon_view.h" | 5 #include "chrome/browser/chromeos/notifications/balloon_view.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
| 10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
| (...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 206 } | 206 } |
| 207 } | 207 } |
| 208 | 208 |
| 209 //////////////////////////////////////////////////////////////////////////////// | 209 //////////////////////////////////////////////////////////////////////////////// |
| 210 // BallonViewImpl, BalloonView implementation. | 210 // BallonViewImpl, BalloonView implementation. |
| 211 | 211 |
| 212 void BalloonViewImpl::Show(Balloon* balloon) { | 212 void BalloonViewImpl::Show(Balloon* balloon) { |
| 213 balloon_ = balloon; | 213 balloon_ = balloon; |
| 214 html_contents_ = new BalloonViewHost(balloon); | 214 html_contents_ = new BalloonViewHost(balloon); |
| 215 if (dom_ui_) | 215 if (dom_ui_) |
| 216 html_contents_->EnableDOMUI(); | 216 html_contents_->EnableWebUI(); |
| 217 AddChildView(html_contents_->view()); | 217 AddChildView(html_contents_->view()); |
| 218 notification_registrar_.Add(this, | 218 notification_registrar_.Add(this, |
| 219 NotificationType::NOTIFY_BALLOON_DISCONNECTED, Source<Balloon>(balloon)); | 219 NotificationType::NOTIFY_BALLOON_DISCONNECTED, Source<Balloon>(balloon)); |
| 220 } | 220 } |
| 221 | 221 |
| 222 void BalloonViewImpl::Update() { | 222 void BalloonViewImpl::Update() { |
| 223 stale_ = false; | 223 stale_ = false; |
| 224 if (html_contents_->render_view_host()) | 224 if (html_contents_->render_view_host()) |
| 225 html_contents_->render_view_host()->NavigateToURL( | 225 html_contents_->render_view_host()->NavigateToURL( |
| 226 balloon_->notification().content_url()); | 226 balloon_->notification().content_url()); |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 340 service->DenyPermission(balloon_->notification().origin_url()); | 340 service->DenyPermission(balloon_->notification().origin_url()); |
| 341 } | 341 } |
| 342 | 342 |
| 343 gfx::NativeView BalloonViewImpl::GetParentNativeView() { | 343 gfx::NativeView BalloonViewImpl::GetParentNativeView() { |
| 344 RenderWidgetHostView* view = html_contents_->render_view_host()->view(); | 344 RenderWidgetHostView* view = html_contents_->render_view_host()->view(); |
| 345 DCHECK(view); | 345 DCHECK(view); |
| 346 return view->GetNativeView(); | 346 return view->GetNativeView(); |
| 347 } | 347 } |
| 348 | 348 |
| 349 } // namespace chromeos | 349 } // namespace chromeos |
| OLD | NEW |