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 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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()); | 289 chrome::GetActiveDesktop()); |
290 if (browser) { | 290 if (browser) { |
291 gfx::NativeView native_view = | 291 gfx::NativeView native_view = |
292 views::Widget::GetWidgetForNativeWindow( | 292 views::Widget::GetWidgetForNativeWindow( |
293 browser->window()->GetNativeWindow())->GetNativeView(); | 293 browser->window()->GetNativeWindow())->GetNativeView(); |
294 bounds = gfx::Screen::GetScreenFor(native_view)-> | 294 bounds = gfx::Screen::GetScreen() |
295 GetDisplayNearestWindow(native_view).work_area(); | 295 ->GetDisplayNearestWindow(native_view) |
| 296 .work_area(); |
296 bounds.ClampToCenteredSize(gfx::Size(UserManager::kWindowWidth, | 297 bounds.ClampToCenteredSize(gfx::Size(UserManager::kWindowWidth, |
297 UserManager::kWindowHeight)); | 298 UserManager::kWindowHeight)); |
298 } | 299 } |
299 } | 300 } |
300 | 301 |
301 DialogDelegate::CreateDialogWidgetWithBounds(this, NULL, NULL, bounds); | 302 DialogDelegate::CreateDialogWidgetWithBounds(this, NULL, NULL, bounds); |
302 | 303 |
303 // Since the User Manager can be the only top level window, we don't | 304 // Since the User Manager can be the only top level window, we don't |
304 // want to accidentally quit all of Chrome if the user is just trying to | 305 // want to accidentally quit all of Chrome if the user is just trying to |
305 // unfocus the selected pod in the WebView. | 306 // unfocus the selected pod in the WebView. |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
376 // Now that the window is closed, we can allow a new one to be opened. | 377 // Now that the window is closed, we can allow a new one to be opened. |
377 // (WindowClosing comes in asynchronously from the call to Close() and we | 378 // (WindowClosing comes in asynchronously from the call to Close() and we |
378 // may have already opened a new instance). | 379 // may have already opened a new instance). |
379 if (instance_ == this) | 380 if (instance_ == this) |
380 instance_ = NULL; | 381 instance_ = NULL; |
381 } | 382 } |
382 | 383 |
383 bool UserManagerView::UseNewStyleForThisDialog() const { | 384 bool UserManagerView::UseNewStyleForThisDialog() const { |
384 return false; | 385 return false; |
385 } | 386 } |
OLD | NEW |