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

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

Issue 1321713005: Abstract WebContents/NavigationController from core TabRestore code (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix Created 5 years, 3 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 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/chromeos/login/ui/webui_login_view.h" 5 #include "chrome/browser/chromeos/login/ui/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"
(...skipping 13 matching lines...) Expand all
24 #include "chrome/browser/password_manager/chrome_password_manager_client.h" 24 #include "chrome/browser/password_manager/chrome_password_manager_client.h"
25 #include "chrome/browser/renderer_preferences_util.h" 25 #include "chrome/browser/renderer_preferences_util.h"
26 #include "chrome/browser/sessions/session_tab_helper.h" 26 #include "chrome/browser/sessions/session_tab_helper.h"
27 #include "chrome/browser/ui/autofill/chrome_autofill_client.h" 27 #include "chrome/browser/ui/autofill/chrome_autofill_client.h"
28 #include "chrome/browser/ui/webui/chromeos/login/oobe_ui.h" 28 #include "chrome/browser/ui/webui/chromeos/login/oobe_ui.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 "chromeos/network/network_state.h" 31 #include "chromeos/network/network_state.h"
32 #include "chromeos/network/network_state_handler.h" 32 #include "chromeos/network/network_state_handler.h"
33 #include "components/password_manager/core/browser/password_manager.h" 33 #include "components/password_manager/core/browser/password_manager.h"
34 #include "components/sessions/content/content_open_tab.h"
34 #include "components/web_modal/web_contents_modal_dialog_manager.h" 35 #include "components/web_modal/web_contents_modal_dialog_manager.h"
35 #include "content/public/browser/notification_service.h" 36 #include "content/public/browser/notification_service.h"
36 #include "content/public/browser/render_frame_host.h" 37 #include "content/public/browser/render_frame_host.h"
37 #include "content/public/browser/render_view_host.h" 38 #include "content/public/browser/render_view_host.h"
38 #include "content/public/browser/render_widget_host_view.h" 39 #include "content/public/browser/render_widget_host_view.h"
39 #include "content/public/browser/web_contents.h" 40 #include "content/public/browser/web_contents.h"
40 #include "content/public/browser/web_ui.h" 41 #include "content/public/browser/web_ui.h"
41 #include "content/public/common/renderer_preferences.h" 42 #include "content/public/common/renderer_preferences.h"
42 #include "third_party/WebKit/public/web/WebInputEvent.h" 43 #include "third_party/WebKit/public/web/WebInputEvent.h"
43 #include "ui/gfx/geometry/rect.h" 44 #include "ui/gfx/geometry/rect.h"
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 webui_login_->set_allow_accelerators(true); 177 webui_login_->set_allow_accelerators(true);
177 AddChildView(webui_login_); 178 AddChildView(webui_login_);
178 179
179 WebContents* web_contents = webui_login_->GetWebContents(); 180 WebContents* web_contents = webui_login_->GetWebContents();
180 181
181 // Ensure that the login UI has a tab ID, which will allow the GAIA auth 182 // Ensure that the login UI has a tab ID, which will allow the GAIA auth
182 // extension's background script to tell it apart from a captive portal window 183 // extension's background script to tell it apart from a captive portal window
183 // that may be opened on top of this UI. 184 // that may be opened on top of this UI.
184 SessionTabHelper::CreateForWebContents(web_contents); 185 SessionTabHelper::CreateForWebContents(web_contents);
185 186
187 sessions::ContentOpenTab::CreateForWebContents(web_contents);
188
186 // Create the password manager that is needed for the proxy. 189 // Create the password manager that is needed for the proxy.
187 ChromePasswordManagerClient::CreateForWebContentsWithAutofillClient( 190 ChromePasswordManagerClient::CreateForWebContentsWithAutofillClient(
188 web_contents, 191 web_contents,
189 autofill::ChromeAutofillClient::FromWebContents(web_contents)); 192 autofill::ChromeAutofillClient::FromWebContents(web_contents));
190 193
191 // LoginHandlerViews uses a constrained window for the password manager view. 194 // LoginHandlerViews uses a constrained window for the password manager view.
192 WebContentsModalDialogManager::CreateForWebContents(web_contents); 195 WebContentsModalDialogManager::CreateForWebContents(web_contents);
193 WebContentsModalDialogManager::FromWebContents(web_contents)-> 196 WebContentsModalDialogManager::FromWebContents(web_contents)->
194 SetDelegate(this); 197 SetDelegate(this);
195 198
(...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after
494 webui_visible_ = true; 497 webui_visible_ = true;
495 } 498 }
496 499
497 void WebUILoginView::ReturnFocus(bool reverse) { 500 void WebUILoginView::ReturnFocus(bool reverse) {
498 // Return the focus to the web contents. 501 // Return the focus to the web contents.
499 webui_login_->web_contents()->FocusThroughTabTraversal(reverse); 502 webui_login_->web_contents()->FocusThroughTabTraversal(reverse);
500 GetWidget()->Activate(); 503 GetWidget()->Activate();
501 } 504 }
502 505
503 } // namespace chromeos 506 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698