OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/chromeos/extensions/file_manager/private_api_misc.h" | 5 #include "chrome/browser/chromeos/extensions/file_manager/private_api_misc.h" |
6 | 6 |
7 #include "base/files/file_path.h" | 7 #include "base/files/file_path.h" |
8 #include "base/prefs/pref_service.h" | 8 #include "base/prefs/pref_service.h" |
9 #include "base/values.h" | 9 #include "base/values.h" |
10 #include "chrome/browser/browser_process.h" | 10 #include "chrome/browser/browser_process.h" |
11 #include "chrome/browser/chromeos/drive/drive_integration_service.h" | 11 #include "chrome/browser/chromeos/drive/drive_integration_service.h" |
12 #include "chrome/browser/chromeos/drive/logging.h" | 12 #include "chrome/browser/chromeos/drive/logging.h" |
13 #include "chrome/browser/chromeos/extensions/file_manager/private_api_util.h" | 13 #include "chrome/browser/chromeos/extensions/file_manager/private_api_util.h" |
14 #include "chrome/browser/chromeos/file_manager/file_manager_installer.h" | 14 #include "chrome/browser/chromeos/file_manager/app_installer.h" |
15 #include "chrome/browser/chromeos/settings/cros_settings.h" | 15 #include "chrome/browser/chromeos/settings/cros_settings.h" |
16 #include "chrome/browser/google_apis/auth_service.h" | 16 #include "chrome/browser/google_apis/auth_service.h" |
17 #include "chrome/browser/lifetime/application_lifetime.h" | 17 #include "chrome/browser/lifetime/application_lifetime.h" |
18 #include "chrome/browser/profiles/profile.h" | 18 #include "chrome/browser/profiles/profile.h" |
19 #include "chrome/browser/signin/profile_oauth2_token_service.h" | 19 #include "chrome/browser/signin/profile_oauth2_token_service.h" |
20 #include "chrome/browser/signin/profile_oauth2_token_service_factory.h" | 20 #include "chrome/browser/signin/profile_oauth2_token_service_factory.h" |
21 #include "chrome/common/extensions/api/file_browser_private.h" | 21 #include "chrome/common/extensions/api/file_browser_private.h" |
22 #include "chrome/common/pref_names.h" | 22 #include "chrome/common/pref_names.h" |
23 #include "content/public/browser/render_view_host.h" | 23 #include "content/public/browser/render_view_host.h" |
24 #include "content/public/common/page_zoom.h" | 24 #include "content/public/common/page_zoom.h" |
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
181 EXTENSION_FUNCTION_VALIDATE(params); | 181 EXTENSION_FUNCTION_VALIDATE(params); |
182 | 182 |
183 if (params->item_id.empty()) | 183 if (params->item_id.empty()) |
184 return false; | 184 return false; |
185 | 185 |
186 const extensions::WebstoreStandaloneInstaller::Callback callback = | 186 const extensions::WebstoreStandaloneInstaller::Callback callback = |
187 base::Bind( | 187 base::Bind( |
188 &FileBrowserPrivateInstallWebstoreItemFunction::OnInstallComplete, | 188 &FileBrowserPrivateInstallWebstoreItemFunction::OnInstallComplete, |
189 this); | 189 this); |
190 | 190 |
191 scoped_refptr<file_manager::FileManagerInstaller> installer( | 191 scoped_refptr<file_manager::AppInstaller> installer( |
192 new file_manager::FileManagerInstaller( | 192 new file_manager::AppInstaller( |
193 GetAssociatedWebContents(), // web_contents(), | 193 GetAssociatedWebContents(), // web_contents(), |
194 params->item_id, | 194 params->item_id, |
195 GetProfile(), | 195 GetProfile(), |
196 callback)); | 196 callback)); |
197 // installer will be AddRef()'d in BeginInstall(). | 197 // installer will be AddRef()'d in BeginInstall(). |
198 installer->BeginInstall(); | 198 installer->BeginInstall(); |
199 return true; | 199 return true; |
200 } | 200 } |
201 | 201 |
202 void FileBrowserPrivateInstallWebstoreItemFunction::OnInstallComplete( | 202 void FileBrowserPrivateInstallWebstoreItemFunction::OnInstallComplete( |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
268 } else { | 268 } else { |
269 drive::util::Log(logging::LOG_ERROR, | 269 drive::util::Log(logging::LOG_ERROR, |
270 "CWS OAuth token fetch failed. (GDataErrorCode: %s)", | 270 "CWS OAuth token fetch failed. (GDataErrorCode: %s)", |
271 google_apis::GDataErrorCodeToString(code).c_str()); | 271 google_apis::GDataErrorCodeToString(code).c_str()); |
272 SetResult(base::Value::CreateNullValue()); | 272 SetResult(base::Value::CreateNullValue()); |
273 SendResponse(false); | 273 SendResponse(false); |
274 } | 274 } |
275 } | 275 } |
276 | 276 |
277 } // namespace extensions | 277 } // namespace extensions |
OLD | NEW |