11e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles)// Copyright 2013 The Chromium Authors. All rights reserved.
21e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles)// Use of this source code is governed by a BSD-style license that can be
31e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles)// found in the LICENSE file.
41e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles)
51e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles)#ifndef CHROME_BROWSER_UI_APP_LIST_EXTENSION_UNINSTALLER_H_
61e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles)#define CHROME_BROWSER_UI_APP_LIST_EXTENSION_UNINSTALLER_H_
71e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles)
81e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles)#include "chrome/browser/extensions/extension_uninstall_dialog.h"
91e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles)
101e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles)class AppListControllerDelegate;
111e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles)class Profile;
121e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles)
131e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles)// ExtensionUninstaller runs the extension uninstall flow. It shows the
141e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles)// extension uninstall dialog and wait for user to confirm or cancel the
151e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles)// uninstall.
1646d4c2bc3267f3f028f39e7e311b0f89aba2e4fdTorne (Richard Coles)class ExtensionUninstaller
1746d4c2bc3267f3f028f39e7e311b0f89aba2e4fdTorne (Richard Coles)    : public extensions::ExtensionUninstallDialog::Delegate {
181e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) public:
191e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles)  ExtensionUninstaller(Profile* profile,
201e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles)                       const std::string& extension_id,
211e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles)                       AppListControllerDelegate* controller);
221e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles)  virtual ~ExtensionUninstaller();
231e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles)
241e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles)  void Run();
251e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles)
261e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) private:
271e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles)  // Overridden from ExtensionUninstallDialog::Delegate:
281e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles)  virtual void ExtensionUninstallAccepted() OVERRIDE;
291e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles)  virtual void ExtensionUninstallCanceled() OVERRIDE;
301e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles)  void CleanUp();
311e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles)
321e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles)  Profile* profile_;
331e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles)  std::string app_id_;
341e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles)  AppListControllerDelegate* controller_;
3546d4c2bc3267f3f028f39e7e311b0f89aba2e4fdTorne (Richard Coles)  scoped_ptr<extensions::ExtensionUninstallDialog> dialog_;
361e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles)
371e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles)  DISALLOW_COPY_AND_ASSIGN(ExtensionUninstaller);
381e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles)};
391e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles)
401e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles)
411e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles)#endif  // CHROME_BROWSER_UI_APP_LIST_EXTENSION_UNINSTALLER_H_
42