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

Side by Side Diff: chrome/browser/ui/views/profiles/user_manager_view.cc

Issue 2751833004: Reland "Add display::GetDisplayNearestView" (Closed)
Patch Set: Created 3 years, 9 months 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 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/callback.h" 7 #include "base/callback.h"
8 #include "base/memory/ptr_util.h" 8 #include "base/memory/ptr_util.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 336 matching lines...) Expand 10 before | Expand all | Expand 10 after
347 const base::FilePath& last_used_profile_path = 347 const base::FilePath& last_used_profile_path =
348 profile_manager->GetLastUsedProfileDir(profile_manager->user_data_dir()); 348 profile_manager->GetLastUsedProfileDir(profile_manager->user_data_dir());
349 Profile* profile = profile_manager->GetProfileByPath(last_used_profile_path); 349 Profile* profile = profile_manager->GetProfileByPath(last_used_profile_path);
350 if (profile) { 350 if (profile) {
351 Browser* browser = chrome::FindLastActiveWithProfile(profile); 351 Browser* browser = chrome::FindLastActiveWithProfile(profile);
352 if (browser) { 352 if (browser) {
353 gfx::NativeView native_view = 353 gfx::NativeView native_view =
354 views::Widget::GetWidgetForNativeWindow( 354 views::Widget::GetWidgetForNativeWindow(
355 browser->window()->GetNativeWindow())->GetNativeView(); 355 browser->window()->GetNativeWindow())->GetNativeView();
356 bounds = display::Screen::GetScreen() 356 bounds = display::Screen::GetScreen()
357 ->GetDisplayNearestWindow(native_view) 357 ->GetDisplayNearestView(native_view)
358 .work_area(); 358 .work_area();
359 bounds.ClampToCenteredSize(gfx::Size(UserManager::kWindowWidth, 359 bounds.ClampToCenteredSize(gfx::Size(UserManager::kWindowWidth,
360 UserManager::kWindowHeight)); 360 UserManager::kWindowHeight));
361 } 361 }
362 } 362 }
363 363
364 views::Widget::InitParams params = 364 views::Widget::InitParams params =
365 GetDialogWidgetInitParams(this, nullptr, nullptr, bounds); 365 GetDialogWidgetInitParams(this, nullptr, nullptr, bounds);
366 (new views::Widget)->Init(params); 366 (new views::Widget)->Init(params);
367 367
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
448 delegate_->DisplayErrorMessage(); 448 delegate_->DisplayErrorMessage();
449 } 449 }
450 450
451 void UserManagerView::SetSigninProfilePath(const base::FilePath& profile_path) { 451 void UserManagerView::SetSigninProfilePath(const base::FilePath& profile_path) {
452 signin_profile_path_ = profile_path; 452 signin_profile_path_ = profile_path;
453 } 453 }
454 454
455 base::FilePath UserManagerView::GetSigninProfilePath() { 455 base::FilePath UserManagerView::GetSigninProfilePath() {
456 return signin_profile_path_; 456 return signin_profile_path_;
457 } 457 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/chrome_views_delegate.cc ('k') | chrome/browser/ui/views/status_bubble_views.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698