diff options
author | tfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-22 22:50:57 +0000 |
---|---|---|
committer | tfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-22 22:50:57 +0000 |
commit | a0b4d97b94020a7f41008cfc06e2724799c281e8 (patch) | |
tree | 681bd5021d7cf017c8ac66b3b4f400ba73370133 /chrome/browser | |
parent | 9c95cbe021637350c22696997c83cd60e9fce830 (diff) | |
download | chromium_src-a0b4d97b94020a7f41008cfc06e2724799c281e8.zip chromium_src-a0b4d97b94020a7f41008cfc06e2724799c281e8.tar.gz chromium_src-a0b4d97b94020a7f41008cfc06e2724799c281e8.tar.bz2 |
extensions: Introduce ShowExtensionInstallDialog2 function.
This is to start cleanning up the ExtensionInstallUI class.
BUG=66730
TEST=None
R=aa@chromium.org
Review URL: http://codereview.chromium.org/6680020
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@79060 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
6 files changed, 42 insertions, 23 deletions
diff --git a/chrome/browser/extensions/extension_install_dialog2.h b/chrome/browser/extensions/extension_install_dialog2.h new file mode 100644 index 0000000..6afadd2 --- /dev/null +++ b/chrome/browser/extensions/extension_install_dialog2.h @@ -0,0 +1,26 @@ +// 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_DIALOG2_H_ +#define CHROME_BROWSER_EXTENSIONS_EXTENSION_INSTALL_DIALOG2_H_ +#pragma once + +#include <vector> + +#include "base/string16.h" +#include "chrome/browser/extensions/extension_install_ui.h" + +class Extension; +class Profile; +class SkBitmap; + +// The implementations of this function are platform-specific. +void ShowExtensionInstallDialog2(Profile* profile, + ExtensionInstallUI::Delegate* delegate, + const Extension* extension, + SkBitmap* icon, + const std::vector<string16>& permissions, + ExtensionInstallUI::PromptType type); + +#endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_INSTALL_DIALOG2_H_ diff --git a/chrome/browser/extensions/extension_install_ui.cc b/chrome/browser/extensions/extension_install_ui.cc index cfe4925..ec50d16 100644 --- a/chrome/browser/extensions/extension_install_ui.cc +++ b/chrome/browser/extensions/extension_install_ui.cc @@ -15,6 +15,7 @@ #include "chrome/browser/browser_list.h" #include "chrome/browser/browser_window.h" #include "chrome/browser/extensions/extension_install_dialog.h" +#include "chrome/browser/extensions/extension_install_dialog2.h" #include "chrome/browser/extensions/theme_installed_infobar_delegate.h" #include "chrome/browser/platform_util.h" #include "chrome/browser/profiles/profile.h" @@ -225,8 +226,8 @@ void ExtensionInstallUI::OnImageLoaded( NotificationService::NoDetails()); std::vector<string16> warnings = extension_->GetPermissionMessages(); - ShowExtensionInstallUIPrompt2Impl(profile_, delegate_, extension_, &icon_, - warnings, prompt_type_); + ShowExtensionInstallDialog2( + profile_, delegate_, extension_, &icon_, warnings, prompt_type_); break; } case UNINSTALL_PROMPT: { diff --git a/chrome/browser/extensions/extension_install_ui.h b/chrome/browser/extensions/extension_install_ui.h index bada942..0b4b968 100644 --- a/chrome/browser/extensions/extension_install_ui.h +++ b/chrome/browser/extensions/extension_install_ui.h @@ -112,13 +112,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 new install dialog. The implementations of - // this function are platform-specific. - static void ShowExtensionInstallUIPrompt2Impl( - Profile* profile, Delegate* delegate, const Extension* extension, - SkBitmap* icon, const std::vector<string16>& permissions, - PromptType type); - Profile* profile_; MessageLoop* ui_loop_; diff --git a/chrome/browser/ui/cocoa/extensions/extension_install_prompt_controller.mm b/chrome/browser/ui/cocoa/extensions/extension_install_prompt_controller.mm index 84ca937..3f2b74b 100644 --- a/chrome/browser/ui/cocoa/extensions/extension_install_prompt_controller.mm +++ b/chrome/browser/ui/cocoa/extensions/extension_install_prompt_controller.mm @@ -8,6 +8,7 @@ #include "base/string_util.h" #include "base/sys_string_conversions.h" #include "base/utf_string_conversions.h" +#include "chrome/browser/extensions/extension_install_dialog2.h" #include "chrome/browser/ui/browser.h" #include "chrome/browser/ui/browser_list.h" #include "chrome/browser/ui/browser_window.h" @@ -191,10 +192,9 @@ void OffsetControlVertically(NSControl* control, CGFloat amount) { @end // ExtensionInstallPromptController - -void ExtensionInstallUI::ShowExtensionInstallUIPrompt2Impl( +void ShowExtensionInstallDialog2( Profile* profile, - Delegate* delegate, + ExtensionInstallUI::Delegate* delegate, const Extension* extension, SkBitmap* icon, const std::vector<string16>& warnings, diff --git a/chrome/browser/ui/gtk/extensions/extension_install_prompt2_gtk.cc b/chrome/browser/ui/gtk/extensions/extension_install_prompt2_gtk.cc index 4d2c376..1cd0ade 100644 --- a/chrome/browser/ui/gtk/extensions/extension_install_prompt2_gtk.cc +++ b/chrome/browser/ui/gtk/extensions/extension_install_prompt2_gtk.cc @@ -8,7 +8,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_dialog2.h" +#include "chrome/browser/profiles/profile.h" #include "chrome/browser/ui/gtk/browser_window_gtk.h" #include "chrome/browser/ui/gtk/gtk_util.h" #include "chrome/common/extensions/extension.h" @@ -17,8 +18,6 @@ #include "ui/base/l10n/l10n_util.h" #include "ui/gfx/gtk_util.h" -class Profile; - namespace { const int kRightColumnMinWidth = 290; @@ -170,9 +169,9 @@ void ShowInstallPromptDialog2(GtkWindow* parent, SkBitmap* skia_icon, } // namespace -void ExtensionInstallUI::ShowExtensionInstallUIPrompt2Impl( +void ShowExtensionInstallDialog2( Profile* profile, - Delegate* delegate, + ExtensionInstallUI::Delegate* delegate, const Extension* extension, SkBitmap* icon, const std::vector<string16>& permissions, diff --git a/chrome/browser/ui/views/extensions/extension_install_prompt2.cc b/chrome/browser/ui/views/extensions/extension_install_prompt2.cc index 7187802..8783805 100644 --- a/chrome/browser/ui/views/extensions/extension_install_prompt2.cc +++ b/chrome/browser/ui/views/extensions/extension_install_prompt2.cc @@ -6,7 +6,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_dialog2.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" @@ -18,8 +19,6 @@ #include "views/window/dialog_delegate.h" #include "views/window/window.h" -class Profile; - namespace { // Size of extension icon in top left of dialog. @@ -306,9 +305,10 @@ void InstallDialogContent2::Layout() { right_column_width_, permission_box_height); } -// static -void ExtensionInstallUI::ShowExtensionInstallUIPrompt2Impl( - Profile* profile, Delegate* delegate, const Extension* extension, +void ShowExtensionInstallDialog2( + Profile* profile, + ExtensionInstallUI::Delegate* delegate, + const Extension* extension, SkBitmap* icon, const std::vector<string16>& permissions, ExtensionInstallUI::PromptType type) { |