summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--chrome/browser/extensions/extension_install_dialog.h22
-rw-r--r--chrome/browser/extensions/extension_install_ui.cc5
-rw-r--r--chrome/browser/extensions/extension_install_ui.h8
-rw-r--r--chrome/browser/ui/cocoa/extensions/extension_install_prompt.mm18
-rw-r--r--chrome/browser/ui/gtk/extensions/extension_install_prompt_gtk.cc16
-rw-r--r--chrome/browser/ui/views/extensions/extension_install_prompt.cc20
-rw-r--r--chrome/chrome_browser.gypi1
7 files changed, 51 insertions, 39 deletions
diff --git a/chrome/browser/extensions/extension_install_dialog.h b/chrome/browser/extensions/extension_install_dialog.h
new file mode 100644
index 0000000..3ac7df1
--- /dev/null
+++ b/chrome/browser/extensions/extension_install_dialog.h
@@ -0,0 +1,22 @@
+// 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_INSTALL_DIALOG_H_
+#define CHROME_BROWSER_EXTENSIONS_EXTENSION_INSTALL_DIALOG_H_
+#pragma once
+
+#include "chrome/browser/extensions/extension_install_ui.h"
+
+class Extension;
+class Profile;
+class SkBitmap;
+
+// The implementations of this function are platform-specific.
+void ShowExtensionInstallDialog(Profile* profile,
+ ExtensionInstallUI::Delegate* delegate,
+ const Extension* extension,
+ SkBitmap* icon,
+ ExtensionInstallUI::PromptType type);
+
+#endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_INSTALL_DIALOG_H_
diff --git a/chrome/browser/extensions/extension_install_ui.cc b/chrome/browser/extensions/extension_install_ui.cc
index c07d0f6..f309429 100644
--- a/chrome/browser/extensions/extension_install_ui.cc
+++ b/chrome/browser/extensions/extension_install_ui.cc
@@ -14,6 +14,7 @@
#include "base/utf_string_conversions.h"
#include "chrome/browser/browser_list.h"
#include "chrome/browser/browser_window.h"
+#include "chrome/browser/extensions/extension_install_dialog.h"
#include "chrome/browser/extensions/theme_installed_infobar_delegate.h"
#include "chrome/browser/platform_util.h"
#include "chrome/browser/profiles/profile.h"
@@ -227,8 +228,8 @@ void ExtensionInstallUI::OnImageLoaded(
break;
}
case UNINSTALL_PROMPT: {
- ShowExtensionInstallUIPromptImpl(profile_, delegate_, extension_, &icon_,
- UNINSTALL_PROMPT);
+ ShowExtensionInstallDialog(
+ profile_, delegate_, extension_, &icon_, UNINSTALL_PROMPT);
break;
}
default:
diff --git a/chrome/browser/extensions/extension_install_ui.h b/chrome/browser/extensions/extension_install_ui.h
index eca7ef3..97b5a0c 100644
--- a/chrome/browser/extensions/extension_install_ui.h
+++ b/chrome/browser/extensions/extension_install_ui.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// 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.
@@ -111,12 +111,6 @@ class ExtensionInstallUI : public ImageLoadingTracker::Observer {
TabContents* tab_contents, const Extension* new_theme,
const std::string& previous_theme_id, bool previous_use_system_theme);
- // Implements the showing of the install/uninstall dialog prompt.
- // NOTE: The implementations of this function is platform-specific.
- static void ShowExtensionInstallUIPromptImpl(
- Profile* profile, Delegate* delegate, const Extension* extension,
- SkBitmap* icon, PromptType type);
-
// Implements the showing of the new install dialog. The implementations of
// this function are platform-specific.
static void ShowExtensionInstallUIPrompt2Impl(
diff --git a/chrome/browser/ui/cocoa/extensions/extension_install_prompt.mm b/chrome/browser/ui/cocoa/extensions/extension_install_prompt.mm
index 97530b1..21bb634 100644
--- a/chrome/browser/ui/cocoa/extensions/extension_install_prompt.mm
+++ b/chrome/browser/ui/cocoa/extensions/extension_install_prompt.mm
@@ -1,4 +1,4 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// 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.
@@ -8,7 +8,8 @@
#include "base/sys_string_conversions.h"
#include "base/utf_string_conversions.h"
-#include "chrome/browser/extensions/extension_install_ui.h"
+#include "chrome/browser/extensions/extension_install_dialog.h"
+#include "chrome/browser/profiles/profile.h"
#include "chrome/common/extensions/extension.h"
#include "grit/chromium_strings.h"
#include "grit/generated_resources.h"
@@ -16,14 +17,11 @@
#include "ui/base/l10n/l10n_util_mac.h"
#include "ui/base/resource/resource_bundle.h"
-class Profile;
-
-void ExtensionInstallUI::ShowExtensionInstallUIPromptImpl(
- Profile* profile,
- Delegate* delegate,
- const Extension* extension,
- SkBitmap* icon,
- ExtensionInstallUI::PromptType type) {
+void ShowExtensionInstallDialog(Profile* profile,
+ ExtensionInstallUI::Delegate* delegate,
+ const Extension* extension,
+ SkBitmap* icon,
+ ExtensionInstallUI::PromptType type) {
NSAlert* alert = [[[NSAlert alloc] init] autorelease];
NSButton* continueButton = [alert addButtonWithTitle:l10n_util::GetNSString(
diff --git a/chrome/browser/ui/gtk/extensions/extension_install_prompt_gtk.cc b/chrome/browser/ui/gtk/extensions/extension_install_prompt_gtk.cc
index 152dd343..9c56341 100644
--- a/chrome/browser/ui/gtk/extensions/extension_install_prompt_gtk.cc
+++ b/chrome/browser/ui/gtk/extensions/extension_install_prompt_gtk.cc
@@ -11,7 +11,7 @@
#include "base/utf_string_conversions.h"
#include "chrome/browser/browser_list.h"
#include "chrome/browser/browser_window.h"
-#include "chrome/browser/extensions/extension_install_ui.h"
+#include "chrome/browser/extensions/extension_install_dialog.h"
#include "chrome/browser/ui/gtk/browser_window_gtk.h"
#include "chrome/browser/ui/gtk/gtk_util.h"
#include "chrome/common/extensions/extension.h"
@@ -37,7 +37,8 @@ void OnResponse(GtkWidget* dialog, int response_id,
gtk_widget_destroy(dialog);
}
-void ShowInstallPromptDialog(GtkWindow* parent, SkBitmap* skia_icon,
+void ShowInstallPromptDialog(GtkWindow* parent,
+ SkBitmap* skia_icon,
const Extension* extension,
ExtensionInstallUI::Delegate *delegate,
ExtensionInstallUI::PromptType type) {
@@ -86,12 +87,11 @@ void ShowInstallPromptDialog(GtkWindow* parent, SkBitmap* skia_icon,
} // namespace
-void ExtensionInstallUI::ShowExtensionInstallUIPromptImpl(
- Profile* profile,
- Delegate* delegate,
- const Extension* extension,
- SkBitmap* icon,
- ExtensionInstallUI::PromptType type) {
+void ShowExtensionInstallDialog(Profile* profile,
+ ExtensionInstallUI::Delegate* delegate,
+ const Extension* extension,
+ SkBitmap* icon,
+ ExtensionInstallUI::PromptType type) {
Browser* browser = BrowserList::GetLastActiveWithProfile(profile);
if (!browser) {
delegate->InstallUIAbort();
diff --git a/chrome/browser/ui/views/extensions/extension_install_prompt.cc b/chrome/browser/ui/views/extensions/extension_install_prompt.cc
index 7b510b6..d29a243 100644
--- a/chrome/browser/ui/views/extensions/extension_install_prompt.cc
+++ b/chrome/browser/ui/views/extensions/extension_install_prompt.cc
@@ -7,7 +7,8 @@
#include "base/utf_string_conversions.h"
#include "chrome/browser/browser_list.h"
#include "chrome/browser/browser_window.h"
-#include "chrome/browser/extensions/extension_install_ui.h"
+#include "chrome/browser/extensions/extension_install_dialog.h"
+#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/views/window.h"
#include "chrome/common/extensions/extension.h"
#include "grit/generated_resources.h"
@@ -21,8 +22,6 @@
#include "views/window/dialog_delegate.h"
#include "views/window/window.h"
-class Profile;
-
namespace {
const int kRightColumnWidth = 210;
@@ -140,13 +139,11 @@ class InstallDialogContent : public views::View, public views::DialogDelegate {
} // namespace
-// static
-void ExtensionInstallUI::ShowExtensionInstallUIPromptImpl(
- Profile* profile,
- Delegate* delegate,
- const Extension* extension,
- SkBitmap* icon,
- PromptType type) {
+void ShowExtensionInstallDialog(Profile* profile,
+ ExtensionInstallUI::Delegate* delegate,
+ const Extension* extension,
+ SkBitmap* icon,
+ ExtensionInstallUI::PromptType type) {
Browser* browser = BrowserList::GetLastActiveWithProfile(profile);
if (!browser) {
delegate->InstallUIAbort();
@@ -160,6 +157,5 @@ void ExtensionInstallUI::ShowExtensionInstallUIPromptImpl(
}
browser::CreateViewsWindow(window->GetNativeHandle(), gfx::Rect(),
- new InstallDialogContent(delegate, extension, icon,
- type))->Show();
+ new InstallDialogContent(delegate, extension, icon, type))->Show();
}
diff --git a/chrome/chrome_browser.gypi b/chrome/chrome_browser.gypi
index 4f0f7f4..eae5c1c 100644
--- a/chrome/chrome_browser.gypi
+++ b/chrome/chrome_browser.gypi
@@ -950,6 +950,7 @@
'browser/extensions/extension_infobar_module_constants.h',
'browser/extensions/extension_input_api.cc',
'browser/extensions/extension_input_api.h',
+ 'browser/extensions/extension_install_dialog.h',
'browser/extensions/extension_install_ui.cc',
'browser/extensions/extension_install_ui.h',
'browser/extensions/extension_management_api.cc',