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/views/notifications/balloon_view.h" | 5 #include "chrome/browser/ui/views/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 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
226 anim_frame_start_ = frame_container_->GetClientAreaScreenBounds(); | 226 anim_frame_start_ = frame_container_->GetClientAreaScreenBounds(); |
227 animation_.reset(new ui::SlideAnimation(this)); | 227 animation_.reset(new ui::SlideAnimation(this)); |
228 animation_->Show(); | 228 animation_->Show(); |
229 } | 229 } |
230 | 230 |
231 void BalloonViewImpl::Update() { | 231 void BalloonViewImpl::Update() { |
232 DCHECK(html_contents_.get()) << "BalloonView::Update called before Show"; | 232 DCHECK(html_contents_.get()) << "BalloonView::Update called before Show"; |
233 if (!html_contents_->tab_contents()) | 233 if (!html_contents_->tab_contents()) |
234 return; | 234 return; |
235 html_contents_->tab_contents()->controller().LoadURL( | 235 html_contents_->tab_contents()->controller().LoadURL( |
236 balloon_->notification().content_url(), GURL(), | 236 balloon_->notification().content_url(), content::Referrer(), |
237 content::PAGE_TRANSITION_LINK, std::string()); | 237 content::PAGE_TRANSITION_LINK, std::string()); |
238 } | 238 } |
239 | 239 |
240 void BalloonViewImpl::AnimationProgressed(const ui::Animation* animation) { | 240 void BalloonViewImpl::AnimationProgressed(const ui::Animation* animation) { |
241 DCHECK(animation == animation_.get()); | 241 DCHECK(animation == animation_.get()); |
242 | 242 |
243 // Linear interpolation from start to end position. | 243 // Linear interpolation from start to end position. |
244 double e = animation->GetCurrentValue(); | 244 double e = animation->GetCurrentValue(); |
245 double s = (1.0 - e); | 245 double s = (1.0 - e); |
246 | 246 |
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
516 return; | 516 return; |
517 } | 517 } |
518 | 518 |
519 // If the renderer process attached to this balloon is disconnected | 519 // If the renderer process attached to this balloon is disconnected |
520 // (e.g., because of a crash), we want to close the balloon. | 520 // (e.g., because of a crash), we want to close the balloon. |
521 notification_registrar_.Remove( | 521 notification_registrar_.Remove( |
522 this, chrome::NOTIFICATION_NOTIFY_BALLOON_DISCONNECTED, | 522 this, chrome::NOTIFICATION_NOTIFY_BALLOON_DISCONNECTED, |
523 content::Source<Balloon>(balloon_)); | 523 content::Source<Balloon>(balloon_)); |
524 Close(false); | 524 Close(false); |
525 } | 525 } |
OLD | NEW |