| Index: chrome/browser/ui/views/translate/translate_bubble_view.h
|
| diff --git a/chrome/browser/ui/views/translate/translate_bubble_view.h b/chrome/browser/ui/views/translate/translate_bubble_view.h
|
| index d69f4ba113b7b11a0d65835f6a9d78b938ac09ea..6aa2405fe81575533dbf25c8350a6c065b894aeb 100644
|
| --- a/chrome/browser/ui/views/translate/translate_bubble_view.h
|
| +++ b/chrome/browser/ui/views/translate/translate_bubble_view.h
|
| @@ -10,6 +10,7 @@
|
|
|
| #include "base/gtest_prod_util.h"
|
| #include "base/macros.h"
|
| +#include "base/strings/utf_string_conversions.h"
|
| #include "chrome/browser/translate/chrome_translate_client.h"
|
| #include "chrome/browser/ui/translate/language_combobox_model.h"
|
| #include "chrome/browser/ui/translate/translate_bubble_model.h"
|
| @@ -20,16 +21,22 @@
|
| #include "ui/views/controls/button/button.h"
|
| #include "ui/views/controls/combobox/combobox_listener.h"
|
| #include "ui/views/controls/link_listener.h"
|
| +#include "ui/views/controls/styled_label_listener.h"
|
|
|
| class Browser;
|
| class PrefService;
|
|
|
| +namespace gfx {
|
| +class Range;
|
| +}
|
| +
|
| namespace views {
|
| class Checkbox;
|
| class GridLayout;
|
| class LabelButton;
|
| class Link;
|
| class View;
|
| +class StyledLabel;
|
| }
|
|
|
| namespace ui {
|
| @@ -40,6 +47,7 @@ class TranslateBubbleView : public LocationBarBubbleDelegateView,
|
| public views::ButtonListener,
|
| public views::ComboboxListener,
|
| public views::LinkListener,
|
| + public views::StyledLabelListener,
|
| public content::WebContentsObserver {
|
| public:
|
| // Commands shown in the action-style combobox. The value corresponds to the
|
| @@ -77,7 +85,8 @@ class TranslateBubbleView : public LocationBarBubbleDelegateView,
|
| void Init() override;
|
| void ButtonPressed(views::Button* sender, const ui::Event& event) override;
|
|
|
| - // views::WidgetDelegate method.
|
| + // views::WidgetDelegate methods.
|
| + bool ShouldShowCloseButton() const override;
|
| void WindowClosing() override;
|
|
|
| // views::View methods.
|
| @@ -90,9 +99,17 @@ class TranslateBubbleView : public LocationBarBubbleDelegateView,
|
| // views::LinkListener method.
|
| void LinkClicked(views::Link* source, int event_flags) override;
|
|
|
| + // views::StyledLabelListener method.
|
| + void StyledLabelLinkClicked(views::StyledLabel* label,
|
| + const gfx::Range& range,
|
| + int event_flags) override;
|
| +
|
| // content::WebContentsObserver method.
|
| void WebContentsDestroyed() override;
|
|
|
| + // Overridden from views::WidgetObserver:
|
| + void OnWidgetClosing(views::Widget* widget) override;
|
| +
|
| // Returns the current view state.
|
| TranslateBubbleModel::ViewState GetViewState() const;
|
|
|
| @@ -120,7 +137,10 @@ class TranslateBubbleView : public LocationBarBubbleDelegateView,
|
| friend class TranslateBubbleViewTest;
|
| friend void ::translate::test_utils::PressTranslate(::Browser*);
|
| FRIEND_TEST_ALL_PREFIXES(TranslateBubbleViewTest, TranslateButton);
|
| + FRIEND_TEST_ALL_PREFIXES(TranslateBubbleViewTest, TranslateButtonIn2016Q2UI);
|
| + FRIEND_TEST_ALL_PREFIXES(TranslateBubbleViewTest, CloseButtonIn2016Q2UI);
|
| FRIEND_TEST_ALL_PREFIXES(TranslateBubbleViewTest, AdvancedLink);
|
| + FRIEND_TEST_ALL_PREFIXES(TranslateBubbleViewTest, AdvancedLinkIn2016Q2UI);
|
| FRIEND_TEST_ALL_PREFIXES(TranslateBubbleViewTest, ShowOriginalButton);
|
| FRIEND_TEST_ALL_PREFIXES(TranslateBubbleViewTest, TryAgainButton);
|
| FRIEND_TEST_ALL_PREFIXES(TranslateBubbleViewTest,
|
| @@ -183,6 +203,8 @@ class TranslateBubbleView : public LocationBarBubbleDelegateView,
|
| // Updates the advanced view.
|
| void UpdateAdvancedView();
|
|
|
| + void ReportUiAction(int action);
|
| +
|
| static TranslateBubbleView* translate_bubble_view_;
|
|
|
| views::View* before_translate_view_;
|
| @@ -211,8 +233,8 @@ class TranslateBubbleView : public LocationBarBubbleDelegateView,
|
| // Whether the window is an incognito window.
|
| const bool is_in_incognito_window_;
|
|
|
| - // Whether the translation is acutually executed.
|
| - bool translate_executed_;
|
| + // Use the new (2016 Q2) translate UI.
|
| + bool use_2016_q2_ui_;
|
|
|
| DISALLOW_COPY_AND_ASSIGN(TranslateBubbleView);
|
| };
|
|
|