diff options
author | pkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-11-16 21:38:09 +0000 |
---|---|---|
committer | pkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-11-16 21:38:09 +0000 |
commit | 1a3efc6ae8008e83e1d5e909eac23fdb6600822a (patch) | |
tree | e254326ae052709f506e2721b6dd5a141a3a7a9d /chrome | |
parent | 5463d31cffd20790f569ae83ea5403a3d0aa6b7e (diff) | |
download | chromium_src-1a3efc6ae8008e83e1d5e909eac23fdb6600822a.zip chromium_src-1a3efc6ae8008e83e1d5e909eac23fdb6600822a.tar.gz chromium_src-1a3efc6ae8008e83e1d5e909eac23fdb6600822a.tar.bz2 |
Misc. cleanup
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/5034004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@66326 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/browser/extensions/theme_installed_infobar_delegate.cc | 39 | ||||
-rw-r--r-- | chrome/browser/translate/languages_menu_model.cc | 3 |
2 files changed, 16 insertions, 26 deletions
diff --git a/chrome/browser/extensions/theme_installed_infobar_delegate.cc b/chrome/browser/extensions/theme_installed_infobar_delegate.cc index ebfbe98..49f690c 100644 --- a/chrome/browser/extensions/theme_installed_infobar_delegate.cc +++ b/chrome/browser/extensions/theme_installed_infobar_delegate.cc @@ -19,7 +19,8 @@ #include "grit/theme_resources.h" ThemeInstalledInfoBarDelegate::ThemeInstalledInfoBarDelegate( - TabContents* tab_contents, const Extension* new_theme, + TabContents* tab_contents, + const Extension* new_theme, const std::string& previous_theme_id) : ConfirmInfoBarDelegate(tab_contents), profile_(tab_contents->profile()), @@ -51,8 +52,7 @@ string16 ThemeInstalledInfoBarDelegate::GetMessageText() 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); + return ResourceBundle::GetSharedInstance().GetBitmapNamed(IDR_INFOBAR_THEME); } ThemeInstalledInfoBarDelegate* @@ -66,15 +66,11 @@ int ThemeInstalledInfoBarDelegate::GetButtons() const { string16 ThemeInstalledInfoBarDelegate::GetButtonLabel( ConfirmInfoBarDelegate::InfoBarButton button) const { - switch (button) { - case BUTTON_CANCEL: { - return l10n_util::GetStringUTF16(IDS_THEME_INSTALL_INFOBAR_UNDO_BUTTON); - } - default: - // The InfoBar will create a default OK button and make it invisible. - // TODO(mirandac): remove the default OK button from ConfirmInfoBar. - return string16(); - } + // 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(); } bool ThemeInstalledInfoBarDelegate::Cancel() { @@ -98,19 +94,12 @@ void ThemeInstalledInfoBarDelegate::Observe( NotificationType type, const NotificationSource& source, const NotificationDetails& details) { - switch (type.value) { - case NotificationType::BROWSER_THEME_CHANGED: { - // If the new theme is different from what this info bar is associated - // with, close this info bar since it is no longer relevant. - const Extension* extension = Details<const Extension>(details).ptr(); - if (!extension || theme_id_ != extension->id()) - tab_contents_->RemoveInfoBar(this); - break; - } - - default: - NOTREACHED(); - } + DCHECK_EQ(NotificationType::BROWSER_THEME_CHANGED, type.value); + // If the new theme is different from what this info bar is associated + // with, close this info bar since it is no longer relevant. + const Extension* extension = Details<const Extension>(details).ptr(); + if (!extension || theme_id_ != extension->id()) + tab_contents_->RemoveInfoBar(this); } bool ThemeInstalledInfoBarDelegate::MatchesTheme(const Extension* theme) { diff --git a/chrome/browser/translate/languages_menu_model.cc b/chrome/browser/translate/languages_menu_model.cc index 544410e..e6934b5 100644 --- a/chrome/browser/translate/languages_menu_model.cc +++ b/chrome/browser/translate/languages_menu_model.cc @@ -34,7 +34,8 @@ bool LanguagesMenuModel::IsCommandIdEnabled(int command_id) const { } bool LanguagesMenuModel::GetAcceleratorForCommandId( - int command_id, menus::Accelerator* accelerator) { + int command_id, + menus::Accelerator* accelerator) { return false; } |