| 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..d9f858f11c30c01cd02b8e132b73a6e8ad69eed9 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
|
| @@ -96,6 +104,12 @@ class TranslateBubbleView : public LocationBarBubbleDelegateView,
|
| // Returns the current view state.
|
| TranslateBubbleModel::ViewState GetViewState() const;
|
|
|
| + bool ShouldShowCloseButton() const override;
|
| +
|
| + // views::StyledLabelListener method.
|
| + void StyledLabelLinkClicked(views::StyledLabel* label,
|
| + const gfx::Range& range,
|
| + int event_flags) override;
|
| private:
|
| enum LinkID {
|
| LINK_ID_ADVANCED,
|
| @@ -120,7 +134,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 +200,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 +230,11 @@ 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_;
|
| + // Whether one of denial buttons is clicked.
|
| + bool denial_button_clicked_;
|
| +
|
| + // Use 2016 Q2 Translate UI
|
| + bool use_2016_q2_ui_;
|
|
|
| DISALLOW_COPY_AND_ASSIGN(TranslateBubbleView);
|
| };
|
|
|