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

Unified Diff: chrome/browser/ui/webui/signin/login_ui_service.cc

Issue 10192005: Refactor LoginUIService to not rely on WebUI. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Review feedback. Created 8 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/webui/signin/login_ui_service.cc
diff --git a/chrome/browser/ui/webui/signin/login_ui_service.cc b/chrome/browser/ui/webui/signin/login_ui_service.cc
index 7f6a91f5eb78c9d3b4ddcc3dee3aef3720a99b1c..e6d2a98f2cda55b92738d2c7faaceba9294d86ce 100644
--- a/chrome/browser/ui/webui/signin/login_ui_service.cc
+++ b/chrome/browser/ui/webui/signin/login_ui_service.cc
@@ -9,10 +9,6 @@
#include "chrome/browser/ui/browser_list.h"
#include "chrome/browser/ui/browser_window.h"
#include "chrome/common/url_constants.h"
-#include "content/public/browser/render_view_host.h"
-#include "content/public/browser/render_view_host_delegate.h"
-#include "content/public/browser/web_contents.h"
-#include "content/public/browser/web_ui.h"
LoginUIService::LoginUIService(Profile* profile)
: ui_(NULL),
@@ -21,43 +17,32 @@ LoginUIService::LoginUIService(Profile* profile)
LoginUIService::~LoginUIService() {}
-void LoginUIService::SetLoginUI(content::WebUI* ui) {
+void LoginUIService::SetLoginUI(LoginUI* ui) {
DCHECK(!current_login_ui() || current_login_ui() == ui);
ui_ = ui;
}
-void LoginUIService::LoginUIClosed(content::WebUI* ui) {
+void LoginUIService::LoginUIClosed(LoginUI* ui) {
if (current_login_ui() == ui)
ui_ = NULL;
}
-void LoginUIService::FocusLoginUI() {
- if (!ui_) {
- NOTREACHED() << "FocusLoginUI() called with no active login UI";
- return;
- }
- ui_->GetWebContents()->GetRenderViewHost()->GetDelegate()->Activate();
-}
-
-void LoginUIService::ShowLoginUI(bool force_login) {
+void LoginUIService::ShowLoginUI() {
if (ui_) {
// We already have active login UI - make it visible.
- FocusLoginUI();
+ ui_->FocusUI();
return;
}
- std::string page(force_login ?
- chrome::kSyncSetupForceLoginSubPage : chrome::kSyncSetupSubPage);
-
// Need to navigate to the settings page and display the UI.
if (profile_) {
Browser* browser = BrowserList::GetLastActiveWithProfile(profile_);
if (!browser) {
browser = Browser::Create(profile_);
- browser->ShowOptionsTab(page);
+ browser->ShowOptionsTab(chrome::kSyncSetupSubPage);
browser->window()->Show();
} else {
- browser->ShowOptionsTab(page);
+ browser->ShowOptionsTab(chrome::kSyncSetupSubPage);
}
}
}
« no previous file with comments | « chrome/browser/ui/webui/signin/login_ui_service.h ('k') | chrome/browser/ui/webui/sync_promo/sync_promo_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698