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/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 317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
328 views::Widget::GetWidgetForNativeWindow( | 328 views::Widget::GetWidgetForNativeWindow( |
329 browser->window()->GetNativeWindow())->GetNativeView(); | 329 browser->window()->GetNativeWindow())->GetNativeView(); |
330 bounds = display::Screen::GetScreen() | 330 bounds = display::Screen::GetScreen() |
331 ->GetDisplayNearestWindow(native_view) | 331 ->GetDisplayNearestWindow(native_view) |
332 .work_area(); | 332 .work_area(); |
333 bounds.ClampToCenteredSize(gfx::Size(UserManager::kWindowWidth, | 333 bounds.ClampToCenteredSize(gfx::Size(UserManager::kWindowWidth, |
334 UserManager::kWindowHeight)); | 334 UserManager::kWindowHeight)); |
335 } | 335 } |
336 } | 336 } |
337 | 337 |
338 DialogDelegate::CreateDialogWidgetWithBounds(this, NULL, NULL, bounds); | 338 views::Widget::InitParams params = |
| 339 GetDialogWidgetInitParams(this, nullptr, nullptr, bounds); |
| 340 (new views::Widget)->Init(params); |
339 | 341 |
340 // Since the User Manager can be the only top level window, we don't | 342 // Since the User Manager can be the only top level window, we don't |
341 // want to accidentally quit all of Chrome if the user is just trying to | 343 // want to accidentally quit all of Chrome if the user is just trying to |
342 // unfocus the selected pod in the WebView. | 344 // unfocus the selected pod in the WebView. |
343 GetDialogClientView()->RemoveAccelerator( | 345 GetDialogClientView()->RemoveAccelerator( |
344 ui::Accelerator(ui::VKEY_ESCAPE, ui::EF_NONE)); | 346 ui::Accelerator(ui::VKEY_ESCAPE, ui::EF_NONE)); |
345 | 347 |
346 #if defined(OS_WIN) | 348 #if defined(OS_WIN) |
347 // Set the app id for the task manager to the app id of its parent | 349 // Set the app id for the task manager to the app id of its parent |
348 ui::win::SetAppIdForWindow( | 350 ui::win::SetAppIdForWindow( |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
413 // Now that the window is closed, we can allow a new one to be opened. | 415 // Now that the window is closed, we can allow a new one to be opened. |
414 // (WindowClosing comes in asynchronously from the call to Close() and we | 416 // (WindowClosing comes in asynchronously from the call to Close() and we |
415 // may have already opened a new instance). | 417 // may have already opened a new instance). |
416 if (instance_ == this) | 418 if (instance_ == this) |
417 instance_ = NULL; | 419 instance_ = NULL; |
418 } | 420 } |
419 | 421 |
420 bool UserManagerView::ShouldUseCustomFrame() const { | 422 bool UserManagerView::ShouldUseCustomFrame() const { |
421 return false; | 423 return false; |
422 } | 424 } |
OLD | NEW |