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

Unified Diff: chrome/browser/translate/translate_infobar_delegate.cc

Issue 15757010: Translate: style nits on r201807 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: nits Created 7 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
« no previous file with comments | « no previous file | chrome/browser/ui/gtk/infobars/after_translate_infobar_gtk.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/translate/translate_infobar_delegate.cc
diff --git a/chrome/browser/translate/translate_infobar_delegate.cc b/chrome/browser/translate/translate_infobar_delegate.cc
index 19290079016fe76be8dfa31b11ca844c2712929c..926eb38558b2d4f228339f4d0cd2410f89c9c9e5 100644
--- a/chrome/browser/translate/translate_infobar_delegate.cc
+++ b/chrome/browser/translate/translate_infobar_delegate.cc
@@ -294,25 +294,22 @@ void TranslateInfoBarDelegate::GetAfterTranslateStrings(
strings->push_back(text.substr(0, offset));
strings->push_back(text.substr(offset));
- } else {
- DCHECK(swap_languages);
+ return;
+ }
+ DCHECK(swap_languages);
- std::vector<size_t> offsets;
- string16 text = l10n_util::GetStringFUTF16(
- IDS_TRANSLATE_INFOBAR_AFTER_MESSAGE,
- string16(),
- string16(),
- &offsets);
- DCHECK_EQ(2U, offsets.size());
+ std::vector<size_t> offsets;
+ string16 text = l10n_util::GetStringFUTF16(
+ IDS_TRANSLATE_INFOBAR_AFTER_MESSAGE, string16(), string16(), &offsets);
+ DCHECK_EQ(2U, offsets.size());
- *swap_languages = (offsets[0] > offsets[1]);
- if (*swap_languages)
- std::swap(offsets[0], offsets[1]);
+ *swap_languages = (offsets[0] > offsets[1]);
+ if (*swap_languages)
+ std::swap(offsets[0], offsets[1]);
- strings->push_back(text.substr(0, offsets[0]));
- strings->push_back(text.substr(offsets[0], offsets[1] - offsets[0]));
- strings->push_back(text.substr(offsets[1]));
- }
+ strings->push_back(text.substr(0, offsets[0]));
+ strings->push_back(text.substr(offsets[0], offsets[1] - offsets[0]));
+ strings->push_back(text.substr(offsets[1]));
}
TranslateInfoBarDelegate::TranslateInfoBarDelegate(
« no previous file with comments | « no previous file | chrome/browser/ui/gtk/infobars/after_translate_infobar_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698