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

Side by Side Diff: chrome/browser/chromeos/login/webui_login_view.cc

Issue 13633003: Part of multiprofile implementation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: m Created 7 years, 8 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/chromeos/login/webui_login_view.h" 5 #include "chrome/browser/chromeos/login/webui_login_view.h"
6 6
7 #include "ash/shell.h" 7 #include "ash/shell.h"
8 #include "ash/system/tray/system_tray.h" 8 #include "ash/system/tray/system_tray.h"
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/callback.h" 10 #include "base/callback.h"
11 #include "base/debug/trace_event.h" 11 #include "base/debug/trace_event.h"
12 #include "base/i18n/rtl.h" 12 #include "base/i18n/rtl.h"
13 #include "base/utf_string_conversions.h" 13 #include "base/utf_string_conversions.h"
14 #include "base/values.h" 14 #include "base/values.h"
15 #include "chrome/browser/chromeos/accessibility/accessibility_util.h" 15 #include "chrome/browser/chromeos/accessibility/accessibility_util.h"
16 #include "chrome/browser/chromeos/cros/cros_library.h" 16 #include "chrome/browser/chromeos/cros/cros_library.h"
17 #include "chrome/browser/chromeos/login/base_login_display_host.h" 17 #include "chrome/browser/chromeos/login/base_login_display_host.h"
18 #include "chrome/browser/chromeos/login/proxy_settings_dialog.h" 18 #include "chrome/browser/chromeos/login/proxy_settings_dialog.h"
19 #include "chrome/browser/chromeos/login/webui_login_display.h" 19 #include "chrome/browser/chromeos/login/webui_login_display.h"
20 #include "chrome/browser/chromeos/profiles/profile_helper.h"
20 #include "chrome/browser/media/media_stream_infobar_delegate.h" 21 #include "chrome/browser/media/media_stream_infobar_delegate.h"
21 #include "chrome/browser/password_manager/password_manager.h" 22 #include "chrome/browser/password_manager/password_manager.h"
22 #include "chrome/browser/password_manager/password_manager_delegate_impl.h" 23 #include "chrome/browser/password_manager/password_manager_delegate_impl.h"
23 #include "chrome/browser/profiles/profile_manager.h"
24 #include "chrome/browser/renderer_preferences_util.h" 24 #include "chrome/browser/renderer_preferences_util.h"
25 #include "chrome/browser/ui/web_contents_modal_dialog_manager.h" 25 #include "chrome/browser/ui/web_contents_modal_dialog_manager.h"
26 #include "chrome/browser/ui/webui/chromeos/login/oobe_ui.h" 26 #include "chrome/browser/ui/webui/chromeos/login/oobe_ui.h"
27 #include "chrome/common/chrome_notification_types.h" 27 #include "chrome/common/chrome_notification_types.h"
28 #include "chrome/common/render_messages.h" 28 #include "chrome/common/render_messages.h"
29 #include "chromeos/dbus/dbus_thread_manager.h" 29 #include "chromeos/dbus/dbus_thread_manager.h"
30 #include "chromeos/dbus/session_manager_client.h" 30 #include "chromeos/dbus/session_manager_client.h"
31 #include "content/public/browser/notification_service.h" 31 #include "content/public/browser/notification_service.h"
32 #include "content/public/browser/render_view_host.h" 32 #include "content/public/browser/render_view_host.h"
33 #include "content/public/browser/render_view_host_observer.h" 33 #include "content/public/browser/render_view_host_observer.h"
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 145
146 WebUILoginView::~WebUILoginView() { 146 WebUILoginView::~WebUILoginView() {
147 if (ash::Shell::GetInstance()->HasPrimaryStatusArea()) { 147 if (ash::Shell::GetInstance()->HasPrimaryStatusArea()) {
148 ash::Shell::GetInstance()->GetPrimarySystemTray()-> 148 ash::Shell::GetInstance()->GetPrimarySystemTray()->
149 SetNextFocusableView(NULL); 149 SetNextFocusableView(NULL);
150 } 150 }
151 } 151 }
152 152
153 void WebUILoginView::Init(views::Widget* login_window) { 153 void WebUILoginView::Init(views::Widget* login_window) {
154 login_window_ = login_window; 154 login_window_ = login_window;
155 webui_login_ = new views::WebView(ProfileManager::GetDefaultProfile()); 155
156 Profile* signin_profile = ProfileHelper::GetSigninProfile();
157 webui_login_ = new views::WebView(signin_profile);
156 AddChildView(webui_login_); 158 AddChildView(webui_login_);
157 159
158 WebContents* web_contents = webui_login_->GetWebContents(); 160 WebContents* web_contents = webui_login_->GetWebContents();
159 161
160 // Create the password manager that is needed for the proxy. 162 // Create the password manager that is needed for the proxy.
161 PasswordManagerDelegateImpl::CreateForWebContents(web_contents); 163 PasswordManagerDelegateImpl::CreateForWebContents(web_contents);
162 PasswordManager::CreateForWebContentsAndDelegate( 164 PasswordManager::CreateForWebContentsAndDelegate(
163 web_contents, PasswordManagerDelegateImpl::FromWebContents(web_contents)); 165 web_contents, PasswordManagerDelegateImpl::FromWebContents(web_contents));
164 166
165 // LoginHandlerViews uses a constrained window for the password manager view. 167 // LoginHandlerViews uses a constrained window for the password manager view.
166 WebContentsModalDialogManager::CreateForWebContents(web_contents); 168 WebContentsModalDialogManager::CreateForWebContents(web_contents);
167 169
168 web_contents->SetDelegate(this); 170 web_contents->SetDelegate(this);
169 renderer_preferences_util::UpdateFromSystemSettings( 171 renderer_preferences_util::UpdateFromSystemSettings(
170 web_contents->GetMutableRendererPrefs(), 172 web_contents->GetMutableRendererPrefs(),
171 ProfileManager::GetDefaultProfile()); 173 signin_profile);
172 174
173 registrar_.Add(this, 175 registrar_.Add(this,
174 content::NOTIFICATION_WEB_CONTENTS_RENDER_VIEW_HOST_CREATED, 176 content::NOTIFICATION_WEB_CONTENTS_RENDER_VIEW_HOST_CREATED,
175 content::Source<WebContents>(web_contents)); 177 content::Source<WebContents>(web_contents));
176 } 178 }
177 179
178 std::string WebUILoginView::GetClassName() const { 180 std::string WebUILoginView::GetClassName() const {
179 return kViewClassName; 181 return kViewClassName;
180 } 182 }
181 183
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after
378 aura::Env::GetInstance()->set_render_white_bg(true); 380 aura::Env::GetInstance()->set_render_white_bg(true);
379 } 381 }
380 382
381 void WebUILoginView::ReturnFocus(bool reverse) { 383 void WebUILoginView::ReturnFocus(bool reverse) {
382 // Return the focus to the web contents. 384 // Return the focus to the web contents.
383 webui_login_->web_contents()->FocusThroughTabTraversal(reverse); 385 webui_login_->web_contents()->FocusThroughTabTraversal(reverse);
384 GetWidget()->Activate(); 386 GetWidget()->Activate();
385 } 387 }
386 388
387 } // namespace chromeos 389 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/login/user_manager_impl.cc ('k') | chrome/browser/chromeos/profile_startup.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698