Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(388)

Side by Side Diff: chrome/browser/ui/app_list/app_list_view_delegate.cc

Issue 14007002: Add help button to app launcher (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: forgot OVERRIDE Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/browser/ui/app_list/app_list_view_delegate.h ('k') | chrome/common/url_constants.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 134
133 void AppListViewDelegate::OpenSettings() { 135 void AppListViewDelegate::OpenSettings() {
134 ExtensionService* service = profile_->GetExtensionService(); 136 ExtensionService* service = profile_->GetExtensionService();
135 DCHECK(service); 137 DCHECK(service);
136 const extensions::Extension* extension = service->GetInstalledExtension( 138 const extensions::Extension* extension = service->GetInstalledExtension(
137 extension_misc::kSettingsAppId); 139 extension_misc::kSettingsAppId);
138 DCHECK(extension); 140 DCHECK(extension);
139 controller_->ActivateApp(profile_, extension, 0); 141 controller_->ActivateApp(profile_, extension, 0);
140 } 142 }
141 143
144 void AppListViewDelegate::OpenHelp() {
145 chrome::HostDesktopType desktop = chrome::GetHostDesktopTypeForNativeWindow(
146 controller_->GetAppListWindow());
147 Browser* browser = chrome::FindOrCreateTabbedBrowser(
148 profile_, desktop);
149 browser->OpenURL(content::OpenURLParams(GURL(chrome::kAppLauncherHelpURL),
150 content::Referrer(),
151 NEW_FOREGROUND_TAB,
152 content::PAGE_TRANSITION_LINK,
153 false));
154 }
155
142 void AppListViewDelegate::OpenFeedback() { 156 void AppListViewDelegate::OpenFeedback() {
143 chrome::HostDesktopType desktop = chrome::GetHostDesktopTypeForNativeWindow( 157 chrome::HostDesktopType desktop = chrome::GetHostDesktopTypeForNativeWindow(
144 controller_->GetAppListWindow()); 158 controller_->GetAppListWindow());
145 Browser* browser = chrome::FindOrCreateTabbedBrowser( 159 Browser* browser = chrome::FindOrCreateTabbedBrowser(
146 profile_, desktop); 160 profile_, desktop);
147 chrome::ShowFeedbackPage(browser, std::string(), 161 chrome::ShowFeedbackPage(browser, std::string(),
148 chrome::kAppLauncherCategoryTag); 162 chrome::kAppLauncherCategoryTag);
149 } 163 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/app_list/app_list_view_delegate.h ('k') | chrome/common/url_constants.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698