Cast: Stop logging kVideoFrameSentToEncoder and rename a couple events.
[chromium-blink-merge.git] / chrome / browser / chromeos / file_manager / app_installer.h
blobefeff78a6433aa2ddbd08a5098bad893f5f7b1c1
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.
5 #ifndef CHROME_BROWSER_CHROMEOS_FILE_MANAGER_APP_INSTALLER_H_
6 #define CHROME_BROWSER_CHROMEOS_FILE_MANAGER_APP_INSTALLER_H_
8 #include <string>
10 #include "base/memory/ref_counted.h"
11 #include "chrome/browser/extensions/webstore_standalone_installer.h"
12 #include "content/public/browser/web_contents_observer.h"
14 namespace content {
15 class WebContents;
16 } // namespace content
18 namespace file_manager {
20 // This class is used for installing apps and extensions suggested from the
21 // Chrome Web Store for unsupported file types, inside Files.app.
22 class AppInstaller
23 : public extensions::WebstoreStandaloneInstaller {
24 public:
25 typedef extensions::WebstoreStandaloneInstaller::Callback Callback;
27 AppInstaller(content::WebContents* web_contents,
28 const std::string& webstore_item_id,
29 Profile* profile,
30 const Callback& callback);
32 protected:
33 friend class base::RefCountedThreadSafe<AppInstaller>;
35 virtual ~AppInstaller();
37 void OnWebContentsDestroyed(content::WebContents* web_contents);
39 // WebstoreStandaloneInstaller implementation.
40 virtual bool CheckRequestorAlive() const OVERRIDE;
41 virtual const GURL& GetRequestorURL() const OVERRIDE;
42 virtual bool ShouldShowPostInstallUI() const OVERRIDE;
43 virtual bool ShouldShowAppInstalledBubble() const OVERRIDE;
44 virtual content::WebContents* GetWebContents() const OVERRIDE;
45 virtual scoped_ptr<ExtensionInstallPrompt::Prompt>
46 CreateInstallPrompt() const OVERRIDE;
47 virtual bool CheckInlineInstallPermitted(
48 const base::DictionaryValue& webstore_data,
49 std::string* error) const OVERRIDE;
50 virtual bool CheckRequestorPermitted(
51 const base::DictionaryValue& webstore_data,
52 std::string* error) const OVERRIDE;
54 private:
55 class WebContentsObserver;
57 Callback callback_;
58 content::WebContents* web_contents_;
59 scoped_ptr<WebContentsObserver> web_contents_observer_;
61 DISALLOW_IMPLICIT_CONSTRUCTORS(AppInstaller);
64 } // namespace file_manager
66 #endif // CHROME_BROWSER_CHROMEOS_FILE_MANAGER_APP_INSTALLER_H_