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 12 matching lines...) Expand all Loading... |
23 #include "chrome/browser/ui/browser_window.h" | 23 #include "chrome/browser/ui/browser_window.h" |
24 #include "chrome/browser/ui/user_manager.h" | 24 #include "chrome/browser/ui/user_manager.h" |
25 #include "chrome/grit/chromium_strings.h" | 25 #include "chrome/grit/chromium_strings.h" |
26 #include "chrome/grit/generated_resources.h" | 26 #include "chrome/grit/generated_resources.h" |
27 #include "components/guest_view/browser/guest_view_manager.h" | 27 #include "components/guest_view/browser/guest_view_manager.h" |
28 #include "content/public/browser/navigation_details.h" | 28 #include "content/public/browser/navigation_details.h" |
29 #include "content/public/browser/render_widget_host_view.h" | 29 #include "content/public/browser/render_widget_host_view.h" |
30 #include "content/public/browser/web_contents.h" | 30 #include "content/public/browser/web_contents.h" |
31 #include "google_apis/gaia/gaia_urls.h" | 31 #include "google_apis/gaia/gaia_urls.h" |
32 #include "ui/base/l10n/l10n_util.h" | 32 #include "ui/base/l10n/l10n_util.h" |
33 #include "ui/gfx/screen.h" | 33 #include "ui/display/screen.h" |
34 #include "ui/views/controls/webview/webview.h" | 34 #include "ui/views/controls/webview/webview.h" |
35 #include "ui/views/layout/fill_layout.h" | 35 #include "ui/views/layout/fill_layout.h" |
36 #include "ui/views/view.h" | 36 #include "ui/views/view.h" |
37 #include "ui/views/widget/widget.h" | 37 #include "ui/views/widget/widget.h" |
38 #include "ui/views/window/dialog_client_view.h" | 38 #include "ui/views/window/dialog_client_view.h" |
39 | 39 |
40 #if defined(OS_WIN) | 40 #if defined(OS_WIN) |
41 #include "chrome/browser/shell_integration_win.h" | 41 #include "chrome/browser/shell_integration_win.h" |
42 #include "ui/base/win/shell.h" | 42 #include "ui/base/win/shell.h" |
43 #include "ui/views/win/hwnd_util.h" | 43 #include "ui/views/win/hwnd_util.h" |
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
298 ProfileManager* profile_manager = g_browser_process->profile_manager(); | 298 ProfileManager* profile_manager = g_browser_process->profile_manager(); |
299 const base::FilePath& last_used_profile_path = | 299 const base::FilePath& last_used_profile_path = |
300 profile_manager->GetLastUsedProfileDir(profile_manager->user_data_dir()); | 300 profile_manager->GetLastUsedProfileDir(profile_manager->user_data_dir()); |
301 Profile* profile = profile_manager->GetProfileByPath(last_used_profile_path); | 301 Profile* profile = profile_manager->GetProfileByPath(last_used_profile_path); |
302 if (profile) { | 302 if (profile) { |
303 Browser* browser = chrome::FindLastActiveWithProfile(profile); | 303 Browser* browser = chrome::FindLastActiveWithProfile(profile); |
304 if (browser) { | 304 if (browser) { |
305 gfx::NativeView native_view = | 305 gfx::NativeView native_view = |
306 views::Widget::GetWidgetForNativeWindow( | 306 views::Widget::GetWidgetForNativeWindow( |
307 browser->window()->GetNativeWindow())->GetNativeView(); | 307 browser->window()->GetNativeWindow())->GetNativeView(); |
308 bounds = gfx::Screen::GetScreen() | 308 bounds = display::Screen::GetScreen() |
309 ->GetDisplayNearestWindow(native_view) | 309 ->GetDisplayNearestWindow(native_view) |
310 .work_area(); | 310 .work_area(); |
311 bounds.ClampToCenteredSize(gfx::Size(UserManager::kWindowWidth, | 311 bounds.ClampToCenteredSize(gfx::Size(UserManager::kWindowWidth, |
312 UserManager::kWindowHeight)); | 312 UserManager::kWindowHeight)); |
313 } | 313 } |
314 } | 314 } |
315 | 315 |
316 DialogDelegate::CreateDialogWidgetWithBounds(this, NULL, NULL, bounds); | 316 DialogDelegate::CreateDialogWidgetWithBounds(this, NULL, NULL, bounds); |
317 | 317 |
318 // Since the User Manager can be the only top level window, we don't | 318 // Since the User Manager can be the only top level window, we don't |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
391 // Now that the window is closed, we can allow a new one to be opened. | 391 // Now that the window is closed, we can allow a new one to be opened. |
392 // (WindowClosing comes in asynchronously from the call to Close() and we | 392 // (WindowClosing comes in asynchronously from the call to Close() and we |
393 // may have already opened a new instance). | 393 // may have already opened a new instance). |
394 if (instance_ == this) | 394 if (instance_ == this) |
395 instance_ = NULL; | 395 instance_ = NULL; |
396 } | 396 } |
397 | 397 |
398 bool UserManagerView::UseNewStyleForThisDialog() const { | 398 bool UserManagerView::UseNewStyleForThisDialog() const { |
399 return false; | 399 return false; |
400 } | 400 } |
OLD | NEW |