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

Side by Side Diff: chrome/browser/ui/views/autofill/autofill_dialog_views.h

Issue 135933003: rAc: split TestableAutofillDialogView implementation into its own class (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: with mac nits fixed Created 6 years, 10 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_AUTOFILL_AUTOFILL_DIALOG_VIEWS_H_ 5 #ifndef CHROME_BROWSER_UI_VIEWS_AUTOFILL_AUTOFILL_DIALOG_VIEWS_H_
6 #define CHROME_BROWSER_UI_VIEWS_AUTOFILL_AUTOFILL_DIALOG_VIEWS_H_ 6 #define CHROME_BROWSER_UI_VIEWS_AUTOFILL_AUTOFILL_DIALOG_VIEWS_H_
7 7
8 #include <map> 8 #include <map>
9 #include <set> 9 #include <set>
10 10
11 #include "base/memory/scoped_vector.h" 11 #include "base/memory/scoped_vector.h"
12 #include "base/memory/weak_ptr.h" 12 #include "base/memory/weak_ptr.h"
13 #include "base/scoped_observer.h" 13 #include "base/scoped_observer.h"
14 #include "chrome/browser/ui/autofill/autofill_dialog_types.h" 14 #include "chrome/browser/ui/autofill/autofill_dialog_types.h"
15 #include "chrome/browser/ui/autofill/autofill_dialog_view.h" 15 #include "chrome/browser/ui/autofill/autofill_dialog_view.h"
16 #include "chrome/browser/ui/autofill/autofill_dialog_view_delegate.h" 16 #include "chrome/browser/ui/autofill/autofill_dialog_view_delegate.h"
17 #include "chrome/browser/ui/autofill/testable_autofill_dialog_view.h"
18 #include "ui/views/controls/button/button.h" 17 #include "ui/views/controls/button/button.h"
19 #include "ui/views/controls/button/menu_button.h" 18 #include "ui/views/controls/button/menu_button.h"
20 #include "ui/views/controls/button/menu_button_listener.h" 19 #include "ui/views/controls/button/menu_button_listener.h"
21 #include "ui/views/controls/combobox/combobox_listener.h" 20 #include "ui/views/controls/combobox/combobox_listener.h"
22 #include "ui/views/controls/link_listener.h" 21 #include "ui/views/controls/link_listener.h"
23 #include "ui/views/controls/progress_bar.h" 22 #include "ui/views/controls/progress_bar.h"
24 #include "ui/views/controls/scroll_view.h" 23 #include "ui/views/controls/scroll_view.h"
25 #include "ui/views/controls/styled_label_listener.h" 24 #include "ui/views/controls/styled_label_listener.h"
26 #include "ui/views/controls/textfield/textfield_controller.h" 25 #include "ui/views/controls/textfield/textfield_controller.h"
27 #include "ui/views/focus/focus_manager.h" 26 #include "ui/views/focus/focus_manager.h"
(...skipping 26 matching lines...) Expand all
54 53
55 namespace autofill { 54 namespace autofill {
56 55
57 class AutofillDialogSignInDelegate; 56 class AutofillDialogSignInDelegate;
58 class DecoratedTextfield; 57 class DecoratedTextfield;
59 class InfoBubble; 58 class InfoBubble;
60 59
61 // Views toolkit implementation of the Autofill dialog that handles the 60 // Views toolkit implementation of the Autofill dialog that handles the
62 // imperative autocomplete API call. 61 // imperative autocomplete API call.
63 class AutofillDialogViews : public AutofillDialogView, 62 class AutofillDialogViews : public AutofillDialogView,
64 public TestableAutofillDialogView,
65 public views::DialogDelegateView, 63 public views::DialogDelegateView,
66 public views::WidgetObserver, 64 public views::WidgetObserver,
67 public views::TextfieldController, 65 public views::TextfieldController,
68 public views::FocusChangeListener, 66 public views::FocusChangeListener,
69 public views::ComboboxListener, 67 public views::ComboboxListener,
70 public views::StyledLabelListener, 68 public views::StyledLabelListener,
71 public views::MenuButtonListener { 69 public views::MenuButtonListener {
72 public: 70 public:
73 explicit AutofillDialogViews(AutofillDialogViewDelegate* delegate); 71 explicit AutofillDialogViews(AutofillDialogViewDelegate* delegate);
74 virtual ~AutofillDialogViews(); 72 virtual ~AutofillDialogViews();
(...skipping 15 matching lines...) Expand all
90 ServerFieldType originating_type) OVERRIDE; 88 ServerFieldType originating_type) OVERRIDE;
91 virtual void GetUserInput(DialogSection section, 89 virtual void GetUserInput(DialogSection section,
92 FieldValueMap* output) OVERRIDE; 90 FieldValueMap* output) OVERRIDE;
93 virtual base::string16 GetCvc() OVERRIDE; 91 virtual base::string16 GetCvc() OVERRIDE;
94 virtual bool HitTestInput(ServerFieldType type, 92 virtual bool HitTestInput(ServerFieldType type,
95 const gfx::Point& screen_point) OVERRIDE; 93 const gfx::Point& screen_point) OVERRIDE;
96 virtual bool SaveDetailsLocally() OVERRIDE; 94 virtual bool SaveDetailsLocally() OVERRIDE;
97 virtual const content::NavigationController* ShowSignIn() OVERRIDE; 95 virtual const content::NavigationController* ShowSignIn() OVERRIDE;
98 virtual void HideSignIn() OVERRIDE; 96 virtual void HideSignIn() OVERRIDE;
99 virtual void ModelChanged() OVERRIDE; 97 virtual void ModelChanged() OVERRIDE;
100 virtual TestableAutofillDialogView* GetTestableView() OVERRIDE;
101 virtual void OnSignInResize(const gfx::Size& pref_size) OVERRIDE; 98 virtual void OnSignInResize(const gfx::Size& pref_size) OVERRIDE;
102 99
103 // TestableAutofillDialogView implementation:
104 virtual void SubmitForTesting() OVERRIDE;
105 virtual void CancelForTesting() OVERRIDE;
106 virtual base::string16 GetTextContentsOfInput(ServerFieldType type) OVERRIDE;
107 virtual void SetTextContentsOfInput(ServerFieldType type,
108 const base::string16& contents) OVERRIDE;
109 virtual void SetTextContentsOfSuggestionInput(
110 DialogSection section,
111 const base::string16& text) OVERRIDE;
112 virtual void ActivateInput(ServerFieldType type) OVERRIDE;
113 virtual gfx::Size GetSize() const OVERRIDE;
114 virtual content::WebContents* GetSignInWebContents() OVERRIDE;
115 virtual bool IsShowingOverlay() const OVERRIDE;
116
117 // views::View implementation. 100 // views::View implementation.
118 virtual gfx::Size GetPreferredSize() OVERRIDE; 101 virtual gfx::Size GetPreferredSize() OVERRIDE;
119 virtual gfx::Size GetMinimumSize() OVERRIDE; 102 virtual gfx::Size GetMinimumSize() OVERRIDE;
120 virtual void Layout() OVERRIDE; 103 virtual void Layout() OVERRIDE;
121 virtual void OnNativeThemeChanged(const ui::NativeTheme* theme) OVERRIDE; 104 virtual void OnNativeThemeChanged(const ui::NativeTheme* theme) OVERRIDE;
122 105
123 // views::DialogDelegate implementation: 106 // views::DialogDelegate implementation:
124 virtual base::string16 GetWindowTitle() const OVERRIDE; 107 virtual base::string16 GetWindowTitle() const OVERRIDE;
125 virtual void WindowClosing() OVERRIDE; 108 virtual void WindowClosing() OVERRIDE;
126 virtual void DeleteDelegate() OVERRIDE; 109 virtual void DeleteDelegate() OVERRIDE;
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
171 const gfx::Point& point) OVERRIDE; 154 const gfx::Point& point) OVERRIDE;
172 155
173 protected: 156 protected:
174 // Exposed for testing. 157 // Exposed for testing.
175 views::View* GetLoadingShieldForTesting(); 158 views::View* GetLoadingShieldForTesting();
176 views::WebView* GetSignInWebViewForTesting(); 159 views::WebView* GetSignInWebViewForTesting();
177 views::View* GetNotificationAreaForTesting(); 160 views::View* GetNotificationAreaForTesting();
178 views::View* GetScrollableAreaForTesting(); 161 views::View* GetScrollableAreaForTesting();
179 162
180 private: 163 private:
164 friend class AutofillDialogViewTesterViews;
165
181 // What the entire dialog should be doing (e.g. gathering info from the user, 166 // What the entire dialog should be doing (e.g. gathering info from the user,
182 // asking the user to sign in, etc.). 167 // asking the user to sign in, etc.).
183 enum DialogMode { 168 enum DialogMode {
184 DETAIL_INPUT, 169 DETAIL_INPUT,
185 LOADING, 170 LOADING,
186 SIGN_IN, 171 SIGN_IN,
187 }; 172 };
188 173
189 // A View which displays the currently selected account and lets the user 174 // A View which displays the currently selected account and lets the user
190 // switch accounts. 175 // switch accounts.
(...skipping 497 matching lines...) Expand 10 before | Expand all | Expand 10 after
688 673
689 // Delegate for the sign-in dialog's webview. 674 // Delegate for the sign-in dialog's webview.
690 scoped_ptr<AutofillDialogSignInDelegate> sign_in_delegate_; 675 scoped_ptr<AutofillDialogSignInDelegate> sign_in_delegate_;
691 676
692 DISALLOW_COPY_AND_ASSIGN(AutofillDialogViews); 677 DISALLOW_COPY_AND_ASSIGN(AutofillDialogViews);
693 }; 678 };
694 679
695 } // namespace autofill 680 } // namespace autofill
696 681
697 #endif // CHROME_BROWSER_UI_VIEWS_AUTOFILL_AUTOFILL_DIALOG_VIEWS_H_ 682 #endif // CHROME_BROWSER_UI_VIEWS_AUTOFILL_AUTOFILL_DIALOG_VIEWS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698