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 "base/callback.h" | 7 #include "base/callback.h" |
8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
9 #include "chrome/browser/browser_process.h" | 9 #include "chrome/browser/browser_process.h" |
10 #include "chrome/browser/extensions/extension_service.h" | 10 #include "chrome/browser/extensions/extension_service.h" |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
95 } | 95 } |
96 | 96 |
97 void AppListViewDelegate::GetShortcutPathForApp( | 97 void AppListViewDelegate::GetShortcutPathForApp( |
98 const std::string& app_id, | 98 const std::string& app_id, |
99 const base::Callback<void(const base::FilePath&)>& callback) { | 99 const base::Callback<void(const base::FilePath&)>& callback) { |
100 #if defined(OS_WIN) | 100 #if defined(OS_WIN) |
101 ExtensionService* service = profile_->GetExtensionService(); | 101 ExtensionService* service = profile_->GetExtensionService(); |
102 DCHECK(service); | 102 DCHECK(service); |
103 const extensions::Extension* extension = | 103 const extensions::Extension* extension = |
104 service->GetInstalledExtension(app_id); | 104 service->GetInstalledExtension(app_id); |
105 DCHECK(extension); | 105 if (!extension) { |
106 // The installation of extension isn't finished yet. | |
koz (OOO until 15th September)
2013/07/03 04:20:09
This comment is unnecessary, could you remove it?
zhchbin
2013/07/03 05:59:59
Done.
| |
107 callback.Run(base::FilePath()); | |
108 return; | |
109 } | |
106 | 110 |
107 base::FilePath app_data_dir( | 111 base::FilePath app_data_dir( |
108 web_app::GetWebAppDataDirectory(profile_->GetPath(), | 112 web_app::GetWebAppDataDirectory(profile_->GetPath(), |
109 extension->id(), | 113 extension->id(), |
110 GURL())); | 114 GURL())); |
111 | 115 |
112 web_app::UpdateShortcutInfoAndIconForApp( | 116 web_app::UpdateShortcutInfoAndIconForApp( |
113 *extension, | 117 *extension, |
114 profile_, | 118 profile_, |
115 base::Bind(CreateShortcutInWebAppDir, app_data_dir, callback)); | 119 base::Bind(CreateShortcutInWebAppDir, app_data_dir, callback)); |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
199 } | 203 } |
200 | 204 |
201 void AppListViewDelegate::OpenFeedback() { | 205 void AppListViewDelegate::OpenFeedback() { |
202 chrome::HostDesktopType desktop = chrome::GetHostDesktopTypeForNativeWindow( | 206 chrome::HostDesktopType desktop = chrome::GetHostDesktopTypeForNativeWindow( |
203 controller_->GetAppListWindow()); | 207 controller_->GetAppListWindow()); |
204 Browser* browser = chrome::FindOrCreateTabbedBrowser( | 208 Browser* browser = chrome::FindOrCreateTabbedBrowser( |
205 profile_, desktop); | 209 profile_, desktop); |
206 chrome::ShowFeedbackPage(browser, std::string(), | 210 chrome::ShowFeedbackPage(browser, std::string(), |
207 chrome::kAppLauncherCategoryTag); | 211 chrome::kAppLauncherCategoryTag); |
208 } | 212 } |
OLD | NEW |