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/existing_user_controller.h" | 10 #include "chrome/browser/chromeos/login/base_login_display_host.h" |
11 #include "chrome/browser/chromeos/login/login_utils.h" | 11 #include "chrome/browser/chromeos/login/login_utils.h" |
12 #include "chrome/browser/chromeos/login/login_display_host.h" | 12 #include "chrome/browser/chromeos/login/login_display_host.h" |
13 #include "chrome/browser/chromeos/login/webui_login_display.h" | 13 #include "chrome/browser/chromeos/login/webui_login_display.h" |
14 #include "chrome/browser/chromeos/setting_level_bubble_view.h" | 14 #include "chrome/browser/chromeos/setting_level_bubble_view.h" |
15 #include "chrome/browser/profiles/profile_manager.h" | 15 #include "chrome/browser/profiles/profile_manager.h" |
16 #include "chrome/browser/ui/browser.h" | 16 #include "chrome/browser/ui/browser.h" |
17 #include "chrome/browser/ui/browser_list.h" | 17 #include "chrome/browser/ui/browser_list.h" |
18 #include "chrome/browser/ui/browser_window.h" | 18 #include "chrome/browser/ui/browser_window.h" |
19 #include "ui/gfx/screen.h" | 19 #include "ui/gfx/screen.h" |
20 #include "views/bubble/bubble_delegate.h" | 20 #include "views/bubble/bubble_delegate.h" |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 window = browser->window()->GetNativeHandle(); | 72 window = browser->window()->GetNativeHandle(); |
73 } else { | 73 } else { |
74 #if defined(USE_AURA) | 74 #if defined(USE_AURA) |
75 // TODO(saintlou): Unsure what to do for the Aura background. | 75 // TODO(saintlou): Unsure what to do for the Aura background. |
76 #else | 76 #else |
77 // Otherwise, see if there's a background window that we can use. | 77 // Otherwise, see if there's a background window that we can use. |
78 BackgroundView* background = LoginUtils::Get()->GetBackgroundView(); | 78 BackgroundView* background = LoginUtils::Get()->GetBackgroundView(); |
79 if (background) { | 79 if (background) { |
80 window = GTK_WINDOW(background->GetNativeWindow()); | 80 window = GTK_WINDOW(background->GetNativeWindow()); |
81 } else { | 81 } else { |
82 ExistingUserController* controller = | 82 LoginDisplayHost* host = BaseLoginDisplayHost::default_host(); |
83 ExistingUserController::current_controller(); | 83 if (host) |
84 if (controller) { | 84 window = host->GetNativeWindow(); |
85 window = | |
86 GTK_WINDOW(controller->login_display_host()->GetNativeWindow()); | |
87 } | |
88 } | 85 } |
89 #endif | 86 #endif |
90 } | 87 } |
91 | 88 |
92 if (window) { | 89 if (window) { |
93 return views::Widget::GetWidgetForNativeWindow(window); | 90 return views::Widget::GetWidgetForNativeWindow(window); |
94 } else { | 91 } else { |
95 NOTREACHED(); | 92 NOTREACHED(); |
96 return NULL; | 93 return NULL; |
97 } | 94 } |
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
307 | 304 |
308 last_target_update_time_ = now; | 305 last_target_update_time_ = now; |
309 } | 306 } |
310 | 307 |
311 void SettingLevelBubble::StopAnimation() { | 308 void SettingLevelBubble::StopAnimation() { |
312 animation_timer_.Stop(); | 309 animation_timer_.Stop(); |
313 is_animating_ = false; | 310 is_animating_ = false; |
314 } | 311 } |
315 | 312 |
316 } // namespace chromeos | 313 } // namespace chromeos |
OLD | NEW |