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 <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 510 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
521 hotword_service->RequestHotwordSession(nullptr); | 521 hotword_service->RequestHotwordSession(nullptr); |
522 } | 522 } |
523 } | 523 } |
524 } | 524 } |
525 } | 525 } |
526 | 526 |
527 void AppListViewDelegate::OpenHelp() { | 527 void AppListViewDelegate::OpenHelp() { |
528 chrome::ScopedTabbedBrowserDisplayer displayer(profile_); | 528 chrome::ScopedTabbedBrowserDisplayer displayer(profile_); |
529 content::OpenURLParams params(GURL(chrome::kAppLauncherHelpURL), | 529 content::OpenURLParams params(GURL(chrome::kAppLauncherHelpURL), |
530 content::Referrer(), | 530 content::Referrer(), |
531 NEW_FOREGROUND_TAB, | 531 WindowOpenDisposition::NEW_FOREGROUND_TAB, |
532 ui::PAGE_TRANSITION_LINK, | 532 ui::PAGE_TRANSITION_LINK, false); |
533 false); | |
534 displayer.browser()->OpenURL(params); | 533 displayer.browser()->OpenURL(params); |
535 } | 534 } |
536 | 535 |
537 void AppListViewDelegate::OpenFeedback() { | 536 void AppListViewDelegate::OpenFeedback() { |
538 Browser* browser = chrome::FindTabbedBrowser(profile_, false); | 537 Browser* browser = chrome::FindTabbedBrowser(profile_, false); |
539 chrome::ShowFeedbackPage(browser, std::string(), | 538 chrome::ShowFeedbackPage(browser, std::string(), |
540 chrome::kAppLauncherCategoryTag); | 539 chrome::kAppLauncherCategoryTag); |
541 } | 540 } |
542 | 541 |
543 void AppListViewDelegate::StartSpeechRecognition() { | 542 void AppListViewDelegate::StartSpeechRecognition() { |
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
754 | 753 |
755 gfx::ImageSkia* AppListViewDelegate::GetAppsIcon() const { | 754 gfx::ImageSkia* AppListViewDelegate::GetAppsIcon() const { |
756 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); | 755 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); |
757 // Ensure it's backed by a native image type in the ResourceBundle cache. | 756 // Ensure it's backed by a native image type in the ResourceBundle cache. |
758 rb.GetNativeImageNamed(IDR_BOOKMARK_BAR_APPS_SHORTCUT); | 757 rb.GetNativeImageNamed(IDR_BOOKMARK_BAR_APPS_SHORTCUT); |
759 return rb.GetImageSkiaNamed(IDR_BOOKMARK_BAR_APPS_SHORTCUT); | 758 return rb.GetImageSkiaNamed(IDR_BOOKMARK_BAR_APPS_SHORTCUT); |
760 } | 759 } |
761 | 760 |
762 void AppListViewDelegate::OpenLearnMoreLink() { | 761 void AppListViewDelegate::OpenLearnMoreLink() { |
763 controller_->OpenURL(profile_, GURL(GetLearnMoreLink()), | 762 controller_->OpenURL(profile_, GURL(GetLearnMoreLink()), |
764 ui::PAGE_TRANSITION_LINK, CURRENT_TAB); | 763 ui::PAGE_TRANSITION_LINK, |
| 764 WindowOpenDisposition::CURRENT_TAB); |
765 } | 765 } |
766 #endif // !defined(OS_CHROMEOS) | 766 #endif // !defined(OS_CHROMEOS) |
767 | 767 |
768 void AppListViewDelegate::OnTemplateURLServiceChanged() { | 768 void AppListViewDelegate::OnTemplateURLServiceChanged() { |
769 if (!app_list::switches::IsExperimentalAppListEnabled()) | 769 if (!app_list::switches::IsExperimentalAppListEnabled()) |
770 return; | 770 return; |
771 | 771 |
772 TemplateURLService* template_url_service = | 772 TemplateURLService* template_url_service = |
773 TemplateURLServiceFactory::GetForProfile(profile_); | 773 TemplateURLServiceFactory::GetForProfile(profile_); |
774 const TemplateURL* default_provider = | 774 const TemplateURL* default_provider = |
(...skipping 19 matching lines...) Expand all Loading... |
794 FOR_EACH_OBSERVER(app_list::AppListViewDelegateObserver, observers_, | 794 FOR_EACH_OBSERVER(app_list::AppListViewDelegateObserver, observers_, |
795 OnShutdown()); | 795 OnShutdown()); |
796 | 796 |
797 SetProfile(nullptr); // Ensures launcher page web contents are torn down. | 797 SetProfile(nullptr); // Ensures launcher page web contents are torn down. |
798 | 798 |
799 // SigninManagerFactory is not a leaky singleton (unlike this class), and | 799 // SigninManagerFactory is not a leaky singleton (unlike this class), and |
800 // its destructor will check that it has no remaining observers. | 800 // its destructor will check that it has no remaining observers. |
801 scoped_observer_.RemoveAll(); | 801 scoped_observer_.RemoveAll(); |
802 SigninManagerFactory::GetInstance()->RemoveObserver(this); | 802 SigninManagerFactory::GetInstance()->RemoveObserver(this); |
803 } | 803 } |
OLD | NEW |