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

Side by Side Diff: chrome/browser/extensions/crx_installer.cc

Issue 308003005: app_list: Drive app integration. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 years, 6 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 | Annotate | Revision Log
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/extensions/crx_installer.h" 5 #include "chrome/browser/extensions/crx_installer.h"
6 6
7 #include <map> 7 #include <map>
8 #include <set> 8 #include <set>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after
222 222
223 OnUnpackSuccess(extension->path(), extension->path(), NULL, extension.get(), 223 OnUnpackSuccess(extension->path(), extension->path(), NULL, extension.get(),
224 SkBitmap()); 224 SkBitmap());
225 } 225 }
226 226
227 void CrxInstaller::InstallWebApp(const WebApplicationInfo& web_app) { 227 void CrxInstaller::InstallWebApp(const WebApplicationInfo& web_app) {
228 NotifyCrxInstallBegin(); 228 NotifyCrxInstallBegin();
229 229
230 if (!installer_task_runner_->PostTask( 230 if (!installer_task_runner_->PostTask(
231 FROM_HERE, 231 FROM_HERE,
232 base::Bind(&CrxInstaller::ConvertWebAppOnFileThread, 232 base::Bind(&CrxInstaller::ConvertWebAppOnFileThread, this, web_app)))
233 this,
234 web_app,
235 install_directory_)))
236 NOTREACHED(); 233 NOTREACHED();
237 } 234 }
238 235
239 void CrxInstaller::ConvertWebAppOnFileThread( 236 void CrxInstaller::ConvertWebAppOnFileThread(
240 const WebApplicationInfo& web_app, 237 const WebApplicationInfo& web_app) {
241 const base::FilePath& install_directory) { 238 scoped_refptr<Extension> extension(ConvertWebAppToExtension(
242 base::string16 error; 239 web_app, base::Time::Now(), install_directory_));
243 scoped_refptr<Extension> extension(
244 ConvertWebAppToExtension(web_app, base::Time::Now(), install_directory));
245 if (!extension.get()) { 240 if (!extension.get()) {
246 // Validation should have stopped any potential errors before getting here. 241 // Validation should have stopped any potential errors before getting here.
247 NOTREACHED() << "Could not convert web app to extension."; 242 NOTREACHED() << "Could not convert web app to extension.";
248 return; 243 return;
249 } 244 }
250 245
251 // TODO(aa): conversion data gets lost here :( 246 // TODO(aa): conversion data gets lost here :(
252 247
253 OnUnpackSuccess(extension->path(), extension->path(), NULL, extension.get(), 248 OnUnpackSuccess(extension->path(), extension->path(), NULL, extension.get(),
254 SkBitmap()); 249 SkBitmap());
(...skipping 648 matching lines...) Expand 10 before | Expand all | Expand 10 after
903 if (!prefs->DidExtensionEscalatePermissions(extension()->id())) 898 if (!prefs->DidExtensionEscalatePermissions(extension()->id()))
904 return; 899 return;
905 900
906 if (client_) { 901 if (client_) {
907 AddRef(); // Balanced in InstallUIProceed() and InstallUIAbort(). 902 AddRef(); // Balanced in InstallUIProceed() and InstallUIAbort().
908 client_->ConfirmReEnable(this, extension()); 903 client_->ConfirmReEnable(this, extension());
909 } 904 }
910 } 905 }
911 906
912 } // namespace extensions 907 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/crx_installer.h ('k') | chrome/browser/extensions/crx_installer_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698