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

Unified Diff: chrome/browser/ui/views/infobars/after_translate_infobar.cc

Issue 7006010: Change InfoBar-related notifications to be sourced from a TabContentsWrapper, not a TabContents. ... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 7 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/ui/views/infobars/after_translate_infobar.cc
===================================================================
--- chrome/browser/ui/views/infobars/after_translate_infobar.cc (revision 87541)
+++ chrome/browser/ui/views/infobars/after_translate_infobar.cc (working copy)
@@ -148,13 +148,21 @@
}
void AfterTranslateInfoBar::OriginalLanguageChanged() {
- UpdateLanguageButtonText(original_language_menu_button_,
- LanguagesMenuModel::ORIGINAL);
+ // Tests can call this function when the infobar has never been added to a
+ // view hierarchy and thus there is no button.
+ if (original_language_menu_button_) {
+ UpdateLanguageButtonText(original_language_menu_button_,
+ LanguagesMenuModel::ORIGINAL);
+ }
}
void AfterTranslateInfoBar::TargetLanguageChanged() {
- UpdateLanguageButtonText(target_language_menu_button_,
- LanguagesMenuModel::TARGET);
+ // Tests can call this function when the infobar has never been added to a
+ // view hierarchy and thus there is no button.
+ if (target_language_menu_button_) {
+ UpdateLanguageButtonText(target_language_menu_button_,
+ LanguagesMenuModel::TARGET);
+ }
}
void AfterTranslateInfoBar::RunMenu(View* source, const gfx::Point& pt) {
« no previous file with comments | « chrome/browser/ui/tab_contents/tab_contents_wrapper.cc ('k') | chrome/browser/ui/views/infobars/before_translate_infobar.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698