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/setting_level_bubble.h" | 5 #include "chrome/browser/chromeos/setting_level_bubble.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "chrome/browser/chromeos/login/background_view.h" | 9 #include "chrome/browser/chromeos/login/background_view.h" |
10 #include "chrome/browser/chromeos/login/login_utils.h" | 10 #include "chrome/browser/chromeos/login/login_utils.h" |
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
216 last_animation_update_time_ = TimeTicks(); | 216 last_animation_update_time_ = TimeTicks(); |
217 last_target_update_time_ = TimeTicks(); | 217 last_target_update_time_ = TimeTicks(); |
218 hide_timer_.Stop(); | 218 hide_timer_.Stop(); |
219 StopAnimation(); | 219 StopAnimation(); |
220 } | 220 } |
221 | 221 |
222 SettingLevelBubbleView* SettingLevelBubble::CreateView() { | 222 SettingLevelBubbleView* SettingLevelBubble::CreateView() { |
223 views::Widget* parent = GetToplevelWidget(); | 223 views::Widget* parent = GetToplevelWidget(); |
224 SettingLevelBubbleDelegateView* delegate = | 224 SettingLevelBubbleDelegateView* delegate = |
225 new SettingLevelBubbleDelegateView(parent); | 225 new SettingLevelBubbleDelegateView(parent); |
226 views::Widget* widget = | 226 views::BubbleDelegateView::CreateBubble(delegate, parent); |
227 views::BubbleDelegateView::CreateBubble(delegate, parent); | 227 delegate->GetWidget()->AddObserver(this); |
228 widget->AddObserver(this); | |
229 // Hold on to the content view. | 228 // Hold on to the content view. |
230 return delegate->view(); | 229 return delegate->view(); |
231 } | 230 } |
232 | 231 |
233 void SettingLevelBubble::OnHideTimeout() { | 232 void SettingLevelBubble::OnHideTimeout() { |
234 // Start fading away. | 233 // Start fading away. |
235 if (view_) { | 234 if (view_) { |
236 SettingLevelBubbleDelegateView* delegate = | 235 SettingLevelBubbleDelegateView* delegate = |
237 static_cast<SettingLevelBubbleDelegateView*> | 236 static_cast<SettingLevelBubbleDelegateView*> |
238 (view_->GetWidget()->widget_delegate()); | 237 (view_->GetWidget()->widget_delegate()); |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
295 | 294 |
296 last_target_update_time_ = now; | 295 last_target_update_time_ = now; |
297 } | 296 } |
298 | 297 |
299 void SettingLevelBubble::StopAnimation() { | 298 void SettingLevelBubble::StopAnimation() { |
300 animation_timer_.Stop(); | 299 animation_timer_.Stop(); |
301 is_animating_ = false; | 300 is_animating_ = false; |
302 } | 301 } |
303 | 302 |
304 } // namespace chromeos | 303 } // namespace chromeos |
OLD | NEW |