| 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 "chrome/browser/browser_process.h" | 7 #include "chrome/browser/browser_process.h" |
| 8 #include "chrome/browser/extensions/extension_service.h" | 8 #include "chrome/browser/extensions/extension_service.h" |
| 9 #include "chrome/browser/feedback/feedback_util.h" | 9 #include "chrome/browser/feedback/feedback_util.h" |
| 10 #include "chrome/browser/profiles/profile_manager.h" | 10 #include "chrome/browser/profiles/profile_manager.h" |
| 11 #include "chrome/browser/ui/app_list/app_list_controller_delegate.h" | 11 #include "chrome/browser/ui/app_list/app_list_controller_delegate.h" |
| 12 #include "chrome/browser/ui/app_list/apps_model_builder.h" | 12 #include "chrome/browser/ui/app_list/apps_model_builder.h" |
| 13 #include "chrome/browser/ui/app_list/chrome_app_list_item.h" | 13 #include "chrome/browser/ui/app_list/chrome_app_list_item.h" |
| 14 #include "chrome/browser/ui/app_list/chrome_signin_delegate.h" | 14 #include "chrome/browser/ui/app_list/chrome_signin_delegate.h" |
| 15 #include "chrome/browser/ui/app_list/search_builder.h" | 15 #include "chrome/browser/ui/app_list/search_builder.h" |
| 16 #include "chrome/browser/ui/browser_finder.h" | 16 #include "chrome/browser/ui/browser_finder.h" |
| 17 #include "chrome/browser/ui/chrome_pages.h" | 17 #include "chrome/browser/ui/chrome_pages.h" |
| 18 #include "chrome/browser/ui/host_desktop.h" | 18 #include "chrome/browser/ui/host_desktop.h" |
| 19 #include "chrome/common/extensions/extension_constants.h" | 19 #include "chrome/common/extensions/extension_constants.h" |
| 20 #include "chrome/common/url_constants.h" |
| 21 #include "content/public/browser/page_navigator.h" |
| 20 #include "content/public/browser/user_metrics.h" | 22 #include "content/public/browser/user_metrics.h" |
| 21 | 23 |
| 22 #if defined(USE_ASH) | 24 #if defined(USE_ASH) |
| 23 #include "chrome/browser/ui/ash/app_list/app_sync_ui_state_watcher.h" | 25 #include "chrome/browser/ui/ash/app_list/app_sync_ui_state_watcher.h" |
| 24 #endif | 26 #endif |
| 25 | 27 |
| 26 AppListViewDelegate::AppListViewDelegate(AppListControllerDelegate* controller, | 28 AppListViewDelegate::AppListViewDelegate(AppListControllerDelegate* controller, |
| 27 Profile* profile) | 29 Profile* profile) |
| 28 : controller_(controller), | 30 : controller_(controller), |
| 29 profile_(profile) {} | 31 profile_(profile) {} |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 | 133 |
| 132 void AppListViewDelegate::OpenSettings() { | 134 void AppListViewDelegate::OpenSettings() { |
| 133 ExtensionService* service = profile_->GetExtensionService(); | 135 ExtensionService* service = profile_->GetExtensionService(); |
| 134 DCHECK(service); | 136 DCHECK(service); |
| 135 const extensions::Extension* extension = service->GetInstalledExtension( | 137 const extensions::Extension* extension = service->GetInstalledExtension( |
| 136 extension_misc::kSettingsAppId); | 138 extension_misc::kSettingsAppId); |
| 137 DCHECK(extension); | 139 DCHECK(extension); |
| 138 controller_->ActivateApp(profile_, extension, 0); | 140 controller_->ActivateApp(profile_, extension, 0); |
| 139 } | 141 } |
| 140 | 142 |
| 143 void AppListViewDelegate::OpenHelp() { |
| 144 chrome::HostDesktopType desktop = chrome::GetHostDesktopTypeForNativeWindow( |
| 145 controller_->GetAppListWindow()); |
| 146 Browser* browser = chrome::FindOrCreateTabbedBrowser( |
| 147 profile_, desktop); |
| 148 browser->OpenURL(content::OpenURLParams(GURL(chrome::kAppLauncherHelpURL), |
| 149 content::Referrer(), |
| 150 NEW_FOREGROUND_TAB, |
| 151 content::PAGE_TRANSITION_LINK, |
| 152 false)); |
| 153 } |
| 154 |
| 141 void AppListViewDelegate::OpenFeedback() { | 155 void AppListViewDelegate::OpenFeedback() { |
| 142 chrome::HostDesktopType desktop = chrome::GetHostDesktopTypeForNativeWindow( | 156 chrome::HostDesktopType desktop = chrome::GetHostDesktopTypeForNativeWindow( |
| 143 controller_->GetAppListWindow()); | 157 controller_->GetAppListWindow()); |
| 144 Browser* browser = chrome::FindOrCreateTabbedBrowser( | 158 Browser* browser = chrome::FindOrCreateTabbedBrowser( |
| 145 profile_, desktop); | 159 profile_, desktop); |
| 146 chrome::ShowFeedbackPage(browser, std::string(), | 160 chrome::ShowFeedbackPage(browser, std::string(), |
| 147 chrome::kAppLauncherCategoryTag); | 161 chrome::kAppLauncherCategoryTag); |
| 148 } | 162 } |
| OLD | NEW |