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

Side by Side Diff: chrome/browser/extensions/zipfile_installer.h

Issue 406713002: Allow drag-and-drop of zipped extensions on chrome://extensions (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: add zipfile installer Created 6 years, 4 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
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef CHROME_BROWSER_EXTENSIONS_ZIPFILE_INSTALLER_H_
6 #define CHROME_BROWSER_EXTENSIONS_ZIPFILE_INSTALLER_H_
7
8 #include <string>
9
10 #include "base/basictypes.h"
11 #include "base/callback.h"
12 #include "base/files/file_path.h"
13 #include "base/memory/ref_counted.h"
14 #include "base/memory/scoped_ptr.h"
15 #include "base/memory/weak_ptr.h"
16 #include "content/public/browser/utility_process_host_client.h"
17
18 class ExtensionService;
19
20 namespace IPC {
21 class Message;
22 }
23
24 // ZipFileInstaller unzips an extension that is zipped up via a utility process.
25 // The contents are then loaded via UnpackedInstaller.
26 class ZipFileInstaller : public content::UtilityProcessHostClient {
27 public:
28 static scoped_refptr<ZipFileInstaller> Create(
29 ExtensionService* extension_service);
30
31 void LoadFromZipFile(const base::FilePath& path);
32
33 void set_be_noisy_on_failure(bool value) { be_noisy_on_failure_ = value; }
34
35 // UtilityProcessHostClient
36 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
37
38 private:
39 explicit ZipFileInstaller(ExtensionService* extension_service);
40 virtual ~ZipFileInstaller();
41
42 void StartWorkOnIOThread();
43 void ReportSuccessOnUIThread(const base::FilePath& unzipped_path);
44 void ReportErrorOnUIThread(const std::string& error);
45
46 void OnUnzipSucceeded(const base::FilePath& unzipped_path);
47 void OnUnzipFailed(const std::string& error);
48
49 bool be_noisy_on_failure_;
50 base::WeakPtr<ExtensionService> extension_service_;
51 base::FilePath zip_path_;
52
53 DISALLOW_COPY_AND_ASSIGN(ZipFileInstaller);
54 };
55
56 #endif // CHROME_BROWSER_EXTENSIONS_ZIPFILE_INSTALLER_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/extensions/zipfile_installer.cc » ('j') | chrome/browser/extensions/zipfile_installer.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698