diff options
author | jeremy@chromium.org <jeremy@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-02-25 18:53:38 +0000 |
---|---|---|
committer | jeremy@chromium.org <jeremy@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-02-25 18:53:38 +0000 |
commit | bd6dec7407bcacd66a3cb4adbc33fab42214a36d (patch) | |
tree | 30c62fdee0606ef3d3c3f9370f0a936650a92a0a /chrome/browser/cocoa/translate_infobar.h | |
parent | b05ce36f883bb46bf7bd78a235b1e979ed1add86 (diff) | |
download | chromium_src-bd6dec7407bcacd66a3cb4adbc33fab42214a36d.zip chromium_src-bd6dec7407bcacd66a3cb4adbc33fab42214a36d.tar.gz chromium_src-bd6dec7407bcacd66a3cb4adbc33fab42214a36d.tar.bz2 |
Translate Infobars for OS X.
Infobars.xib changes - Connect and fix class for close button since the translate infobar needs to know where it is to position the "Options" menu to it's left.
BUG=34466
TEST=Translate infobars should continue to workon Windows.
Review URL: http://codereview.chromium.org/594056
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@40034 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/cocoa/translate_infobar.h')
-rw-r--r-- | chrome/browser/cocoa/translate_infobar.h | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/chrome/browser/cocoa/translate_infobar.h b/chrome/browser/cocoa/translate_infobar.h new file mode 100644 index 0000000..2a9cc7d --- /dev/null +++ b/chrome/browser/cocoa/translate_infobar.h @@ -0,0 +1,52 @@ +// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#import <Cocoa/Cocoa.h> +#import "chrome/browser/cocoa/infobar_controller.h" + +#include "base/scoped_nsobject.h" +#include "base/scoped_ptr.h" +#include "chrome/browser/translate/languages_menu_model.h" +#include "chrome/browser/translate/options_menu_model.h" +#include "chrome/common/notification_registrar.h" + +class TranslateInfoBarMenuModel; +class TranslateNotificationObserverBridge; + +// Draws and maintains Translate Infobar GUI. +// The translate bar changes unidirectionally between 3 states: +// 1. "Before Translate" - source language popup and translate/cancel buttons +// visible. +// 2. "Translating" - "Translating..." status text visible in address bar. +// 3. "After Translation" - source & target language popups visible. +// +// The GUI uses popup menus interspersed in a text label. For localization +// purposes this means we potentially need 3 labels to display the UI (the 3rd +// is only visible in certain locales). +@interface TranslateInfoBarController : InfoBarController { + @protected + // label_ is defined in InfoBarController. + scoped_nsobject<NSTextField> label2_; + scoped_nsobject<NSTextField> label3_; + scoped_nsobject<NSTextField> translatingLabel_; + scoped_nsobject<NSPopUpButton> fromLanguagePopUp_; + scoped_nsobject<NSPopUpButton> toLanguagePopUp_; + scoped_nsobject<NSPopUpButton> optionsPopUp_; + + // In the current locale, are the "from" and "to" language popup menu + // flipped from what they'd appear in English. + bool swappedLanguagePlaceholders_; + + // Space between controls in pixels - read from the NIB. + CGFloat spaceBetweenControls_; + int numLabelsDisplayed_; + + scoped_ptr<LanguagesMenuModel> original_language_menu_model_; + scoped_ptr<LanguagesMenuModel> target_language_menu_model_; + scoped_ptr<OptionsMenuModel> options_menu_model_; + scoped_ptr<TranslateInfoBarMenuModel> menu_model_; + scoped_ptr<TranslateNotificationObserverBridge> observer_bridge_; +} + +@end |