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

Unified Diff: chrome/browser/ui/webui/ntp/ntp_login_handler.cc

Issue 8227038: Sync Promo: Close browser tab when closing promo (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: remove old code Created 9 years, 2 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/ntp/ntp_login_handler.cc
diff --git a/chrome/browser/ui/webui/ntp/ntp_login_handler.cc b/chrome/browser/ui/webui/ntp/ntp_login_handler.cc
index f868ce175cf5f399359295328366569d0febee59..da1caf36049a0e39af28b3bbbaeeadb7a4dbfeae 100644
--- a/chrome/browser/ui/webui/ntp/ntp_login_handler.cc
+++ b/chrome/browser/ui/webui/ntp/ntp_login_handler.cc
@@ -78,7 +78,8 @@ void NTPLoginHandler::HandleShowSyncLoginUI(const ListValue* args) {
}
} else if (args->GetSize() == 4) {
// The user is signed in, show the profiles menu.
- Browser* browser = GetBrowser();
+ Browser* browser =
+ BrowserList::FindBrowserWithTabContents(web_ui_->tab_contents());
if (!browser)
return;
double x = 0;
@@ -135,12 +136,3 @@ bool NTPLoginHandler::ShouldShow(Profile* profile) {
return profile->GetOriginalProfile()->IsSyncAccessible();
#endif
}
-
-Browser* NTPLoginHandler::GetBrowser() {
- for (TabContentsIterator it; !it.done(); ++it) {
- TabContents* tab = it->tab_contents();
- if (tab == web_ui_->tab_contents())
- return it.browser();
- }
- return NULL;
-}

Powered by Google App Engine
This is Rietveld 408576698