diff options
author | aa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-09 20:52:48 +0000 |
---|---|---|
committer | aa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-09 20:52:48 +0000 |
commit | 47e4c8793c51d873957c3b6329d020c99f83d1d7 (patch) | |
tree | 7f90483b47327021110fcbbe2d907c3cb8c2e343 | |
parent | c10d60b4194cab3f68da71e0270647c02d000146 (diff) | |
download | chromium_src-47e4c8793c51d873957c3b6329d020c99f83d1d7.zip chromium_src-47e4c8793c51d873957c3b6329d020c99f83d1d7.tar.gz chromium_src-47e4c8793c51d873957c3b6329d020c99f83d1d7.tar.bz2 |
Reland: Rename ThemePreviewInfobarDelegate to
ThemeInstalledInfoBarDelegate
Contributed by Thiago Farina <tfarina@gmail.com>
TBR=rafaelw@chromium.org
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@28595 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/extensions/extension_install_ui.cc | 10 | ||||
-rw-r--r-- | chrome/browser/extensions/gtk_theme_installed_infobar_delegate.cc (renamed from chrome/browser/extensions/gtk_theme_preview_infobar_delegate.cc) | 10 | ||||
-rw-r--r-- | chrome/browser/extensions/gtk_theme_installed_infobar_delegate.h | 29 | ||||
-rw-r--r-- | chrome/browser/extensions/gtk_theme_preview_infobar_delegate.h | 27 | ||||
-rw-r--r-- | chrome/browser/extensions/theme_installed_infobar_delegate.cc (renamed from chrome/browser/extensions/theme_preview_infobar_delegate.cc) | 23 | ||||
-rw-r--r-- | chrome/browser/extensions/theme_installed_infobar_delegate.h (renamed from chrome/browser/extensions/theme_preview_infobar_delegate.h) | 19 | ||||
-rw-r--r-- | chrome/browser/tab_contents/infobar_delegate.h | 6 | ||||
-rwxr-xr-x | chrome/chrome.gyp | 8 |
8 files changed, 66 insertions, 66 deletions
diff --git a/chrome/browser/extensions/extension_install_ui.cc b/chrome/browser/extensions/extension_install_ui.cc index 457dbad..d044bf0 100644 --- a/chrome/browser/extensions/extension_install_ui.cc +++ b/chrome/browser/extensions/extension_install_ui.cc @@ -12,7 +12,7 @@ #include "base/rand_util.h" #include "chrome/browser/browser_list.h" #include "chrome/browser/browser_window.h" -#include "chrome/browser/extensions/theme_preview_infobar_delegate.h" +#include "chrome/browser/extensions/theme_installed_infobar_delegate.h" #include "chrome/browser/profile.h" #include "chrome/browser/tab_contents/tab_contents.h" #include "chrome/common/extensions/extension.h" @@ -27,7 +27,7 @@ #include "base/sys_string_conversions.h" #include <CoreFoundation/CFUserNotification.h> #elif defined(TOOLKIT_GTK) -#include "chrome/browser/extensions/gtk_theme_preview_infobar_delegate.h" +#include "chrome/browser/extensions/gtk_theme_installed_infobar_delegate.h" #include "chrome/browser/gtk/gtk_theme_provider.h" #endif @@ -231,12 +231,12 @@ void ExtensionInstallUI::ShowThemeInfoBar(Extension* new_theme) { // Then either replace that old one or add a new one. InfoBarDelegate* new_delegate = #if defined(TOOLKIT_GTK) - new GtkThemePreviewInfobarDelegate( + new GtkThemeInstalledInfoBarDelegate( tab_contents, new_theme->name(), previous_theme_id_, previous_use_gtk_theme_); #else - new ThemePreviewInfobarDelegate(tab_contents, - new_theme->name(), previous_theme_id_); + new ThemeInstalledInfoBarDelegate(tab_contents, + new_theme->name(), previous_theme_id_); #endif if (old_delegate) diff --git a/chrome/browser/extensions/gtk_theme_preview_infobar_delegate.cc b/chrome/browser/extensions/gtk_theme_installed_infobar_delegate.cc index e577158..f964ca4 100644 --- a/chrome/browser/extensions/gtk_theme_preview_infobar_delegate.cc +++ b/chrome/browser/extensions/gtk_theme_installed_infobar_delegate.cc @@ -2,24 +2,24 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chrome/browser/extensions/gtk_theme_preview_infobar_delegate.h" +#include "chrome/browser/extensions/gtk_theme_installed_infobar_delegate.h" #include "chrome/browser/profile.h" -GtkThemePreviewInfobarDelegate::GtkThemePreviewInfobarDelegate( +GtkThemeInstalledInfoBarDelegate::GtkThemeInstalledInfoBarDelegate( TabContents* tab_contents, const std::string& name, const std::string& previous_theme, bool previous_use_gtk_theme) - : ThemePreviewInfobarDelegate(tab_contents, name, previous_theme), + : ThemeInstalledInfoBarDelegate(tab_contents, name, previous_theme), previous_use_gtk_theme_(previous_use_gtk_theme) { } -bool GtkThemePreviewInfobarDelegate::Cancel() { +bool GtkThemeInstalledInfoBarDelegate::Cancel() { if (previous_use_gtk_theme_) { profile()->SetNativeTheme(); return true; } else { - return ThemePreviewInfobarDelegate::Cancel(); + return ThemeInstalledInfoBarDelegate::Cancel(); } } diff --git a/chrome/browser/extensions/gtk_theme_installed_infobar_delegate.h b/chrome/browser/extensions/gtk_theme_installed_infobar_delegate.h new file mode 100644 index 0000000..75ea2da --- /dev/null +++ b/chrome/browser/extensions/gtk_theme_installed_infobar_delegate.h @@ -0,0 +1,29 @@ +// Copyright (c) 2009 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_VIEWS_EXTENSIONS_GTK_THEME_INSTALLED_INFOBAR_DELEGATE_H_ +#define CHROME_BROWSER_VIEWS_EXTENSIONS_GTK_THEME_INSTALLED_INFOBAR_DELEGATE_H_ + +#include "chrome/browser/extensions/theme_installed_infobar_delegate.h" + +#include <string> + +class SkBitmap; +class TabContents; + +// A specialization of ThemeInstalledInfoBarDelegate to make "Undo" reset to the +// GTK theme if the user was in GTK theme mode before installing the theme. +class GtkThemeInstalledInfoBarDelegate : public ThemeInstalledInfoBarDelegate { + public: + GtkThemeInstalledInfoBarDelegate(TabContents* tab_contents, + const std::string& name, + const std::string& previous_theme, + bool previous_use_gtk_theme); + virtual bool Cancel(); + + private: + bool previous_use_gtk_theme_; +}; + +#endif // CHROME_BROWSER_VIEWS_EXTENSIONS_GTK_THEME_INSTALLED_INFOBAR_DELEGATE_H_ diff --git a/chrome/browser/extensions/gtk_theme_preview_infobar_delegate.h b/chrome/browser/extensions/gtk_theme_preview_infobar_delegate.h deleted file mode 100644 index cfc213de..0000000 --- a/chrome/browser/extensions/gtk_theme_preview_infobar_delegate.h +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) 2009 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_VIEWS_EXTENSIONS_GTK_THEME_PREVIEW_INFOBAR_DELEGATE_H_ -#define CHROME_BROWSER_VIEWS_EXTENSIONS_GTK_THEME_PREVIEW_INFOBAR_DELEGATE_H_ - -#include "chrome/browser/extensions/theme_preview_infobar_delegate.h" - -class SkBitmap; -class TabContents; - -// A specialization of ThemePreviewInfobarDelegate to make "Undo" reset to the -// GTK theme if the user was in GTK theme mode before installing the theme. -class GtkThemePreviewInfobarDelegate : public ThemePreviewInfobarDelegate { - public: - GtkThemePreviewInfobarDelegate(TabContents* tab_contents, - const std::string& name, - const std::string& previous_theme, - bool previous_use_gtk_theme); - virtual bool Cancel(); - - private: - bool previous_use_gtk_theme_; -}; - -#endif // CHROME_BROWSER_VIEWS_EXTENSIONS_GTK_THEME_PREVIEW_INFOBAR_DELEGATE_H_ diff --git a/chrome/browser/extensions/theme_preview_infobar_delegate.cc b/chrome/browser/extensions/theme_installed_infobar_delegate.cc index 06b8ed6..2084548 100644 --- a/chrome/browser/extensions/theme_preview_infobar_delegate.cc +++ b/chrome/browser/extensions/theme_installed_infobar_delegate.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chrome/browser/extensions/theme_preview_infobar_delegate.h" +#include "chrome/browser/extensions/theme_installed_infobar_delegate.h" #include "app/l10n_util.h" #include "app/resource_bundle.h" @@ -14,40 +14,41 @@ #include "grit/generated_resources.h" #include "grit/theme_resources.h" -ThemePreviewInfobarDelegate::ThemePreviewInfobarDelegate( +ThemeInstalledInfoBarDelegate::ThemeInstalledInfoBarDelegate( TabContents* tab_contents, const std::string& name, const std::string& previous_theme_id) : ConfirmInfoBarDelegate(tab_contents), - profile_(tab_contents->profile()), name_(name), + profile_(tab_contents->profile()), + name_(name), previous_theme_id_(previous_theme_id) { } -void ThemePreviewInfobarDelegate::InfoBarClosed() { +void ThemeInstalledInfoBarDelegate::InfoBarClosed() { delete this; } -std::wstring ThemePreviewInfobarDelegate::GetMessageText() const { +std::wstring ThemeInstalledInfoBarDelegate::GetMessageText() const { return l10n_util::GetStringF(IDS_THEME_INSTALL_INFOBAR_LABEL, UTF8ToWide(name_)); } -SkBitmap* ThemePreviewInfobarDelegate::GetIcon() const { +SkBitmap* ThemeInstalledInfoBarDelegate::GetIcon() const { // TODO(aa): Reply with the theme's icon, but this requires reading it // asynchronously from disk. return ResourceBundle::GetSharedInstance().GetBitmapNamed( IDR_INFOBAR_THEME); } -ThemePreviewInfobarDelegate* - ThemePreviewInfobarDelegate::AsThemePreviewInfobarDelegate() { +ThemeInstalledInfoBarDelegate* + ThemeInstalledInfoBarDelegate::AsThemePreviewInfobarDelegate() { return this; } -int ThemePreviewInfobarDelegate::GetButtons() const { +int ThemeInstalledInfoBarDelegate::GetButtons() const { return BUTTON_CANCEL; } -std::wstring ThemePreviewInfobarDelegate::GetButtonLabel( +std::wstring ThemeInstalledInfoBarDelegate::GetButtonLabel( ConfirmInfoBarDelegate::InfoBarButton button) const { switch (button) { case BUTTON_CANCEL: { @@ -58,7 +59,7 @@ std::wstring ThemePreviewInfobarDelegate::GetButtonLabel( } } -bool ThemePreviewInfobarDelegate::Cancel() { +bool ThemeInstalledInfoBarDelegate::Cancel() { if (!previous_theme_id_.empty()) { ExtensionsService* service = profile_->GetExtensionsService(); if (service) { diff --git a/chrome/browser/extensions/theme_preview_infobar_delegate.h b/chrome/browser/extensions/theme_installed_infobar_delegate.h index fdffe07..594764a 100644 --- a/chrome/browser/extensions/theme_preview_infobar_delegate.h +++ b/chrome/browser/extensions/theme_installed_infobar_delegate.h @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CHROME_BROWSER_VIEWS_EXTENSIONS_THEME_PREVIEW_INFOBAR_DELEGATE_H_ -#define CHROME_BROWSER_VIEWS_EXTENSIONS_THEME_PREVIEW_INFOBAR_DELEGATE_H_ +#ifndef CHROME_BROWSER_VIEWS_EXTENSIONS_THEME_INSTALLED_INFOBAR_DELEGATE_H_ +#define CHROME_BROWSER_VIEWS_EXTENSIONS_THEME_INSTALLED_INFOBAR_DELEGATE_H_ #include "chrome/browser/tab_contents/infobar_delegate.h" @@ -12,18 +12,15 @@ class TabContents; // When a user installs a theme, we display it immediately, but provide an // infobar allowing them to cancel. -// -// TODO(aa): Rename this to ThemeInstalledInfoBarDelegate, since it isn't -// used for previewing anymore. -class ThemePreviewInfobarDelegate : public ConfirmInfoBarDelegate { +class ThemeInstalledInfoBarDelegate : public ConfirmInfoBarDelegate { public: - ThemePreviewInfobarDelegate(TabContents* tab_contents, - const std::string& name, - const std::string& previous_theme); + ThemeInstalledInfoBarDelegate(TabContents* tab_contents, + const std::string& name, + const std::string& previous_theme); virtual void InfoBarClosed(); virtual std::wstring GetMessageText() const; virtual SkBitmap* GetIcon() const; - virtual ThemePreviewInfobarDelegate* AsThemePreviewInfobarDelegate(); + virtual ThemeInstalledInfoBarDelegate* AsThemePreviewInfobarDelegate(); virtual int GetButtons() const; virtual std::wstring GetButtonLabel( ConfirmInfoBarDelegate::InfoBarButton button) const; @@ -38,4 +35,4 @@ class ThemePreviewInfobarDelegate : public ConfirmInfoBarDelegate { std::string previous_theme_id_; // used to undo theme install }; -#endif // CHROME_BROWSER_VIEWS_EXTENSIONS_THEME_PREVIEW_INFOBAR_DELEGATE_H_ +#endif // CHROME_BROWSER_VIEWS_EXTENSIONS_THEME_INSTALLED_INFOBAR_DELEGATE_H_ diff --git a/chrome/browser/tab_contents/infobar_delegate.h b/chrome/browser/tab_contents/infobar_delegate.h index 569ad1d..8079fba 100644 --- a/chrome/browser/tab_contents/infobar_delegate.h +++ b/chrome/browser/tab_contents/infobar_delegate.h @@ -16,7 +16,7 @@ class AlertInfoBarDelegate; class ConfirmInfoBarDelegate; class InfoBar; class LinkInfoBarDelegate; -class ThemePreviewInfobarDelegate; +class ThemeInstalledInfoBarDelegate; // An interface implemented by objects wishing to control an InfoBar. // Implementing this interface is not sufficient to use an InfoBar, since it @@ -96,9 +96,9 @@ class InfoBarDelegate { return NULL; } - // Returns a pointer to the ThemePreviewInfobarDelegate interface, if + // Returns a pointer to the ThemeInstalledInfoBarDelegate interface, if // implemented. - virtual ThemePreviewInfobarDelegate* AsThemePreviewInfobarDelegate() { + virtual ThemeInstalledInfoBarDelegate* AsThemePreviewInfobarDelegate() { return NULL; } diff --git a/chrome/chrome.gyp b/chrome/chrome.gyp index a2cfd42..0120dc2 100755 --- a/chrome/chrome.gyp +++ b/chrome/chrome.gyp @@ -1313,16 +1313,16 @@ 'browser/extensions/external_pref_extension_provider.h', 'browser/extensions/file_reader.cc', 'browser/extensions/file_reader.h', - 'browser/extensions/gtk_theme_preview_infobar_delegate.cc', - 'browser/extensions/gtk_theme_preview_infobar_delegate.h', + 'browser/extensions/gtk_theme_installed_infobar_delegate.cc', + 'browser/extensions/gtk_theme_installed_infobar_delegate.h', 'browser/extensions/image_loading_tracker.cc', 'browser/extensions/image_loading_tracker.h', 'browser/extensions/pack_extension_job.cc', 'browser/extensions/pack_extension_job.h', 'browser/extensions/sandboxed_extension_unpacker.cc', 'browser/extensions/sandboxed_extension_unpacker.h', - 'browser/extensions/theme_preview_infobar_delegate.cc', - 'browser/extensions/theme_preview_infobar_delegate.h', + 'browser/extensions/theme_installed_infobar_delegate.cc', + 'browser/extensions/theme_installed_infobar_delegate.h', 'browser/extensions/user_script_listener.cc', 'browser/extensions/user_script_listener.h', 'browser/extensions/user_script_master.cc', |