Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1512)

Unified Diff: chrome/browser/ui/views/translate/translate_bubble_view.h

Issue 1923143003: Implement the 2016Q2 Translate UI designe spec out in (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix namespace in .h and other minor review comments Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..6b983a11a559e525eca388a59d14779130129b72 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,16 @@ class TranslateBubbleView : public LocationBarBubbleDelegateView,
// Returns the current view state.
TranslateBubbleModel::ViewState GetViewState() const;
+ bool ShouldShowCloseButton() const override;
msw 2016/04/29 20:00:02 Order with the other WidgetDelegate method, Window
ftang 2016/04/29 22:37:02 Done.
+
+ // views::StyledLabelListener method.
+ void StyledLabelLinkClicked(views::StyledLabel* label,
msw 2016/04/29 20:00:02 Order just after the LinkListener override and bef
ftang 2016/04/29 22:37:02 Done.
+ const gfx::Range& range,
+ int event_flags) override;
+
+ // Overridden from views::WidgetObserver:
+ void OnWidgetClosing(views::Widget* widget) override;
msw 2016/04/29 20:00:02 Order before non-override function GetViewState.
ftang 2016/04/29 22:37:02 Done.
+
private:
enum LinkID {
LINK_ID_ADVANCED,
@@ -120,7 +138,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 +204,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 +234,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.
msw 2016/04/29 20:00:02 nit: 'the', 'was': "Whether one of the denial was
ftang 2016/04/29 22:37:02 this is merge mistake. removed
+ bool denial_button_clicked_;
+
+ // Use 2016 Q2 Translate UI
msw 2016/04/29 20:00:02 nit: trailing period; "Use the new (2016 Q2) trans
ftang 2016/04/29 22:37:02 Done.
+ bool use_2016_q2_ui_;
DISALLOW_COPY_AND_ASSIGN(TranslateBubbleView);
};

Powered by Google App Engine
This is Rietveld 408576698