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

Side by Side Diff: chrome/browser/apps/drive/drive_app_converter.h

Issue 308003005: app_list: Drive app integration. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: make generated flag logic easier to read, fix a not-detecting-user-install-properly bug 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
« no previous file with comments | « chrome/browser/apps/drive/OWNERS ('k') | chrome/browser/apps/drive/drive_app_converter.cc » ('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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 #ifndef CHROME_BROWSER_UI_APP_LIST_DRIVE_DRIVE_APP_CONVERTER_H_ 5 #ifndef CHROME_BROWSER_APPS_DRIVE_DRIVE_APP_CONVERTER_H_
6 #define CHROME_BROWSER_UI_APP_LIST_DRIVE_DRIVE_APP_CONVERTER_H_ 6 #define CHROME_BROWSER_APPS_DRIVE_DRIVE_APP_CONVERTER_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/callback.h" 10 #include "base/callback.h"
11 #include "base/macros.h" 11 #include "base/macros.h"
12 #include "base/memory/ref_counted.h" 12 #include "base/memory/ref_counted.h"
13 #include "base/memory/scoped_vector.h" 13 #include "base/memory/scoped_vector.h"
14 #include "chrome/browser/drive/drive_app_registry.h" 14 #include "chrome/browser/drive/drive_app_registry.h"
15 #include "chrome/browser/extensions/install_observer.h" 15 #include "chrome/browser/extensions/install_observer.h"
16 #include "chrome/common/web_application_info.h" 16 #include "chrome/common/web_application_info.h"
17 17
18 class Profile;
19
18 namespace extensions { 20 namespace extensions {
19 class CrxInstaller; 21 class CrxInstaller;
20 class Extension; 22 class Extension;
21 } 23 }
22 24
23 class Profile;
24
25 // DriveAppConverter creates and installs a local URL app for the given 25 // DriveAppConverter creates and installs a local URL app for the given
26 // DriveAppInfo into the given profile. 26 // DriveAppInfo into the given profile.
27 class DriveAppConverter : public extensions::InstallObserver { 27 class DriveAppConverter : public extensions::InstallObserver {
28 public: 28 public:
29 typedef base::Callback<void(const DriveAppConverter*, bool success)> 29 typedef base::Callback<void(const DriveAppConverter*, bool success)>
30 FinishedCallback; 30 FinishedCallback;
31 31
32 DriveAppConverter(Profile* profile, 32 DriveAppConverter(Profile* profile,
33 const drive::DriveAppInfo& app_info, 33 const drive::DriveAppInfo& app_info,
34 const FinishedCallback& finished_callback); 34 const FinishedCallback& finished_callback);
35 virtual ~DriveAppConverter(); 35 virtual ~DriveAppConverter();
36 36
37 void Start(); 37 void Start();
38 bool IsStarted() const;
39
40 bool IsInstalling(const std::string& app_id) const;
38 41
39 const drive::DriveAppInfo& app_info() const { return app_info_; } 42 const drive::DriveAppInfo& app_info() const { return app_info_; }
benwells 2014/06/16 03:45:45 Nit: make this and associated field drive_app_info
xiyuan 2014/06/17 17:57:56 Done.
40 const extensions::Extension* app() const { return app_; } 43 const extensions::Extension* app() const { return app_; }
benwells 2014/06/16 03:45:45 Nit: make this and associated field extension()
xiyuan 2014/06/17 17:57:56 Done.
44 bool is_new_install() const { return is_new_install_; }
41 45
42 private: 46 private:
43 class IconFetcher; 47 class IconFetcher;
44 48
45 // Callbacks from IconFetcher. 49 // Callbacks from IconFetcher.
46 void OnIconFetchComplete(const IconFetcher* fetcher); 50 void OnIconFetchComplete(const IconFetcher* fetcher);
47 51
48 void StartInstall(); 52 void StartInstall();
49 void PostInstallCleanUp(); 53 void PostInstallCleanUp();
50 54
51 // extensions::InstallObserver: 55 // extensions::InstallObserver:
52 virtual void OnFinishCrxInstall(const std::string& extension_id, 56 virtual void OnFinishCrxInstall(const std::string& extension_id,
53 bool success) OVERRIDE; 57 bool success) OVERRIDE;
54 58
55 Profile* profile_; 59 Profile* profile_;
56 const drive::DriveAppInfo app_info_; 60 const drive::DriveAppInfo app_info_;
57 61
58 WebApplicationInfo web_app_; 62 WebApplicationInfo web_app_;
59 const extensions::Extension* app_; 63 const extensions::Extension* app_;
64 bool is_new_install_;
60 65
61 ScopedVector<IconFetcher> fetchers_; 66 ScopedVector<IconFetcher> fetchers_;
62 scoped_refptr<extensions::CrxInstaller> crx_installer_; 67 scoped_refptr<extensions::CrxInstaller> crx_installer_;
63 68
64 FinishedCallback finished_callback_; 69 FinishedCallback finished_callback_;
65 70
66 DISALLOW_COPY_AND_ASSIGN(DriveAppConverter); 71 DISALLOW_COPY_AND_ASSIGN(DriveAppConverter);
67 }; 72 };
68 73
69 #endif // CHROME_BROWSER_UI_APP_LIST_DRIVE_DRIVE_APP_CONVERTER_H_ 74 #endif // CHROME_BROWSER_APPS_DRIVE_DRIVE_APP_CONVERTER_H_
OLDNEW
« no previous file with comments | « chrome/browser/apps/drive/OWNERS ('k') | chrome/browser/apps/drive/drive_app_converter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698