Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5215)

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

Issue 5034004: Misc. cleanup (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 10 years, 1 month 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
« no previous file with comments | « no previous file | chrome/browser/translate/languages_menu_model.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/theme_installed_infobar_delegate.cc
===================================================================
--- chrome/browser/extensions/theme_installed_infobar_delegate.cc (revision 65711)
+++ chrome/browser/extensions/theme_installed_infobar_delegate.cc (working copy)
@@ -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 @@
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 @@
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 @@
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) {
« no previous file with comments | « no previous file | chrome/browser/translate/languages_menu_model.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698