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

Side by Side Diff: chrome/browser/ui/webui/signin/login_ui_service.cc

Issue 9473001: Extract minimal RenderViewHost interface for embedders, leaving (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge to LKGR. Created 8 years, 9 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/ui/webui/signin/login_ui_service.h" 5 #include "chrome/browser/ui/webui/signin/login_ui_service.h"
6 6
7 #include "chrome/browser/profiles/profile.h" 7 #include "chrome/browser/profiles/profile.h"
8 #include "chrome/browser/ui/browser.h" 8 #include "chrome/browser/ui/browser.h"
9 #include "chrome/browser/ui/browser_list.h" 9 #include "chrome/browser/ui/browser_list.h"
10 #include "chrome/browser/ui/browser_window.h" 10 #include "chrome/browser/ui/browser_window.h"
(...skipping 18 matching lines...) Expand all
29 void LoginUIService::LoginUIClosed(content::WebUI* ui) { 29 void LoginUIService::LoginUIClosed(content::WebUI* ui) {
30 if (current_login_ui() == ui) 30 if (current_login_ui() == ui)
31 ui_ = NULL; 31 ui_ = NULL;
32 } 32 }
33 33
34 void LoginUIService::FocusLoginUI() { 34 void LoginUIService::FocusLoginUI() {
35 if (!ui_) { 35 if (!ui_) {
36 NOTREACHED() << "FocusLoginUI() called with no active login UI"; 36 NOTREACHED() << "FocusLoginUI() called with no active login UI";
37 return; 37 return;
38 } 38 }
39 ui_->GetWebContents()->GetRenderViewHost()->delegate()->Activate(); 39 ui_->GetWebContents()->GetRenderViewHost()->GetDelegate()->Activate();
40 } 40 }
41 41
42 void LoginUIService::ShowLoginUI() { 42 void LoginUIService::ShowLoginUI() {
43 if (ui_) { 43 if (ui_) {
44 // We already have active login UI - make it visible. 44 // We already have active login UI - make it visible.
45 FocusLoginUI(); 45 FocusLoginUI();
46 return; 46 return;
47 } 47 }
48 48
49 // Need to navigate to the settings page and display the UI. 49 // Need to navigate to the settings page and display the UI.
50 if (profile_) { 50 if (profile_) {
51 Browser* browser = BrowserList::GetLastActiveWithProfile(profile_); 51 Browser* browser = BrowserList::GetLastActiveWithProfile(profile_);
52 if (!browser) { 52 if (!browser) {
53 browser = Browser::Create(profile_); 53 browser = Browser::Create(profile_);
54 browser->ShowOptionsTab(chrome::kSyncSetupSubPage); 54 browser->ShowOptionsTab(chrome::kSyncSetupSubPage);
55 browser->window()->Show(); 55 browser->window()->Show();
56 } else { 56 } else {
57 browser->ShowOptionsTab(chrome::kSyncSetupSubPage); 57 browser->ShowOptionsTab(chrome::kSyncSetupSubPage);
58 } 58 }
59 } 59 }
60 } 60 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/print_preview/print_preview_handler.cc ('k') | chrome/browser/ui/webui/sync_setup_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698