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

Unified Diff: chrome/browser/chromeos/extensions/file_manager/webstore_app_installer.h

Issue 23332012: Add a private API method to install a webstore app from Files.app (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chromeos/extensions/file_manager/webstore_app_installer.h
diff --git a/chrome/browser/chromeos/extensions/file_manager/webstore_app_installer.h b/chrome/browser/chromeos/extensions/file_manager/webstore_app_installer.h
new file mode 100644
index 0000000000000000000000000000000000000000..1ab4b014426c1794455d1076d84091d9616164ae
--- /dev/null
+++ b/chrome/browser/chromeos/extensions/file_manager/webstore_app_installer.h
@@ -0,0 +1,65 @@
+// Copyright (c) 2013 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_CHROMEOS_EXTENSIONS_FILE_MANAGER_WEBSTORE_APP_INSTALLER_H_
+#define CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_MANAGER_WEBSTORE_APP_INSTALLER_H_
+
+#include <string>
+
+#include "base/memory/ref_counted.h"
+#include "chrome/browser/extensions/webstore_standalone_installer.h"
+#include "content/public/browser/web_contents_observer.h"
+
+namespace content {
+class WebContents;
+}
+
+namespace file_manager {
+
+// Installer for Files.app.
+class WebstoreAppInstaller
asargent_no_longer_on_chrome 2013/08/27 18:22:33 This class name is confusingly similar to Webstor
yoshiki 2013/08/28 13:19:04 Done.
+ : public extensions::WebstoreStandaloneInstaller,
+ public content::WebContentsObserver {
+ public:
+ typedef extensions::WebstoreStandaloneInstaller::Callback Callback;
+
+ WebstoreAppInstaller(content::WebContents* web_contents,
+ const std::string& webstore_item_id,
+ Profile* profile,
+ const Callback& callback);
asargent_no_longer_on_chrome 2013/08/27 18:22:33 nit: indentation is off on these 3 lines
yoshiki 2013/08/28 13:19:04 Done.
+
+ protected:
+ friend class base::RefCountedThreadSafe<WebstoreAppInstaller>;
+
+ virtual ~WebstoreAppInstaller();
+
+ // Implementations WebstoreStandaloneInstaller Template Method's hooks.
asargent_no_longer_on_chrome 2013/08/27 18:22:33 nit: to be pedantic, it's not a template (in the C
yoshiki 2013/08/28 13:19:04 Thanks, I grep'd and have found "// SomeClassName
+ virtual bool CheckRequestorAlive() const OVERRIDE;
+ virtual const GURL& GetRequestorURL() const OVERRIDE;
+ virtual bool ShouldShowPostInstallUI() const OVERRIDE;
+ virtual bool ShouldShowAppInstalledBubble() const OVERRIDE;
+ virtual content::WebContents* GetWebContents() const OVERRIDE;
+ virtual scoped_ptr<ExtensionInstallPrompt::Prompt>
+ CreateInstallPrompt() const OVERRIDE;
+ virtual bool CheckInlineInstallPermitted(
+ const base::DictionaryValue& webstore_data,
+ std::string* error) const OVERRIDE;
+ virtual bool CheckRequestorPermitted(
+ const base::DictionaryValue& webstore_data,
+ std::string* error) const OVERRIDE;
+
+ private:
+ // content::WebContentsObserver interface implementation.
+ virtual void WebContentsDestroyed(
+ content::WebContents* web_contents) OVERRIDE;
+
+ GURL dummy_url_;
asargent_no_longer_on_chrome 2013/08/27 18:22:33 nit: this variable could use a comment since it is
yoshiki 2013/08/28 13:19:04 Done.
+ Callback callback_;
+
+ DISALLOW_IMPLICIT_CONSTRUCTORS(WebstoreAppInstaller);
+};
+
+} // namespace file_manager
+
+#endif // CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_MANAGER_WEBSTORE_APP_INSTALLER_H_

Powered by Google App Engine
This is Rietveld 408576698