OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/profiles/user_manager_view.h" | 5 #include "chrome/browser/ui/views/profiles/user_manager_view.h" |
6 | 6 |
7 #include "base/macros.h" | 7 #include "base/macros.h" |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "base/time/time.h" | 9 #include "base/time/time.h" |
10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
(...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
278 // Note the profile is accessed via GetProfileByPath(GetLastUsedProfileDir()) | 278 // Note the profile is accessed via GetProfileByPath(GetLastUsedProfileDir()) |
279 // instead of GetLastUsedProfile(). If the last active profile isn't loaded, | 279 // instead of GetLastUsedProfile(). If the last active profile isn't loaded, |
280 // the latter may try to synchronously load it, which can only be done on a | 280 // the latter may try to synchronously load it, which can only be done on a |
281 // thread where disk IO is allowed. | 281 // thread where disk IO is allowed. |
282 gfx::Rect bounds; | 282 gfx::Rect bounds; |
283 ProfileManager* profile_manager = g_browser_process->profile_manager(); | 283 ProfileManager* profile_manager = g_browser_process->profile_manager(); |
284 const base::FilePath& last_used_profile_path = | 284 const base::FilePath& last_used_profile_path = |
285 profile_manager->GetLastUsedProfileDir(profile_manager->user_data_dir()); | 285 profile_manager->GetLastUsedProfileDir(profile_manager->user_data_dir()); |
286 Profile* profile = profile_manager->GetProfileByPath(last_used_profile_path); | 286 Profile* profile = profile_manager->GetProfileByPath(last_used_profile_path); |
287 if (profile) { | 287 if (profile) { |
288 Browser* browser = chrome::FindLastActiveWithProfile(profile, | 288 Browser* browser = chrome::FindLastActiveWithProfile(profile); |
289 chrome::GetActiveDesktop()); | |
290 if (browser) { | 289 if (browser) { |
291 gfx::NativeView native_view = | 290 gfx::NativeView native_view = |
292 views::Widget::GetWidgetForNativeWindow( | 291 views::Widget::GetWidgetForNativeWindow( |
293 browser->window()->GetNativeWindow())->GetNativeView(); | 292 browser->window()->GetNativeWindow())->GetNativeView(); |
294 bounds = gfx::Screen::GetScreen() | 293 bounds = gfx::Screen::GetScreen() |
295 ->GetDisplayNearestWindow(native_view) | 294 ->GetDisplayNearestWindow(native_view) |
296 .work_area(); | 295 .work_area(); |
297 bounds.ClampToCenteredSize(gfx::Size(UserManager::kWindowWidth, | 296 bounds.ClampToCenteredSize(gfx::Size(UserManager::kWindowWidth, |
298 UserManager::kWindowHeight)); | 297 UserManager::kWindowHeight)); |
299 } | 298 } |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
377 // Now that the window is closed, we can allow a new one to be opened. | 376 // Now that the window is closed, we can allow a new one to be opened. |
378 // (WindowClosing comes in asynchronously from the call to Close() and we | 377 // (WindowClosing comes in asynchronously from the call to Close() and we |
379 // may have already opened a new instance). | 378 // may have already opened a new instance). |
380 if (instance_ == this) | 379 if (instance_ == this) |
381 instance_ = NULL; | 380 instance_ = NULL; |
382 } | 381 } |
383 | 382 |
384 bool UserManagerView::UseNewStyleForThisDialog() const { | 383 bool UserManagerView::UseNewStyleForThisDialog() const { |
385 return false; | 384 return false; |
386 } | 385 } |
OLD | NEW |