Chromium Code Reviews| OLD | NEW |
|---|---|
| 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/app_list/app_list_view_delegate.h" | 5 #include "chrome/browser/ui/app_list/app_list_view_delegate.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "apps/custom_launcher_page_contents.h" | 9 #include "apps/custom_launcher_page_contents.h" |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| (...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 278 if (!profile_) { | 278 if (!profile_) { |
| 279 // TODO(vadimt): Remove ScopedTracker below once crbug.com/431326 is fixed. | 279 // TODO(vadimt): Remove ScopedTracker below once crbug.com/431326 is fixed. |
| 280 tracked_objects::ScopedTracker tracking_profile2( | 280 tracked_objects::ScopedTracker tracking_profile2( |
| 281 FROM_HERE_WITH_EXPLICIT_FUNCTION( | 281 FROM_HERE_WITH_EXPLICIT_FUNCTION( |
| 282 "431326 AppListViewDelegate::SetProfile2")); | 282 "431326 AppListViewDelegate::SetProfile2")); |
| 283 | 283 |
| 284 speech_ui_->SetSpeechRecognitionState(app_list::SPEECH_RECOGNITION_OFF); | 284 speech_ui_->SetSpeechRecognitionState(app_list::SPEECH_RECOGNITION_OFF); |
| 285 return; | 285 return; |
| 286 } | 286 } |
| 287 | 287 |
| 288 // If we are in guest mode, the new profile should be an incognito profile. | |
| 289 // Otherwise, there will be trouble opening links in a browser window (see | |
| 290 // http://crbug.com/460437). | |
| 291 DCHECK(!profile_->IsGuestSession() || profile_->IsOffTheRecord()) | |
|
tapted
2015/03/04 05:01:10
perhaps worth noting in the comment that this is t
Matt Giuca
2015/03/04 06:07:05
Done.
| |
| 292 << "Guest mode must use incognito profile"; | |
| 293 | |
| 288 // TODO(vadimt): Remove ScopedTracker below once crbug.com/431326 is fixed. | 294 // TODO(vadimt): Remove ScopedTracker below once crbug.com/431326 is fixed. |
| 289 tracked_objects::ScopedTracker tracking_profile3( | 295 tracked_objects::ScopedTracker tracking_profile3( |
| 290 FROM_HERE_WITH_EXPLICIT_FUNCTION( | 296 FROM_HERE_WITH_EXPLICIT_FUNCTION( |
| 291 "431326 AppListViewDelegate::SetProfile3")); | 297 "431326 AppListViewDelegate::SetProfile3")); |
| 292 template_url_service_observer_.RemoveAll(); | 298 template_url_service_observer_.RemoveAll(); |
| 293 if (app_list::switches::IsExperimentalAppListEnabled()) { | 299 if (app_list::switches::IsExperimentalAppListEnabled()) { |
| 294 TemplateURLService* template_url_service = | 300 TemplateURLService* template_url_service = |
| 295 TemplateURLServiceFactory::GetForProfile(profile_); | 301 TemplateURLServiceFactory::GetForProfile(profile_); |
| 296 template_url_service_observer_.Add(template_url_service); | 302 template_url_service_observer_.Add(template_url_service); |
| 297 } | 303 } |
| (...skipping 528 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 826 | 832 |
| 827 // SigninManagerFactory is not a leaky singleton (unlike this class), and | 833 // SigninManagerFactory is not a leaky singleton (unlike this class), and |
| 828 // its destructor will check that it has no remaining observers. | 834 // its destructor will check that it has no remaining observers. |
| 829 scoped_observer_.RemoveAll(); | 835 scoped_observer_.RemoveAll(); |
| 830 SigninManagerFactory::GetInstance()->RemoveObserver(this); | 836 SigninManagerFactory::GetInstance()->RemoveObserver(this); |
| 831 break; | 837 break; |
| 832 default: | 838 default: |
| 833 NOTREACHED(); | 839 NOTREACHED(); |
| 834 } | 840 } |
| 835 } | 841 } |
| OLD | NEW |