summaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorjcivelli@chromium.org <jcivelli@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-09 20:23:15 +0000
committerjcivelli@chromium.org <jcivelli@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-09 20:23:15 +0000
commite88079e395bf606c55e746bd618414abbcc6bc31 (patch)
tree83088d953b0c9cf512ebb62f89ffcbb605cc2416 /app
parent76b2ad7e89d95b6b3934563cf625dfc493fca4c5 (diff)
downloadchromium_src-e88079e395bf606c55e746bd618414abbcc6bc31.zip
chromium_src-e88079e395bf606c55e746bd618414abbcc6bc31.tar.gz
chromium_src-e88079e395bf606c55e746bd618414abbcc6bc31.tar.bz2
Refactored the translate infobars.
Since some work is needed on Linux and Mac to use the new translate infobar delegate, I created a new version of the refactored classes instead of replacing them. Once Linux and Mac use the new classes, we can make the swicth. The TranslateInfoBarDelegate now contains all states, so there is no more logic on the infobar classes. I broke down the single infobar class into multiple ones (there is now an infobar for each state: before translate, translating, after translate, error): it makes the code simpler. I had to fix ReplaceInfoBar on Windows as it was not working properly. BUG=40828 TEST=Test thoroughly the translate feature. Review URL: http://codereview.chromium.org/2602003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@49307 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'app')
-rw-r--r--app/l10n_util.cc9
-rw-r--r--app/l10n_util.h3
2 files changed, 12 insertions, 0 deletions
diff --git a/app/l10n_util.cc b/app/l10n_util.cc
index d1c53f1..e50bbb8 100644
--- a/app/l10n_util.cc
+++ b/app/l10n_util.cc
@@ -648,6 +648,15 @@ std::wstring GetStringF(int message_id,
string16(), string16(), offsets));
}
+string16 GetStringFUTF16(int message_id, const string16& a, size_t* offset) {
+ DCHECK(offset);
+ std::vector<size_t> offsets;
+ string16 result = GetStringFUTF16(message_id, a, string16(), &offsets);
+ DCHECK(offsets.size() == 1);
+ *offset = offsets[0];
+ return result;
+}
+
string16 GetStringFUTF16(int message_id,
const string16& a,
const string16& b,
diff --git a/app/l10n_util.h b/app/l10n_util.h
index e0100c0..df820ba 100644
--- a/app/l10n_util.h
+++ b/app/l10n_util.h
@@ -149,6 +149,9 @@ std::wstring GetStringF(int message_id,
const std::wstring& b,
std::vector<size_t>* offsets);
string16 GetStringFUTF16(int message_id,
+ const string16& a,
+ size_t* offset);
+string16 GetStringFUTF16(int message_id,
const string16& a,
const string16& b,
std::vector<size_t>* offsets);