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, this may later hit a check (same condition as this one) in |
| 290 // Browser::Browser when opening links in a browser window (see |
| 291 // http://crbug.com/460437). |
| 292 DCHECK(!profile_->IsGuestSession() || profile_->IsOffTheRecord()) |
| 293 << "Guest mode must use incognito profile"; |
| 294 |
288 // TODO(vadimt): Remove ScopedTracker below once crbug.com/431326 is fixed. | 295 // TODO(vadimt): Remove ScopedTracker below once crbug.com/431326 is fixed. |
289 tracked_objects::ScopedTracker tracking_profile3( | 296 tracked_objects::ScopedTracker tracking_profile3( |
290 FROM_HERE_WITH_EXPLICIT_FUNCTION( | 297 FROM_HERE_WITH_EXPLICIT_FUNCTION( |
291 "431326 AppListViewDelegate::SetProfile3")); | 298 "431326 AppListViewDelegate::SetProfile3")); |
292 template_url_service_observer_.RemoveAll(); | 299 template_url_service_observer_.RemoveAll(); |
293 if (app_list::switches::IsExperimentalAppListEnabled()) { | 300 if (app_list::switches::IsExperimentalAppListEnabled()) { |
294 TemplateURLService* template_url_service = | 301 TemplateURLService* template_url_service = |
295 TemplateURLServiceFactory::GetForProfile(profile_); | 302 TemplateURLServiceFactory::GetForProfile(profile_); |
296 template_url_service_observer_.Add(template_url_service); | 303 template_url_service_observer_.Add(template_url_service); |
297 } | 304 } |
(...skipping 528 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
826 | 833 |
827 // SigninManagerFactory is not a leaky singleton (unlike this class), and | 834 // SigninManagerFactory is not a leaky singleton (unlike this class), and |
828 // its destructor will check that it has no remaining observers. | 835 // its destructor will check that it has no remaining observers. |
829 scoped_observer_.RemoveAll(); | 836 scoped_observer_.RemoveAll(); |
830 SigninManagerFactory::GetInstance()->RemoveObserver(this); | 837 SigninManagerFactory::GetInstance()->RemoveObserver(this); |
831 break; | 838 break; |
832 default: | 839 default: |
833 NOTREACHED(); | 840 NOTREACHED(); |
834 } | 841 } |
835 } | 842 } |
OLD | NEW |