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 302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
313 search_controller_ = CreateSearchController(profile_, model_, controller_); | 313 search_controller_ = CreateSearchController(profile_, model_, controller_); |
314 } | 314 } |
315 | 315 |
316 void AppListViewDelegate::SetUpProfileSwitcher() { | 316 void AppListViewDelegate::SetUpProfileSwitcher() { |
317 // If a profile change is observed when there is no app list, there is nothing | 317 // If a profile change is observed when there is no app list, there is nothing |
318 // to update until SetProfile() calls this function again. | 318 // to update until SetProfile() calls this function again. |
319 if (!profile_) | 319 if (!profile_) |
320 return; | 320 return; |
321 | 321 |
322 // Don't populate the app list users if we are on the ash desktop. | 322 // Don't populate the app list users if we are on the ash desktop. |
323 chrome::HostDesktopType desktop = chrome::GetHostDesktopTypeForNativeWindow( | 323 ui::HostDesktopType desktop = chrome::GetHostDesktopTypeForNativeWindow( |
324 controller_->GetAppListWindow()); | 324 controller_->GetAppListWindow()); |
325 if (desktop == chrome::HOST_DESKTOP_TYPE_ASH) | 325 if (desktop == ui::HOST_DESKTOP_TYPE_ASH) |
326 return; | 326 return; |
327 | 327 |
328 // Populate the app list users. | 328 // Populate the app list users. |
329 PopulateUsers(g_browser_process->profile_manager()->GetProfileInfoCache(), | 329 PopulateUsers(g_browser_process->profile_manager()->GetProfileInfoCache(), |
330 profile_->GetPath(), | 330 profile_->GetPath(), |
331 &users_); | 331 &users_); |
332 | 332 |
333 FOR_EACH_OBSERVER( | 333 FOR_EACH_OBSERVER( |
334 app_list::AppListViewDelegateObserver, observers_, OnProfilesChanged()); | 334 app_list::AppListViewDelegateObserver, observers_, OnProfilesChanged()); |
335 } | 335 } |
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
574 extension_misc::kSettingsAppId, | 574 extension_misc::kSettingsAppId, |
575 extensions::ExtensionRegistry::EVERYTHING); | 575 extensions::ExtensionRegistry::EVERYTHING); |
576 DCHECK(extension); | 576 DCHECK(extension); |
577 controller_->ActivateApp(profile_, | 577 controller_->ActivateApp(profile_, |
578 extension, | 578 extension, |
579 AppListControllerDelegate::LAUNCH_FROM_UNKNOWN, | 579 AppListControllerDelegate::LAUNCH_FROM_UNKNOWN, |
580 0); | 580 0); |
581 } | 581 } |
582 | 582 |
583 void AppListViewDelegate::OpenHelp() { | 583 void AppListViewDelegate::OpenHelp() { |
584 chrome::HostDesktopType desktop = chrome::GetHostDesktopTypeForNativeWindow( | 584 ui::HostDesktopType desktop = chrome::GetHostDesktopTypeForNativeWindow( |
585 controller_->GetAppListWindow()); | 585 controller_->GetAppListWindow()); |
586 chrome::ScopedTabbedBrowserDisplayer displayer(profile_, desktop); | 586 chrome::ScopedTabbedBrowserDisplayer displayer(profile_, desktop); |
587 content::OpenURLParams params(GURL(chrome::kAppLauncherHelpURL), | 587 content::OpenURLParams params(GURL(chrome::kAppLauncherHelpURL), |
588 content::Referrer(), | 588 content::Referrer(), |
589 NEW_FOREGROUND_TAB, | 589 NEW_FOREGROUND_TAB, |
590 ui::PAGE_TRANSITION_LINK, | 590 ui::PAGE_TRANSITION_LINK, |
591 false); | 591 false); |
592 displayer.browser()->OpenURL(params); | 592 displayer.browser()->OpenURL(params); |
593 } | 593 } |
594 | 594 |
595 void AppListViewDelegate::OpenFeedback() { | 595 void AppListViewDelegate::OpenFeedback() { |
596 chrome::HostDesktopType desktop = chrome::GetHostDesktopTypeForNativeWindow( | 596 ui::HostDesktopType desktop = chrome::GetHostDesktopTypeForNativeWindow( |
597 controller_->GetAppListWindow()); | 597 controller_->GetAppListWindow()); |
598 Browser* browser = chrome::FindTabbedBrowser(profile_, false, desktop); | 598 Browser* browser = chrome::FindTabbedBrowser(profile_, false, desktop); |
599 chrome::ShowFeedbackPage(browser, std::string(), | 599 chrome::ShowFeedbackPage(browser, std::string(), |
600 chrome::kAppLauncherCategoryTag); | 600 chrome::kAppLauncherCategoryTag); |
601 } | 601 } |
602 | 602 |
603 void AppListViewDelegate::ToggleSpeechRecognition() { | 603 void AppListViewDelegate::ToggleSpeechRecognition() { |
604 ToggleSpeechRecognitionForHotword(nullptr); | 604 ToggleSpeechRecognitionForHotword(nullptr); |
605 } | 605 } |
606 | 606 |
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
815 | 815 |
816 // SigninManagerFactory is not a leaky singleton (unlike this class), and | 816 // SigninManagerFactory is not a leaky singleton (unlike this class), and |
817 // its destructor will check that it has no remaining observers. | 817 // its destructor will check that it has no remaining observers. |
818 scoped_observer_.RemoveAll(); | 818 scoped_observer_.RemoveAll(); |
819 SigninManagerFactory::GetInstance()->RemoveObserver(this); | 819 SigninManagerFactory::GetInstance()->RemoveObserver(this); |
820 break; | 820 break; |
821 default: | 821 default: |
822 NOTREACHED(); | 822 NOTREACHED(); |
823 } | 823 } |
824 } | 824 } |
OLD | NEW |