diff options
author | aa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-09 04:44:37 +0000 |
---|---|---|
committer | aa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-09 04:44:37 +0000 |
commit | 18b8d7c19768972e78211a05f0bbd680403533ae (patch) | |
tree | 9f11c676b8fc8d3c3f4007616c4f65c9be844116 /chrome/browser | |
parent | 336a193c20a33b8b4de6bbaf4df8de9e2966ad29 (diff) | |
download | chromium_src-18b8d7c19768972e78211a05f0bbd680403533ae.zip chromium_src-18b8d7c19768972e78211a05f0bbd680403533ae.tar.gz chromium_src-18b8d7c19768972e78211a05f0bbd680403533ae.tar.bz2 |
Revert r28519-28523. Accidentally used wrong command,
committing a bunch of local changes individually with
bad commit messages.
TBR=rafaelw@chromium.org
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@28525 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
-rw-r--r-- | chrome/browser/extensions/extension_install_ui.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.cc (renamed from chrome/browser/extensions/gtk_theme_installed_infobar_delegate.cc) | 10 | ||||
-rw-r--r-- | chrome/browser/extensions/gtk_theme_preview_infobar_delegate.h | 27 | ||||
-rw-r--r-- | chrome/browser/extensions/theme_preview_infobar_delegate.cc (renamed from chrome/browser/extensions/theme_installed_infobar_delegate.cc) | 23 | ||||
-rw-r--r-- | chrome/browser/extensions/theme_preview_infobar_delegate.h (renamed from chrome/browser/extensions/theme_installed_infobar_delegate.h) | 19 | ||||
-rw-r--r-- | chrome/browser/tab_contents/infobar_delegate.h | 6 |
7 files changed, 62 insertions, 62 deletions
diff --git a/chrome/browser/extensions/extension_install_ui.cc b/chrome/browser/extensions/extension_install_ui.cc index d044bf0..457dbad 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_installed_infobar_delegate.h" +#include "chrome/browser/extensions/theme_preview_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_installed_infobar_delegate.h" +#include "chrome/browser/extensions/gtk_theme_preview_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 GtkThemeInstalledInfoBarDelegate( + new GtkThemePreviewInfobarDelegate( tab_contents, new_theme->name(), previous_theme_id_, previous_use_gtk_theme_); #else - new ThemeInstalledInfoBarDelegate(tab_contents, - new_theme->name(), previous_theme_id_); + new ThemePreviewInfobarDelegate(tab_contents, + new_theme->name(), previous_theme_id_); #endif if (old_delegate) diff --git a/chrome/browser/extensions/gtk_theme_installed_infobar_delegate.h b/chrome/browser/extensions/gtk_theme_installed_infobar_delegate.h deleted file mode 100644 index 75ea2da..0000000 --- a/chrome/browser/extensions/gtk_theme_installed_infobar_delegate.h +++ /dev/null @@ -1,29 +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_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_installed_infobar_delegate.cc b/chrome/browser/extensions/gtk_theme_preview_infobar_delegate.cc index f964ca4..e577158 100644 --- a/chrome/browser/extensions/gtk_theme_installed_infobar_delegate.cc +++ b/chrome/browser/extensions/gtk_theme_preview_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_installed_infobar_delegate.h" +#include "chrome/browser/extensions/gtk_theme_preview_infobar_delegate.h" #include "chrome/browser/profile.h" -GtkThemeInstalledInfoBarDelegate::GtkThemeInstalledInfoBarDelegate( +GtkThemePreviewInfobarDelegate::GtkThemePreviewInfobarDelegate( TabContents* tab_contents, const std::string& name, const std::string& previous_theme, bool previous_use_gtk_theme) - : ThemeInstalledInfoBarDelegate(tab_contents, name, previous_theme), + : ThemePreviewInfobarDelegate(tab_contents, name, previous_theme), previous_use_gtk_theme_(previous_use_gtk_theme) { } -bool GtkThemeInstalledInfoBarDelegate::Cancel() { +bool GtkThemePreviewInfobarDelegate::Cancel() { if (previous_use_gtk_theme_) { profile()->SetNativeTheme(); return true; } else { - return ThemeInstalledInfoBarDelegate::Cancel(); + return ThemePreviewInfobarDelegate::Cancel(); } } diff --git a/chrome/browser/extensions/gtk_theme_preview_infobar_delegate.h b/chrome/browser/extensions/gtk_theme_preview_infobar_delegate.h new file mode 100644 index 0000000..cfc213de --- /dev/null +++ b/chrome/browser/extensions/gtk_theme_preview_infobar_delegate.h @@ -0,0 +1,27 @@ +// 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_installed_infobar_delegate.cc b/chrome/browser/extensions/theme_preview_infobar_delegate.cc index 2084548..06b8ed6 100644 --- a/chrome/browser/extensions/theme_installed_infobar_delegate.cc +++ b/chrome/browser/extensions/theme_preview_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_installed_infobar_delegate.h" +#include "chrome/browser/extensions/theme_preview_infobar_delegate.h" #include "app/l10n_util.h" #include "app/resource_bundle.h" @@ -14,41 +14,40 @@ #include "grit/generated_resources.h" #include "grit/theme_resources.h" -ThemeInstalledInfoBarDelegate::ThemeInstalledInfoBarDelegate( +ThemePreviewInfobarDelegate::ThemePreviewInfobarDelegate( 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 ThemeInstalledInfoBarDelegate::InfoBarClosed() { +void ThemePreviewInfobarDelegate::InfoBarClosed() { delete this; } -std::wstring ThemeInstalledInfoBarDelegate::GetMessageText() const { +std::wstring ThemePreviewInfobarDelegate::GetMessageText() const { return l10n_util::GetStringF(IDS_THEME_INSTALL_INFOBAR_LABEL, UTF8ToWide(name_)); } -SkBitmap* ThemeInstalledInfoBarDelegate::GetIcon() const { +SkBitmap* ThemePreviewInfobarDelegate::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); } -ThemeInstalledInfoBarDelegate* - ThemeInstalledInfoBarDelegate::AsThemePreviewInfobarDelegate() { +ThemePreviewInfobarDelegate* + ThemePreviewInfobarDelegate::AsThemePreviewInfobarDelegate() { return this; } -int ThemeInstalledInfoBarDelegate::GetButtons() const { +int ThemePreviewInfobarDelegate::GetButtons() const { return BUTTON_CANCEL; } -std::wstring ThemeInstalledInfoBarDelegate::GetButtonLabel( +std::wstring ThemePreviewInfobarDelegate::GetButtonLabel( ConfirmInfoBarDelegate::InfoBarButton button) const { switch (button) { case BUTTON_CANCEL: { @@ -59,7 +58,7 @@ std::wstring ThemeInstalledInfoBarDelegate::GetButtonLabel( } } -bool ThemeInstalledInfoBarDelegate::Cancel() { +bool ThemePreviewInfobarDelegate::Cancel() { if (!previous_theme_id_.empty()) { ExtensionsService* service = profile_->GetExtensionsService(); if (service) { diff --git a/chrome/browser/extensions/theme_installed_infobar_delegate.h b/chrome/browser/extensions/theme_preview_infobar_delegate.h index 594764a..fdffe07 100644 --- a/chrome/browser/extensions/theme_installed_infobar_delegate.h +++ b/chrome/browser/extensions/theme_preview_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_INSTALLED_INFOBAR_DELEGATE_H_ -#define CHROME_BROWSER_VIEWS_EXTENSIONS_THEME_INSTALLED_INFOBAR_DELEGATE_H_ +#ifndef CHROME_BROWSER_VIEWS_EXTENSIONS_THEME_PREVIEW_INFOBAR_DELEGATE_H_ +#define CHROME_BROWSER_VIEWS_EXTENSIONS_THEME_PREVIEW_INFOBAR_DELEGATE_H_ #include "chrome/browser/tab_contents/infobar_delegate.h" @@ -12,15 +12,18 @@ class TabContents; // When a user installs a theme, we display it immediately, but provide an // infobar allowing them to cancel. -class ThemeInstalledInfoBarDelegate : public ConfirmInfoBarDelegate { +// +// TODO(aa): Rename this to ThemeInstalledInfoBarDelegate, since it isn't +// used for previewing anymore. +class ThemePreviewInfobarDelegate : public ConfirmInfoBarDelegate { public: - ThemeInstalledInfoBarDelegate(TabContents* tab_contents, - const std::string& name, - const std::string& previous_theme); + ThemePreviewInfobarDelegate(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 ThemeInstalledInfoBarDelegate* AsThemePreviewInfobarDelegate(); + virtual ThemePreviewInfobarDelegate* AsThemePreviewInfobarDelegate(); virtual int GetButtons() const; virtual std::wstring GetButtonLabel( ConfirmInfoBarDelegate::InfoBarButton button) const; @@ -35,4 +38,4 @@ class ThemeInstalledInfoBarDelegate : public ConfirmInfoBarDelegate { std::string previous_theme_id_; // used to undo theme install }; -#endif // CHROME_BROWSER_VIEWS_EXTENSIONS_THEME_INSTALLED_INFOBAR_DELEGATE_H_ +#endif // CHROME_BROWSER_VIEWS_EXTENSIONS_THEME_PREVIEW_INFOBAR_DELEGATE_H_ diff --git a/chrome/browser/tab_contents/infobar_delegate.h b/chrome/browser/tab_contents/infobar_delegate.h index 8079fba..569ad1d 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 ThemeInstalledInfoBarDelegate; +class ThemePreviewInfobarDelegate; // 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 ThemeInstalledInfoBarDelegate interface, if + // Returns a pointer to the ThemePreviewInfobarDelegate interface, if // implemented. - virtual ThemeInstalledInfoBarDelegate* AsThemePreviewInfobarDelegate() { + virtual ThemePreviewInfobarDelegate* AsThemePreviewInfobarDelegate() { return NULL; } |