Chromium Code Reviews| Index: chrome/browser/extensions/extension_generic_dialog.h |
| diff --git a/chrome/browser/extensions/extension_generic_dialog.h b/chrome/browser/extensions/extension_generic_dialog.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..fab9650e6ba4e9d10929259b5dda96d33479bcf7 |
| --- /dev/null |
| +++ b/chrome/browser/extensions/extension_generic_dialog.h |
| @@ -0,0 +1,60 @@ |
| +// Copyright (c) 2011 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_EXTENSIONS_EXTENSION_GENERIC_DIALOG_H_ |
| +#define CHROME_BROWSER_EXTENSIONS_EXTENSION_GENERIC_DIALOG_H_ |
| +#pragma once |
| + |
| +#include "base/basictypes.h" |
| +#include "base/compiler_specific.h" |
| +#include "chrome/browser/extensions/image_loading_tracker.h" |
| +#include "chrome/browser/extensions/extension_install_ui.h" |
| + |
| +class MessageLoop; |
| + |
| +class ExtensionGenericDialog : public ImageLoadingTracker::Observer { |
| + public: |
| + enum DialogType { |
| + DIALOG_UNSET = -1, |
| + DIALOG_INSTALL = 0, |
|
Aaron Boodman
2011/03/23 00:30:19
This one is unneeded in the new world.
|
| + DIALOG_UNINSTALL, |
| + DIALOG_RE_ENABLE, |
| + DIALOG_NUM_TYPES |
| + }; |
|
Aaron Boodman
2011/03/23 00:30:19
You will need to move ExtensionInstallUI::Delegate
|
| + |
| + ExtensionGenericDialog(); |
| + virtual ~ExtensionGenericDialog(); |
| + |
| + // This is called by the extensions management page to verify whether the |
| + // uninstallation should proceed. This is declared virtual for testing. |
| + // |
| + // We *MUST* eventually call either Proceed() or Abort() |
| + // on |delegate|. |
| + void ConfirmUninstall(ExtensionInstallUI::Delegate* delegate, |
|
Aaron Boodman
2011/03/23 00:30:19
It might be good to replace these with a single Co
|
| + const Extension* extension); |
| + |
| + // This is called by the app handler launcher to verify whether the app |
| + // should be re-enabled. This is declared virtual for testing. |
| + // |
| + // We *MUST* eventually call either Proceed() or Abort() on |delegate|. |
| + void ConfirmReenable(ExtensionInstallUI::Delegate* delegate, |
| + const Extension* extension); |
| + |
| + private: |
| + // Starts the process of showing a confirmation UI, which is split into two. |
| + // 1) Set off a 'load icon' task. |
| + // 2) Handle the load icon response and show the UI (OnImageLoaded). |
| + void ShowConfirmation(DialogType dialog_type); |
| + |
| + // ImageLoadingTracker::Observer: |
| + virtual void OnImageLoaded(SkBitmap* image, |
| + const ExtensionResource& resource, |
| + int index) OVERRIDE; |
| + |
| + MessageLoop* ui_loop_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(ExtensionGenericDialog); |
| +}; |
| + |
| +#endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_GENERIC_DIALOG_H_ |