Chromium Code Reviews
[email protected] (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3)

Unified Diff: chrome/browser/extensions/theme_installed_infobar_delegate.cc

Issue 6249010: Cleanup: de-inline a bunch of classes, rename and move "PluginInstaller" to "... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/extensions/theme_installed_infobar_delegate.cc
===================================================================
--- chrome/browser/extensions/theme_installed_infobar_delegate.cc (revision 72158)
+++ chrome/browser/extensions/theme_installed_infobar_delegate.cc (working copy)
@@ -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.
@@ -33,6 +33,10 @@
NotificationService::AllSources());
}
+bool ThemeInstalledInfoBarDelegate::MatchesTheme(const Extension* theme) {
+ return theme && (theme->id() == theme_id_);
+}
+
ThemeInstalledInfoBarDelegate::~ThemeInstalledInfoBarDelegate() {
// We don't want any notifications while we're running our destructor.
registrar_.RemoveAll();
@@ -40,15 +44,27 @@
profile_->GetThemeProvider()->OnInfobarDestroyed();
}
+bool ThemeInstalledInfoBarDelegate::Cancel() {
+ if (!previous_theme_id_.empty()) {
+ ExtensionService* service = profile_->GetExtensionService();
+ if (service) {
+ const Extension* previous_theme =
+ service->GetExtensionById(previous_theme_id_, true);
+ if (previous_theme) {
+ profile_->SetTheme(previous_theme);
+ return true;
+ }
+ }
+ }
+
+ profile_->ClearTheme();
+ return true;
+}
+
void ThemeInstalledInfoBarDelegate::InfoBarClosed() {
delete this;
}
-string16 ThemeInstalledInfoBarDelegate::GetMessageText() const {
- return l10n_util::GetStringFUTF16(IDS_THEME_INSTALL_INFOBAR_LABEL,
- UTF8ToUTF16(name_));
-}
-
SkBitmap* ThemeInstalledInfoBarDelegate::GetIcon() const {
// TODO(aa): Reply with the theme's icon, but this requires reading it
// asynchronously from disk.
@@ -60,36 +76,21 @@
return this;
}
+string16 ThemeInstalledInfoBarDelegate::GetMessageText() const {
+ return l10n_util::GetStringFUTF16(IDS_THEME_INSTALL_INFOBAR_LABEL,
+ UTF8ToUTF16(name_));
+}
+
int ThemeInstalledInfoBarDelegate::GetButtons() const {
return BUTTON_CANCEL;
}
string16 ThemeInstalledInfoBarDelegate::GetButtonLabel(
- ConfirmInfoBarDelegate::InfoBarButton button) const {
- // The InfoBar will create a default OK button and make it invisible.
- // TODO(mirandac): remove the default OK button from ConfirmInfoBar.
- return (button == BUTTON_CANCEL) ?
- l10n_util::GetStringUTF16(IDS_THEME_INSTALL_INFOBAR_UNDO_BUTTON) :
- string16();
+ InfoBarButton button) const {
+ DCHECK_EQ(BUTTON_CANCEL, button);
+ return l10n_util::GetStringUTF16(IDS_THEME_INSTALL_INFOBAR_UNDO_BUTTON);
}
-bool ThemeInstalledInfoBarDelegate::Cancel() {
- if (!previous_theme_id_.empty()) {
- ExtensionService* service = profile_->GetExtensionService();
- if (service) {
- const Extension* previous_theme =
- service->GetExtensionById(previous_theme_id_, true);
- if (previous_theme) {
- profile_->SetTheme(previous_theme);
- return true;
- }
- }
- }
-
- profile_->ClearTheme();
- return true;
-}
-
void ThemeInstalledInfoBarDelegate::Observe(
NotificationType type,
const NotificationSource& source,
@@ -115,7 +116,3 @@
}
}
}
-
-bool ThemeInstalledInfoBarDelegate::MatchesTheme(const Extension* theme) {
- return (theme && theme->id() == theme_id_);
-}
« no previous file with comments | « chrome/browser/extensions/theme_installed_infobar_delegate.h ('k') | chrome/browser/external_tab_container_win.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698