| 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 <algorithm> | 7 #include <algorithm> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 231 notification_registrar_.Add(this, | 231 notification_registrar_.Add(this, |
| 232 chrome::NOTIFICATION_NOTIFY_BALLOON_DISCONNECTED, | 232 chrome::NOTIFICATION_NOTIFY_BALLOON_DISCONNECTED, |
| 233 content::Source<Balloon>(balloon)); | 233 content::Source<Balloon>(balloon)); |
| 234 } | 234 } |
| 235 | 235 |
| 236 void BalloonViewImpl::Update() { | 236 void BalloonViewImpl::Update() { |
| 237 stale_ = false; | 237 stale_ = false; |
| 238 if (!html_contents_->tab_contents()) | 238 if (!html_contents_->tab_contents()) |
| 239 return; | 239 return; |
| 240 html_contents_->tab_contents()->controller().LoadURL( | 240 html_contents_->tab_contents()->controller().LoadURL( |
| 241 balloon_->notification().content_url(), GURL(), | 241 balloon_->notification().content_url(), content::Referrer(), |
| 242 content::PAGE_TRANSITION_LINK, std::string()); | 242 content::PAGE_TRANSITION_LINK, std::string()); |
| 243 } | 243 } |
| 244 | 244 |
| 245 void BalloonViewImpl::Close(bool by_user) { | 245 void BalloonViewImpl::Close(bool by_user) { |
| 246 closed_ = true; | 246 closed_ = true; |
| 247 MessageLoop::current()->PostTask( | 247 MessageLoop::current()->PostTask( |
| 248 FROM_HERE, | 248 FROM_HERE, |
| 249 base::Bind(&BalloonViewImpl::DelayedClose, AsWeakPtr(), by_user)); | 249 base::Bind(&BalloonViewImpl::DelayedClose, AsWeakPtr(), by_user)); |
| 250 } | 250 } |
| 251 | 251 |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 363 } | 363 } |
| 364 | 364 |
| 365 gfx::NativeView BalloonViewImpl::GetParentNativeView() { | 365 gfx::NativeView BalloonViewImpl::GetParentNativeView() { |
| 366 RenderWidgetHostView* view = | 366 RenderWidgetHostView* view = |
| 367 html_contents_->tab_contents()->render_view_host()->view(); | 367 html_contents_->tab_contents()->render_view_host()->view(); |
| 368 DCHECK(view); | 368 DCHECK(view); |
| 369 return view->GetNativeView(); | 369 return view->GetNativeView(); |
| 370 } | 370 } |
| 371 | 371 |
| 372 } // namespace chromeos | 372 } // namespace chromeos |
| OLD | NEW |