Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(101)

Side by Side Diff: chrome/browser/chromeos/setting_level_bubble.cc

Issue 8395042: [cros,de-hack] Get rid of singleton for the WebUILoginScreen. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: clang fix Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/login_utils.h" 11 #include "chrome/browser/chromeos/login/login_utils.h"
12 #include "chrome/browser/chromeos/login/login_display_host.h"
11 #include "chrome/browser/chromeos/login/webui_login_display.h" 13 #include "chrome/browser/chromeos/login/webui_login_display.h"
12 #include "chrome/browser/chromeos/setting_level_bubble_view.h" 14 #include "chrome/browser/chromeos/setting_level_bubble_view.h"
13 #include "chrome/browser/profiles/profile_manager.h" 15 #include "chrome/browser/profiles/profile_manager.h"
14 #include "chrome/browser/ui/browser.h" 16 #include "chrome/browser/ui/browser.h"
15 #include "chrome/browser/ui/browser_list.h" 17 #include "chrome/browser/ui/browser_list.h"
16 #include "chrome/browser/ui/browser_window.h" 18 #include "chrome/browser/ui/browser_window.h"
17 #include "chrome/browser/ui/views/bubble/bubble.h" 19 #include "chrome/browser/ui/views/bubble/bubble.h"
18 #include "ui/gfx/screen.h" 20 #include "ui/gfx/screen.h"
19 #include "views/widget/root_view.h" 21 #include "views/widget/root_view.h"
20 22
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 ProfileManager::GetDefaultProfile(), 68 ProfileManager::GetDefaultProfile(),
67 true); // match_incognito 69 true); // match_incognito
68 if (browser) { 70 if (browser) {
69 window = browser->window()->GetNativeHandle(); 71 window = browser->window()->GetNativeHandle();
70 } else { 72 } else {
71 #if defined(USE_AURA) 73 #if defined(USE_AURA)
72 // TODO(saintlou): Unsure what to do for the Aura background. 74 // TODO(saintlou): Unsure what to do for the Aura background.
73 #else 75 #else
74 // Otherwise, see if there's a background window that we can use. 76 // Otherwise, see if there's a background window that we can use.
75 BackgroundView* background = LoginUtils::Get()->GetBackgroundView(); 77 BackgroundView* background = LoginUtils::Get()->GetBackgroundView();
76 if (background) 78 if (background) {
77 window = GTK_WINDOW(background->GetNativeWindow()); 79 window = GTK_WINDOW(background->GetNativeWindow());
80 } else {
81 ExistingUserController* controller =
82 ExistingUserController::current_controller();
83 if (controller) {
84 window =
85 GTK_WINDOW(controller->login_display_host()->GetNativeWindow());
86 }
87 }
78 #endif 88 #endif
79 } 89 }
80 90
81 if (window) 91 if (window)
82 return views::Widget::GetWidgetForNativeWindow(window); 92 return views::Widget::GetWidgetForNativeWindow(window);
83 else 93 else
84 return WebUILoginDisplay::GetLoginWindow(); 94 return NULL;
Nikita (slow) 2011/10/31 11:14:18 NOTREACHED() ?
altimofeev 2011/10/31 16:55:52 Done.
85 } 95 }
86 96
87 SettingLevelBubble::SettingLevelBubble(SkBitmap* increase_icon, 97 SettingLevelBubble::SettingLevelBubble(SkBitmap* increase_icon,
88 SkBitmap* decrease_icon, 98 SkBitmap* decrease_icon,
89 SkBitmap* disabled_icon) 99 SkBitmap* disabled_icon)
90 : current_percent_(-1.0), 100 : current_percent_(-1.0),
91 target_percent_(-1.0), 101 target_percent_(-1.0),
92 increase_icon_(increase_icon), 102 increase_icon_(increase_icon),
93 decrease_icon_(decrease_icon), 103 decrease_icon_(decrease_icon),
94 disabled_icon_(disabled_icon), 104 disabled_icon_(disabled_icon),
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
246 256
247 last_target_update_time_ = now; 257 last_target_update_time_ = now;
248 } 258 }
249 259
250 void SettingLevelBubble::StopAnimation() { 260 void SettingLevelBubble::StopAnimation() {
251 animation_timer_.Stop(); 261 animation_timer_.Stop();
252 is_animating_ = false; 262 is_animating_ = false;
253 } 263 }
254 264
255 } // namespace chromeos 265 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698