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

Unified Diff: chrome/browser/ui/app_list/drive/drive_app_converter.h

Issue 292523004: app_list: DriveAppConverter to install local URL app from DriveAppInfo. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: for comments in #1 Created 6 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/ui/app_list/drive/drive_app_converter.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/app_list/drive/drive_app_converter.h
diff --git a/chrome/browser/ui/app_list/drive/drive_app_converter.h b/chrome/browser/ui/app_list/drive/drive_app_converter.h
new file mode 100644
index 0000000000000000000000000000000000000000..d153c9f2f710c5241926ce56cfa586bf4fc45717
--- /dev/null
+++ b/chrome/browser/ui/app_list/drive/drive_app_converter.h
@@ -0,0 +1,69 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_UI_APP_LIST_DRIVE_DRIVE_APP_CONVERTER_H_
+#define CHROME_BROWSER_UI_APP_LIST_DRIVE_DRIVE_APP_CONVERTER_H_
+
+#include <string>
+
+#include "base/callback.h"
+#include "base/macros.h"
+#include "base/memory/ref_counted.h"
+#include "base/memory/scoped_vector.h"
+#include "chrome/browser/drive/drive_app_registry.h"
+#include "chrome/browser/extensions/install_observer.h"
+#include "chrome/common/web_application_info.h"
+
+namespace extensions {
+class CrxInstaller;
+class Extension;
+}
+
+class Profile;
+
+// DriveAppConverter creates and installs a local URL app for the given
+// DriveAppInfo into the given profile.
+class DriveAppConverter : public extensions::InstallObserver {
+ public:
+ typedef base::Callback<void(const DriveAppConverter*, bool success)>
+ FinishedCallback;
+
+ DriveAppConverter(Profile* profile,
+ const drive::DriveAppInfo& app_info,
+ const FinishedCallback& finished_callback);
+ virtual ~DriveAppConverter();
+
+ void Start();
+
+ const drive::DriveAppInfo& app_info() const { return app_info_; }
+ const extensions::Extension* app() const { return app_; }
+
+ private:
+ class IconFetcher;
+
+ // Callbacks from IconFetcher.
+ void OnIconFetchComplete(const IconFetcher* fetcher);
+
+ void StartInstall();
+ void PostInstallCleanUp();
+
+ // extensions::InstallObserver:
+ virtual void OnFinishCrxInstall(const std::string& extension_id,
+ bool success) OVERRIDE;
+
+ Profile* profile_;
+ const drive::DriveAppInfo app_info_;
+
+ WebApplicationInfo web_app_;
+ const extensions::Extension* app_;
+
+ ScopedVector<IconFetcher> fetchers_;
+ scoped_refptr<extensions::CrxInstaller> crx_installer_;
+
+ FinishedCallback finished_callback_;
+
+ DISALLOW_COPY_AND_ASSIGN(DriveAppConverter);
+};
+
+#endif // CHROME_BROWSER_UI_APP_LIST_DRIVE_DRIVE_APP_CONVERTER_H_
« no previous file with comments | « no previous file | chrome/browser/ui/app_list/drive/drive_app_converter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698