Index: chrome/browser/ui/views/extensions/extension_generic_dialog_view.cc |
diff --git a/chrome/browser/ui/views/extensions/extension_install_prompt.cc b/chrome/browser/ui/views/extensions/extension_generic_dialog_view.cc |
similarity index 79% |
rename from chrome/browser/ui/views/extensions/extension_install_prompt.cc |
rename to chrome/browser/ui/views/extensions/extension_generic_dialog_view.cc |
index d29a243e606273ef0f2eb2590d3ed8bfb276d598..d4bbfd25f228eaa1b55e2a9f87f2e9b6a01da47c 100644 |
--- a/chrome/browser/ui/views/extensions/extension_install_prompt.cc |
+++ b/chrome/browser/ui/views/extensions/extension_generic_dialog_view.cc |
@@ -2,7 +2,8 @@ |
// Use of this source code is governed by a BSD-style license that can be |
// found in the LICENSE file. |
-#include "base/file_util.h" |
+#include "base/basictypes.h" |
+#include "base/compiler_specific.h" |
#include "base/string_util.h" |
#include "base/utf_string_conversions.h" |
#include "chrome/browser/browser_list.h" |
@@ -28,12 +29,13 @@ const int kRightColumnWidth = 210; |
const int kIconSize = 69; |
// Implements the extension installation prompt for Windows. |
-class InstallDialogContent : public views::View, public views::DialogDelegate { |
+class ExtensionGenericDialogView : public views::View, |
+ public views::DialogDelegate { |
public: |
- InstallDialogContent(ExtensionInstallUI::Delegate* delegate, |
- const Extension* extension, |
- SkBitmap* icon, |
- ExtensionInstallUI::PromptType type) |
+ ExtensionGenericDialogView(ExtensionInstallUI::Delegate* delegate, |
+ const Extension* extension, |
+ SkBitmap* icon, |
+ ExtensionInstallUI::PromptType type) |
: delegate_(delegate), icon_(NULL), type_(type) { |
// Scale down to icon size, but allow smaller icons (don't scale up). |
gfx::Size size(icon->width(), icon->height()); |
@@ -53,9 +55,9 @@ class InstallDialogContent : public views::View, public views::DialogDelegate { |
} |
private: |
- // DialogDelegate |
+ // views::DialogDelegate: |
virtual std::wstring GetDialogButtonLabel( |
- MessageBoxFlags::DialogButton button) const { |
+ MessageBoxFlags::DialogButton button) const OVERRIDE { |
switch (button) { |
case MessageBoxFlags::DIALOGBUTTON_OK: |
return UTF16ToWide( |
@@ -68,30 +70,30 @@ class InstallDialogContent : public views::View, public views::DialogDelegate { |
} |
} |
- virtual int GetDefaultDialogButton() const { |
+ virtual int GetDefaultDialogButton() const OVERRIDE { |
return MessageBoxFlags::DIALOGBUTTON_CANCEL; |
} |
- virtual bool Accept() { |
+ virtual bool Accept() OVERRIDE { |
delegate_->InstallUIProceed(); |
return true; |
} |
- virtual bool Cancel() { |
+ virtual bool Cancel() OVERRIDE { |
delegate_->InstallUIAbort(); |
return true; |
} |
- // WindowDelegate |
- virtual bool IsModal() const { return true; } |
- virtual std::wstring GetWindowTitle() const { |
+ // views::WindowDelegate: |
+ virtual bool IsModal() const OVERRIDE { return true; } |
+ virtual std::wstring GetWindowTitle() const OVERRIDE { |
return UTF16ToWide( |
l10n_util::GetStringUTF16(ExtensionInstallUI::kTitleIds[type_])); |
} |
virtual views::View* GetContentsView() { return this; } |
- // View |
- virtual gfx::Size GetPreferredSize() { |
+ // views::View: |
+ virtual gfx::Size GetPreferredSize() OVERRIDE { |
int width = kRightColumnWidth; |
width += kIconSize; |
width += views::kPanelHorizMargin * 3; |
@@ -103,7 +105,7 @@ class InstallDialogContent : public views::View, public views::DialogDelegate { |
std::max(height, kIconSize + views::kPanelVertMargin * 2)); |
} |
- virtual void Layout() { |
+ virtual void Layout() OVERRIDE { |
int x = views::kPanelHorizMargin; |
int y = views::kPanelVertMargin; |
@@ -134,12 +136,12 @@ class InstallDialogContent : public views::View, public views::DialogDelegate { |
views::Label* heading_; |
ExtensionInstallUI::PromptType type_; |
- DISALLOW_COPY_AND_ASSIGN(InstallDialogContent); |
+ DISALLOW_COPY_AND_ASSIGN(ExtensionGenericDialogView); |
}; |
} // namespace |
-void ShowExtensionInstallDialog(Profile* profile, |
+void ShowGenericExtensionDialog(Profile* profile, |
ExtensionInstallUI::Delegate* delegate, |
const Extension* extension, |
SkBitmap* icon, |
@@ -157,5 +159,5 @@ void ShowExtensionInstallDialog(Profile* profile, |
} |
browser::CreateViewsWindow(window->GetNativeHandle(), gfx::Rect(), |
- new InstallDialogContent(delegate, extension, icon, type))->Show(); |
+ new ExtensionGenericDialogView(delegate, extension, icon, type))->Show(); |
} |