- add sources.
[platform/framework/web/crosswalk.git] / src / chrome / browser / ui / app_list / search / webstore / webstore_installer.h
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_UI_APP_LIST_SEARCH_WEBSTORE_WEBSTORE_INSTALLER_H_
6 #define CHROME_BROWSER_UI_APP_LIST_SEARCH_WEBSTORE_WEBSTORE_INSTALLER_H_
7
8 #include <string>
9
10 #include "base/basictypes.h"
11 #include "chrome/browser/extensions/webstore_startup_installer.h"
12 #include "content/public/browser/page_navigator.h"
13
14 class Profile;
15
16 namespace app_list {
17
18 // WebstoreInstaller handles install for web store search results.
19 class WebstoreInstaller : public extensions::WebstoreStartupInstaller,
20                           public content::PageNavigator {
21  public:
22   typedef WebstoreStandaloneInstaller::Callback Callback;
23
24   WebstoreInstaller(const std::string& webstore_item_id,
25                     Profile* profile,
26                     gfx::NativeWindow parent_window,
27                     const Callback& callback);
28
29  private:
30   friend class base::RefCountedThreadSafe<WebstoreInstaller>;
31
32   virtual ~WebstoreInstaller();
33
34   // extensions::WebstoreStartupInstaller overrides:
35   virtual scoped_ptr<ExtensionInstallPrompt> CreateInstallUI() OVERRIDE;
36
37   // content::PageNavigator overrides:
38   virtual content::WebContents* OpenURL(
39       const content::OpenURLParams& params) OVERRIDE;
40
41   Profile* profile_;
42   gfx::NativeWindow parent_window_;
43
44   DISALLOW_COPY_AND_ASSIGN(WebstoreInstaller);
45 };
46
47 }  // namespace app_list
48
49 #endif  // CHROME_BROWSER_UI_APP_LIST_SEARCH_WEBSTORE_WEBSTORE_INSTALLER_H_