summaryrefslogtreecommitdiffstats
path: root/chrome/browser/cocoa/translate/translate_infobar_base.mm
diff options
context:
space:
mode:
authorjcivelli@chromium.org <jcivelli@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-21 18:30:05 +0000
committerjcivelli@chromium.org <jcivelli@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-21 18:30:05 +0000
commit59efee1132427f4610125f2933992b5952783b26 (patch)
tree0dc78d7c15a9dff63597422d5d230c935f394185 /chrome/browser/cocoa/translate/translate_infobar_base.mm
parent6b77976f7ebe04fd91ccbaf5bfd77c5a9065c518 (diff)
downloadchromium_src-59efee1132427f4610125f2933992b5952783b26.zip
chromium_src-59efee1132427f4610125f2933992b5952783b26.tar.gz
chromium_src-59efee1132427f4610125f2933992b5952783b26.tar.bz2
Makes the browser fetch the translate script regularly.
New versions of that script may get pushed from time to time. Fetching the script again ensures people that don't restart their browser for long periods of time still get the new versions. Also renamed the enum from constant style to macro-style, as it is the Chromium way to go from the Chromium style guide (which is in that regard different than the Google style guide). BUG=None TEST=Run the unit-tests. Review URL: http://codereview.chromium.org/3034013 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@53220 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/cocoa/translate/translate_infobar_base.mm')
-rw-r--r--chrome/browser/cocoa/translate/translate_infobar_base.mm16
1 files changed, 8 insertions, 8 deletions
diff --git a/chrome/browser/cocoa/translate/translate_infobar_base.mm b/chrome/browser/cocoa/translate/translate_infobar_base.mm
index 108ce74..e267074 100644
--- a/chrome/browser/cocoa/translate/translate_infobar_base.mm
+++ b/chrome/browser/cocoa/translate/translate_infobar_base.mm
@@ -102,16 +102,16 @@ void AddMenuItem(NSMenu *menu, id target, SEL selector, NSString* title,
InfoBar* TranslateInfoBarDelegate::CreateInfoBar() {
TranslateInfoBarControllerBase* infobar_controller = NULL;
switch (type_) {
- case kBeforeTranslate:
+ case BEFORE_TRANSLATE:
infobar_controller =
[[BeforeTranslateInfobarController alloc] initWithDelegate:this];
break;
- case kAfterTranslate:
+ case AFTER_TRANSLATE:
infobar_controller =
[[AfterTranslateInfobarController alloc] initWithDelegate:this];
break;
- case kTranslating:
- case kTranslationError:
+ case TRANSLATING:
+ case TRANSLATION_ERROR:
infobar_controller =
[[TranslateMessageInfobarController alloc] initWithDelegate:this];
break;
@@ -471,7 +471,7 @@ InfoBar* TranslateInfoBarDelegate::CreateInfoBar() {
[self rebuildOptionsMenu:NO];
[[optionsPopUp_ cell] setArrowPosition:NSPopUpArrowAtBottom];
[optionsPopUp_ sizeToFit];
-
+
MoveControl(closeButton_, optionsPopUp_, spaceBetweenControls_, false);
if (!VerifyControlOrderAndSpacing(lastView, optionsPopUp_)) {
[self rebuildOptionsMenu:YES];
@@ -490,8 +490,8 @@ InfoBar* TranslateInfoBarDelegate::CreateInfoBar() {
- (IBAction)ok:(id)sender {
TranslateInfoBarDelegate* delegate = [self delegate];
TranslateInfoBarDelegate::Type state = delegate->type();
- DCHECK(state == TranslateInfoBarDelegate::kBeforeTranslate ||
- state == TranslateInfoBarDelegate::kTranslationError);
+ DCHECK(state == TranslateInfoBarDelegate::BEFORE_TRANSLATE ||
+ state == TranslateInfoBarDelegate::TRANSLATION_ERROR);
delegate->Translate();
UMA_HISTOGRAM_COUNTS("Translate.Translate", 1);
}
@@ -499,7 +499,7 @@ InfoBar* TranslateInfoBarDelegate::CreateInfoBar() {
// Called when someone clicks on the "Nope" button.
- (IBAction)cancel:(id)sender {
DCHECK(
- [self delegate]->type() == TranslateInfoBarDelegate::kBeforeTranslate);
+ [self delegate]->type() == TranslateInfoBarDelegate::BEFORE_TRANSLATE);
[self delegate]->TranslationDeclined();
UMA_HISTOGRAM_COUNTS("Translate.DeclineTranslate", 1);
[super dismiss:nil];