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 "chrome/browser/browser_process.h" | 7 #include "chrome/browser/browser_process.h" |
8 #include "chrome/browser/lifetime/application_lifetime.h" | 8 #include "chrome/browser/lifetime/application_lifetime.h" |
9 #include "chrome/browser/profiles/profile_avatar_icon_util.h" | |
10 #include "chrome/browser/profiles/profile_manager.h" | 9 #include "chrome/browser/profiles/profile_manager.h" |
11 #include "chrome/browser/profiles/profile_metrics.h" | 10 #include "chrome/browser/profiles/profile_metrics.h" |
12 #include "chrome/browser/profiles/profile_window.h" | 11 #include "chrome/browser/profiles/profile_window.h" |
13 #include "chrome/browser/profiles/profiles_state.h" | 12 #include "chrome/browser/profiles/profiles_state.h" |
14 #include "chrome/browser/ui/browser.h" | 13 #include "chrome/browser/ui/browser.h" |
15 #include "chrome/browser/ui/browser_dialogs.h" | 14 #include "chrome/browser/ui/browser_dialogs.h" |
16 #include "chrome/browser/ui/browser_finder.h" | 15 #include "chrome/browser/ui/browser_finder.h" |
17 #include "chrome/browser/ui/browser_window.h" | 16 #include "chrome/browser/ui/browser_window.h" |
18 #include "chrome/browser/ui/user_manager.h" | 17 #include "chrome/browser/ui/user_manager.h" |
19 #include "chrome/browser/ui/views/auto_keep_alive.h" | 18 #include "chrome/browser/ui/views/auto_keep_alive.h" |
20 #include "chrome/grit/chromium_strings.h" | 19 #include "chrome/grit/chromium_strings.h" |
21 #include "content/public/browser/render_widget_host_view.h" | |
22 #include "content/public/browser/web_contents.h" | 20 #include "content/public/browser/web_contents.h" |
23 #include "ui/base/l10n/l10n_util.h" | 21 #include "ui/base/l10n/l10n_util.h" |
24 #include "ui/gfx/screen.h" | 22 #include "ui/gfx/screen.h" |
25 #include "ui/views/controls/webview/webview.h" | 23 #include "ui/views/controls/webview/webview.h" |
26 #include "ui/views/layout/fill_layout.h" | 24 #include "ui/views/layout/fill_layout.h" |
27 #include "ui/views/view.h" | 25 #include "ui/views/view.h" |
28 #include "ui/views/widget/widget.h" | 26 #include "ui/views/widget/widget.h" |
29 #include "ui/views/window/dialog_client_view.h" | 27 #include "ui/views/window/dialog_client_view.h" |
30 | 28 |
31 #if defined(OS_WIN) | 29 #if defined(OS_WIN) |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 GetDialogClientView()->RemoveAccelerator( | 141 GetDialogClientView()->RemoveAccelerator( |
144 ui::Accelerator(ui::VKEY_ESCAPE, ui::EF_NONE)); | 142 ui::Accelerator(ui::VKEY_ESCAPE, ui::EF_NONE)); |
145 | 143 |
146 #if defined(OS_WIN) | 144 #if defined(OS_WIN) |
147 // Set the app id for the task manager to the app id of its parent | 145 // Set the app id for the task manager to the app id of its parent |
148 ui::win::SetAppIdForWindow( | 146 ui::win::SetAppIdForWindow( |
149 ShellIntegration::GetChromiumModelIdForProfile( | 147 ShellIntegration::GetChromiumModelIdForProfile( |
150 guest_profile->GetPath()), | 148 guest_profile->GetPath()), |
151 views::HWNDForWidget(GetWidget())); | 149 views::HWNDForWidget(GetWidget())); |
152 #endif | 150 #endif |
| 151 GetWidget()->Show(); |
153 | 152 |
154 web_view_->LoadInitialURL(url); | 153 web_view_->LoadInitialURL(url); |
155 content::RenderWidgetHostView* rwhv = | |
156 web_view_->GetWebContents()->GetRenderWidgetHostView(); | |
157 if (rwhv) | |
158 rwhv->SetBackgroundColor(profiles::kUserManagerBackgroundColor); | |
159 | |
160 web_view_->RequestFocus(); | 154 web_view_->RequestFocus(); |
161 | |
162 GetWidget()->Show(); | |
163 } | 155 } |
164 | 156 |
165 bool UserManagerView::AcceleratorPressed(const ui::Accelerator& accelerator) { | 157 bool UserManagerView::AcceleratorPressed(const ui::Accelerator& accelerator) { |
166 int key = accelerator.key_code(); | 158 int key = accelerator.key_code(); |
167 int modifier = accelerator.modifiers(); | 159 int modifier = accelerator.modifiers(); |
168 DCHECK((key == ui::VKEY_W && modifier == ui::EF_CONTROL_DOWN) || | 160 DCHECK((key == ui::VKEY_W && modifier == ui::EF_CONTROL_DOWN) || |
169 (key == ui::VKEY_F4 && modifier == ui::EF_ALT_DOWN)); | 161 (key == ui::VKEY_F4 && modifier == ui::EF_ALT_DOWN)); |
170 GetWidget()->Close(); | 162 GetWidget()->Close(); |
171 return true; | 163 return true; |
172 } | 164 } |
(...skipping 26 matching lines...) Expand all Loading... |
199 // Now that the window is closed, we can allow a new one to be opened. | 191 // Now that the window is closed, we can allow a new one to be opened. |
200 // (WindowClosing comes in asynchronously from the call to Close() and we | 192 // (WindowClosing comes in asynchronously from the call to Close() and we |
201 // may have already opened a new instance). | 193 // may have already opened a new instance). |
202 if (instance_ == this) | 194 if (instance_ == this) |
203 instance_ = NULL; | 195 instance_ = NULL; |
204 } | 196 } |
205 | 197 |
206 bool UserManagerView::UseNewStyleForThisDialog() const { | 198 bool UserManagerView::UseNewStyleForThisDialog() const { |
207 return false; | 199 return false; |
208 } | 200 } |
OLD | NEW |