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

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

Issue 14066013: Revert 194348 "Part of multiprofile implementation." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: 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 | Annotate | Revision Log
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"
21 #include "chrome/browser/password_manager/password_manager.h" 20 #include "chrome/browser/password_manager/password_manager.h"
22 #include "chrome/browser/password_manager/password_manager_delegate_impl.h" 21 #include "chrome/browser/password_manager/password_manager_delegate_impl.h"
22 #include "chrome/browser/profiles/profile_manager.h"
23 #include "chrome/browser/renderer_preferences_util.h" 23 #include "chrome/browser/renderer_preferences_util.h"
24 #include "chrome/browser/ui/media_stream_infobar_delegate.h" 24 #include "chrome/browser/ui/media_stream_infobar_delegate.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"
(...skipping 112 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 155 webui_login_ = new views::WebView(ProfileManager::GetDefaultProfile());
156 Profile* signin_profile = ProfileHelper::GetSigninProfile();
157 webui_login_ = new views::WebView(signin_profile);
158 AddChildView(webui_login_); 156 AddChildView(webui_login_);
159 157
160 WebContents* web_contents = webui_login_->GetWebContents(); 158 WebContents* web_contents = webui_login_->GetWebContents();
161 159
162 // Create the password manager that is needed for the proxy. 160 // Create the password manager that is needed for the proxy.
163 PasswordManagerDelegateImpl::CreateForWebContents(web_contents); 161 PasswordManagerDelegateImpl::CreateForWebContents(web_contents);
164 PasswordManager::CreateForWebContentsAndDelegate( 162 PasswordManager::CreateForWebContentsAndDelegate(
165 web_contents, PasswordManagerDelegateImpl::FromWebContents(web_contents)); 163 web_contents, PasswordManagerDelegateImpl::FromWebContents(web_contents));
166 164
167 // LoginHandlerViews uses a constrained window for the password manager view. 165 // LoginHandlerViews uses a constrained window for the password manager view.
168 WebContentsModalDialogManager::CreateForWebContents(web_contents); 166 WebContentsModalDialogManager::CreateForWebContents(web_contents);
169 167
170 web_contents->SetDelegate(this); 168 web_contents->SetDelegate(this);
171 renderer_preferences_util::UpdateFromSystemSettings( 169 renderer_preferences_util::UpdateFromSystemSettings(
172 web_contents->GetMutableRendererPrefs(), 170 web_contents->GetMutableRendererPrefs(),
173 signin_profile); 171 ProfileManager::GetDefaultProfile());
174 172
175 registrar_.Add(this, 173 registrar_.Add(this,
176 content::NOTIFICATION_WEB_CONTENTS_RENDER_VIEW_HOST_CREATED, 174 content::NOTIFICATION_WEB_CONTENTS_RENDER_VIEW_HOST_CREATED,
177 content::Source<WebContents>(web_contents)); 175 content::Source<WebContents>(web_contents));
178 } 176 }
179 177
180 std::string WebUILoginView::GetClassName() const { 178 std::string WebUILoginView::GetClassName() const {
181 return kViewClassName; 179 return kViewClassName;
182 } 180 }
183 181
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after
380 aura::Env::GetInstance()->set_render_white_bg(true); 378 aura::Env::GetInstance()->set_render_white_bg(true);
381 } 379 }
382 380
383 void WebUILoginView::ReturnFocus(bool reverse) { 381 void WebUILoginView::ReturnFocus(bool reverse) {
384 // Return the focus to the web contents. 382 // Return the focus to the web contents.
385 webui_login_->web_contents()->FocusThroughTabTraversal(reverse); 383 webui_login_->web_contents()->FocusThroughTabTraversal(reverse);
386 GetWidget()->Activate(); 384 GetWidget()->Activate();
387 } 385 }
388 386
389 } // namespace chromeos 387 } // namespace chromeos
OLDNEW
« no previous file with comments | « trunk/src/chrome/browser/chromeos/login/user_manager_impl.cc ('k') | trunk/src/chrome/browser/chromeos/profile_startup.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698