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

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

Issue 106793006: Refactoring: Remove an uneeded argment from TranslateBubbleView::TranslateBubbleView (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: sky's review Created 7 years 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
11 #include "base/basictypes.h" 11 #include "base/basictypes.h"
12 #include "chrome/browser/ui/translate/language_combobox_model.h" 12 #include "chrome/browser/ui/translate/language_combobox_model.h"
13 #include "chrome/browser/ui/translate/translate_bubble_model.h" 13 #include "chrome/browser/ui/translate/translate_bubble_model.h"
14 #include "chrome/common/translate/translate_errors.h" 14 #include "chrome/common/translate/translate_errors.h"
15 #include "content/public/browser/web_contents_observer.h" 15 #include "content/public/browser/web_contents_observer.h"
16 #include "ui/views/bubble/bubble_delegate.h" 16 #include "ui/views/bubble/bubble_delegate.h"
17 #include "ui/views/controls/button/button.h" 17 #include "ui/views/controls/button/button.h"
18 #include "ui/views/controls/combobox/combobox_listener.h" 18 #include "ui/views/controls/combobox/combobox_listener.h"
19 #include "ui/views/controls/link_listener.h" 19 #include "ui/views/controls/link_listener.h"
20 20
21 class Browser;
22 class PrefService; 21 class PrefService;
23 class TranslateBubbleModel; 22 class TranslateBubbleModel;
24 23
25 namespace views { 24 namespace views {
26 class Checkbox; 25 class Checkbox;
27 class GridLayout; 26 class GridLayout;
28 class LabelButton; 27 class LabelButton;
29 class Link; 28 class Link;
30 class View; 29 class View;
31 } 30 }
32 31
33 class TranslateBubbleView : public views::BubbleDelegateView, 32 class TranslateBubbleView : public views::BubbleDelegateView,
34 public views::ButtonListener, 33 public views::ButtonListener,
35 public views::ComboboxListener, 34 public views::ComboboxListener,
36 public views::LinkListener, 35 public views::LinkListener,
37 public content::WebContentsObserver { 36 public content::WebContentsObserver {
38 public: 37 public:
39 virtual ~TranslateBubbleView(); 38 virtual ~TranslateBubbleView();
40 39
41 // Shows the Translate bubble. 40 // Shows the Translate bubble.
42 static void ShowBubble(views::View* anchor_view, 41 static void ShowBubble(views::View* anchor_view,
43 content::WebContents* web_contents, 42 content::WebContents* web_contents,
44 TranslateBubbleModel::ViewState type, 43 TranslateBubbleModel::ViewState type,
45 TranslateErrors::Type error_type, 44 TranslateErrors::Type error_type);
46 Browser* browser);
47 45
48 // If true, the Translate bubble is being shown. 46 // If true, the Translate bubble is being shown.
49 static bool IsShowing(); 47 static bool IsShowing();
50 48
51 // Returns the bubble view currently shown. This may return NULL. 49 // Returns the bubble view currently shown. This may return NULL.
52 static TranslateBubbleView* GetCurrentBubble(); 50 static TranslateBubbleView* GetCurrentBubble();
53 51
54 TranslateBubbleModel* model() { return model_.get(); } 52 TranslateBubbleModel* model() { return model_.get(); }
55 53
56 // views::BubbleDelegateView methods. 54 // views::BubbleDelegateView methods.
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 DoneButtonWithoutTranslating); 112 DoneButtonWithoutTranslating);
115 FRIEND_TEST_ALL_PREFIXES(TranslateBubbleViewTest, 113 FRIEND_TEST_ALL_PREFIXES(TranslateBubbleViewTest,
116 CancelButtonReturningBeforeTranslate); 114 CancelButtonReturningBeforeTranslate);
117 FRIEND_TEST_ALL_PREFIXES(TranslateBubbleViewTest, 115 FRIEND_TEST_ALL_PREFIXES(TranslateBubbleViewTest,
118 CancelButtonReturningAfterTranslate); 116 CancelButtonReturningAfterTranslate);
119 FRIEND_TEST_ALL_PREFIXES(TranslateBubbleViewTest, CancelButtonReturningError); 117 FRIEND_TEST_ALL_PREFIXES(TranslateBubbleViewTest, CancelButtonReturningError);
120 118
121 TranslateBubbleView(views::View* anchor_view, 119 TranslateBubbleView(views::View* anchor_view,
122 scoped_ptr<TranslateBubbleModel> model, 120 scoped_ptr<TranslateBubbleModel> model,
123 TranslateErrors::Type error_type, 121 TranslateErrors::Type error_type,
124 Browser* browser,
125 content::WebContents* web_contents); 122 content::WebContents* web_contents);
126 123
127 // Returns the current child view. 124 // Returns the current child view.
128 views::View* GetCurrentView(); 125 views::View* GetCurrentView();
129 126
130 // Handles the event when the user presses a button. 127 // Handles the event when the user presses a button.
131 void HandleButtonPressed(ButtonID sender_id); 128 void HandleButtonPressed(ButtonID sender_id);
132 129
133 // Handles the event when the user clicks a link. 130 // Handles the event when the user clicks a link.
134 void HandleLinkClicked(LinkID sender_id); 131 void HandleLinkClicked(LinkID sender_id);
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
186 views::LabelButton* advanced_cancel_button_; 183 views::LabelButton* advanced_cancel_button_;
187 views::LabelButton* advanced_done_button_; 184 views::LabelButton* advanced_done_button_;
188 185
189 scoped_ptr<TranslateBubbleModel> model_; 186 scoped_ptr<TranslateBubbleModel> model_;
190 187
191 TranslateErrors::Type error_type_; 188 TranslateErrors::Type error_type_;
192 189
193 // Whether the window is an incognito window. 190 // Whether the window is an incognito window.
194 const bool is_in_incognito_window_; 191 const bool is_in_incognito_window_;
195 192
196 // The browser to open the help URL into a new tab.
197 Browser* browser_;
198
199 // Whether the translation is acutually executed. 193 // Whether the translation is acutually executed.
200 bool translate_executed_; 194 bool translate_executed_;
201 195
202 // Whether one of denial buttons is clicked. 196 // Whether one of denial buttons is clicked.
203 bool denial_button_clicked_; 197 bool denial_button_clicked_;
204 198
205 DISALLOW_COPY_AND_ASSIGN(TranslateBubbleView); 199 DISALLOW_COPY_AND_ASSIGN(TranslateBubbleView);
206 }; 200 };
207 201
208 #endif // CHROME_BROWSER_UI_VIEWS_TRANSLATE_TRANSLATE_BUBBLE_VIEW_H_ 202 #endif // CHROME_BROWSER_UI_VIEWS_TRANSLATE_TRANSLATE_BUBBLE_VIEW_H_
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/frame/browser_view.cc ('k') | chrome/browser/ui/views/translate/translate_bubble_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698