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

Side by Side Diff: chrome/browser/ui/views/translate/translate_bubble_view.h

Issue 2074913002: Enable the translate bubble to be dismissed when user ignores it. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2743
Patch Set: Created 4 years, 6 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_BROWSER_UI_VIEWS_TRANSLATE_TRANSLATE_BUBBLE_VIEW_H_ 5 #ifndef CHROME_BROWSER_UI_VIEWS_TRANSLATE_TRANSLATE_BUBBLE_VIEW_H_
6 #define CHROME_BROWSER_UI_VIEWS_TRANSLATE_TRANSLATE_BUBBLE_VIEW_H_ 6 #define CHROME_BROWSER_UI_VIEWS_TRANSLATE_TRANSLATE_BUBBLE_VIEW_H_
7 7
8 #include <map> 8 #include <map>
9 #include <string> 9 #include <string>
10 10
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 void ButtonPressed(views::Button* sender, const ui::Event& event) override; 87 void ButtonPressed(views::Button* sender, const ui::Event& event) override;
88 88
89 // views::WidgetDelegate methods. 89 // views::WidgetDelegate methods.
90 bool ShouldShowCloseButton() const override; 90 bool ShouldShowCloseButton() const override;
91 void WindowClosing() override; 91 void WindowClosing() override;
92 92
93 // views::View methods. 93 // views::View methods.
94 bool AcceleratorPressed(const ui::Accelerator& accelerator) override; 94 bool AcceleratorPressed(const ui::Accelerator& accelerator) override;
95 gfx::Size GetPreferredSize() const override; 95 gfx::Size GetPreferredSize() const override;
96 96
97 // views::CombboxListener methods. 97 // views::ComboboxListener methods.
98 void OnPerformAction(views::Combobox* combobox) override; 98 void OnPerformAction(views::Combobox* combobox) override;
99 99
100 // views::LinkListener method. 100 // views::LinkListener method.
101 void LinkClicked(views::Link* source, int event_flags) override; 101 void LinkClicked(views::Link* source, int event_flags) override;
102 102
103 // views::MenuButtonListener method. 103 // views::MenuButtonListener method.
104 void OnMenuButtonClicked(views::MenuButton* source, 104 void OnMenuButtonClicked(views::MenuButton* source,
105 const gfx::Point& point, 105 const gfx::Point& point,
106 const ui::Event* event) override; 106 const ui::Event* event) override;
107 107
(...skipping 11 matching lines...) Expand all
119 119
120 // content::WebContentsObserver method. 120 // content::WebContentsObserver method.
121 void WebContentsDestroyed() override; 121 void WebContentsDestroyed() override;
122 122
123 // Overridden from views::WidgetObserver: 123 // Overridden from views::WidgetObserver:
124 void OnWidgetClosing(views::Widget* widget) override; 124 void OnWidgetClosing(views::Widget* widget) override;
125 125
126 // Returns the current view state. 126 // Returns the current view state.
127 TranslateBubbleModel::ViewState GetViewState() const; 127 TranslateBubbleModel::ViewState GetViewState() const;
128 128
129 protected:
130 // LocationBarBubbleDelegateView:
131 void CloseBubble() override;
132
129 private: 133 private:
130 enum LinkID { 134 enum LinkID {
131 LINK_ID_ADVANCED, 135 LINK_ID_ADVANCED,
132 LINK_ID_LANGUAGE_SETTINGS, 136 LINK_ID_LANGUAGE_SETTINGS,
133 }; 137 };
134 138
135 enum ButtonID { 139 enum ButtonID {
136 BUTTON_ID_TRANSLATE, 140 BUTTON_ID_TRANSLATE,
137 BUTTON_ID_DONE, 141 BUTTON_ID_DONE,
138 BUTTON_ID_CANCEL, 142 BUTTON_ID_CANCEL,
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
241 std::unique_ptr<ui::SimpleMenuModel> denial_menu_model_; 245 std::unique_ptr<ui::SimpleMenuModel> denial_menu_model_;
242 std::unique_ptr<views::MenuRunner> denial_menu_runner_; 246 std::unique_ptr<views::MenuRunner> denial_menu_runner_;
243 247
244 std::unique_ptr<TranslateBubbleModel> model_; 248 std::unique_ptr<TranslateBubbleModel> model_;
245 249
246 translate::TranslateErrors::Type error_type_; 250 translate::TranslateErrors::Type error_type_;
247 251
248 // Whether the window is an incognito window. 252 // Whether the window is an incognito window.
249 const bool is_in_incognito_window_; 253 const bool is_in_incognito_window_;
250 254
255 std::unique_ptr<WebContentMouseHandler> mouse_handler_;
256
251 DISALLOW_COPY_AND_ASSIGN(TranslateBubbleView); 257 DISALLOW_COPY_AND_ASSIGN(TranslateBubbleView);
252 }; 258 };
253 259
254 #endif // CHROME_BROWSER_UI_VIEWS_TRANSLATE_TRANSLATE_BUBBLE_VIEW_H_ 260 #endif // CHROME_BROWSER_UI_VIEWS_TRANSLATE_TRANSLATE_BUBBLE_VIEW_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698