| 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/ui/gtk/notifications/balloon_view_gtk.h" | 5 #include "chrome/browser/ui/gtk/notifications/balloon_view_gtk.h" |
| 6 | 6 |
| 7 #include <gtk/gtk.h> | 7 #include <gtk/gtk.h> |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 341 notification_registrar_.Add(this, | 341 notification_registrar_.Add(this, |
| 342 chrome::NOTIFICATION_NOTIFY_BALLOON_DISCONNECTED, | 342 chrome::NOTIFICATION_NOTIFY_BALLOON_DISCONNECTED, |
| 343 content::Source<Balloon>(balloon)); | 343 content::Source<Balloon>(balloon)); |
| 344 } | 344 } |
| 345 | 345 |
| 346 void BalloonViewImpl::Update() { | 346 void BalloonViewImpl::Update() { |
| 347 DCHECK(html_contents_.get()) << "BalloonView::Update called before Show"; | 347 DCHECK(html_contents_.get()) << "BalloonView::Update called before Show"; |
| 348 if (!html_contents_->tab_contents()) | 348 if (!html_contents_->tab_contents()) |
| 349 return; | 349 return; |
| 350 html_contents_->tab_contents()->controller().LoadURL( | 350 html_contents_->tab_contents()->controller().LoadURL( |
| 351 balloon_->notification().content_url(), GURL(), | 351 balloon_->notification().content_url(), content::Referrer(), |
| 352 content::PAGE_TRANSITION_LINK, std::string()); | 352 content::PAGE_TRANSITION_LINK, std::string()); |
| 353 } | 353 } |
| 354 | 354 |
| 355 gfx::Point BalloonViewImpl::GetContentsOffset() const { | 355 gfx::Point BalloonViewImpl::GetContentsOffset() const { |
| 356 return gfx::Point(kLeftShadowWidth + kLeftMargin, | 356 return gfx::Point(kLeftShadowWidth + kLeftMargin, |
| 357 GetShelfHeight() + kTopShadowWidth + kTopMargin); | 357 GetShelfHeight() + kTopShadowWidth + kTopMargin); |
| 358 } | 358 } |
| 359 | 359 |
| 360 int BalloonViewImpl::GetShelfHeight() const { | 360 int BalloonViewImpl::GetShelfHeight() const { |
| 361 // TODO(johnnyg): add scaling here. | 361 // TODO(johnnyg): add scaling here. |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 477 weak_factory_.GetWeakPtr(), | 477 weak_factory_.GetWeakPtr(), |
| 478 false)); | 478 false)); |
| 479 } | 479 } |
| 480 } | 480 } |
| 481 | 481 |
| 482 gboolean BalloonViewImpl::OnDestroy(GtkWidget* widget) { | 482 gboolean BalloonViewImpl::OnDestroy(GtkWidget* widget) { |
| 483 frame_container_ = NULL; | 483 frame_container_ = NULL; |
| 484 Close(false); | 484 Close(false); |
| 485 return FALSE; // Propagate. | 485 return FALSE; // Propagate. |
| 486 } | 486 } |
| OLD | NEW |