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

Side by Side Diff: chrome/browser/extensions/app_notify_channel_ui_impl.cc

Issue 11434074: browser: Move FindBrowserWithWebContents() into chrome namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years 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/extensions/app_notify_channel_ui_impl.h" 5 #include "chrome/browser/extensions/app_notify_channel_ui_impl.h"
6 6
7 #include "base/utf_string_conversions.h" 7 #include "base/utf_string_conversions.h"
8 #include "chrome/browser/api/infobars/confirm_infobar_delegate.h" 8 #include "chrome/browser/api/infobars/confirm_infobar_delegate.h"
9 #include "chrome/browser/infobars/infobar_tab_helper.h" 9 #include "chrome/browser/infobars/infobar_tab_helper.h"
10 #include "chrome/browser/profiles/profile.h" 10 #include "chrome/browser/profiles/profile.h"
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 login_ui->FocusUI(); 162 login_ui->FocusUI();
163 return; 163 return;
164 } else { 164 } else {
165 // User is already logged in, so close whatever sync config UI the 165 // User is already logged in, so close whatever sync config UI the
166 // user is looking at and display new login UI. 166 // user is looking at and display new login UI.
167 login_ui->CloseUI(); 167 login_ui->CloseUI();
168 DCHECK(!login_ui_service->current_login_ui()); 168 DCHECK(!login_ui_service->current_login_ui());
169 } 169 }
170 } 170 }
171 // Any existing UI is now closed - display new login UI. 171 // Any existing UI is now closed - display new login UI.
172 Browser* browser = browser::FindBrowserWithWebContents( 172 Browser* browser = chrome::FindBrowserWithWebContents(
173 tab_contents_->web_contents()); 173 tab_contents_->web_contents());
174 chrome::ShowSettingsSubPage(browser, chrome::kSyncSetupForceLoginSubPage); 174 chrome::ShowSettingsSubPage(browser, chrome::kSyncSetupForceLoginSubPage);
175 } 175 }
176 176
177 void AppNotifyChannelUIImpl::OnStateChanged() { 177 void AppNotifyChannelUIImpl::OnStateChanged() {
178 ProfileSyncService* sync_service = 178 ProfileSyncService* sync_service =
179 ProfileSyncServiceFactory::GetInstance()->GetForProfile(profile_); 179 ProfileSyncServiceFactory::GetInstance()->GetForProfile(profile_);
180 LoginUIService* login_service = 180 LoginUIService* login_service =
181 LoginUIServiceFactory::GetForProfile(profile_); 181 LoginUIServiceFactory::GetForProfile(profile_);
182 182
(...skipping 20 matching lines...) Expand all
203 } 203 }
204 204
205 void AppNotifyChannelUIImpl::StopObservingSync() { 205 void AppNotifyChannelUIImpl::StopObservingSync() {
206 CHECK(observing_sync_); 206 CHECK(observing_sync_);
207 observing_sync_ = false; 207 observing_sync_ = false;
208 ProfileSyncServiceFactory::GetInstance()->GetForProfile( 208 ProfileSyncServiceFactory::GetInstance()->GetForProfile(
209 profile_)->RemoveObserver(this); 209 profile_)->RemoveObserver(this);
210 } 210 }
211 211
212 } // namespace extensions 212 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/captive_portal/captive_portal_tab_helper.cc ('k') | chrome/browser/extensions/extension_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698