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

Side by Side Diff: chrome/browser/ui/autofill/autofill_popup_controller_impl.h

Issue 12302034: Always Close the Autofill UI through the same path (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Fix Test Created 7 years, 9 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 (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_AUTOFILL_AUTOFILL_POPUP_CONTROLLER_IMPL_H_ 5 #ifndef CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_POPUP_CONTROLLER_IMPL_H_
6 #define CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_POPUP_CONTROLLER_IMPL_H_ 6 #define CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_POPUP_CONTROLLER_IMPL_H_
7 7
8 #include "base/gtest_prod_util.h" 8 #include "base/gtest_prod_util.h"
9 #include "base/memory/weak_ptr.h" 9 #include "base/memory/weak_ptr.h"
10 #include "base/string16.h" 10 #include "base/string16.h"
(...skipping 29 matching lines...) Expand all
40 gfx::NativeView container_view, 40 gfx::NativeView container_view,
41 const gfx::RectF& element_bounds); 41 const gfx::RectF& element_bounds);
42 42
43 // Shows the popup, or updates the existing popup with the given values. 43 // Shows the popup, or updates the existing popup with the given values.
44 void Show(const std::vector<string16>& names, 44 void Show(const std::vector<string16>& names,
45 const std::vector<string16>& subtexts, 45 const std::vector<string16>& subtexts,
46 const std::vector<string16>& icons, 46 const std::vector<string16>& icons,
47 const std::vector<int>& identifiers); 47 const std::vector<int>& identifiers);
48 48
49 // Hides the popup and destroys the controller. This also invalidates 49 // Hides the popup and destroys the controller. This also invalidates
50 // |delegate_|. Virtual for testing. 50 // |delegate_|.
51 virtual void Hide(); 51 virtual void Hide() OVERRIDE;
52 52
53 // KeyboardListener implementation. 53 // KeyboardListener implementation.
54 virtual bool HandleKeyPressEvent( 54 virtual bool HandleKeyPressEvent(
55 const content::NativeWebKeyboardEvent& event) OVERRIDE; 55 const content::NativeWebKeyboardEvent& event) OVERRIDE;
56 56
57 protected: 57 protected:
58 FRIEND_TEST_ALL_PREFIXES(AutofillExternalDelegateBrowserTest, 58 FRIEND_TEST_ALL_PREFIXES(AutofillExternalDelegateBrowserTest,
59 CloseWidgetAndNoLeaking); 59 CloseWidgetAndNoLeaking);
60 60
61 AutofillPopupControllerImpl(AutofillPopupDelegate* delegate, 61 AutofillPopupControllerImpl(AutofillPopupDelegate* delegate,
62 gfx::NativeView container_view, 62 gfx::NativeView container_view,
63 const gfx::RectF& element_bounds); 63 const gfx::RectF& element_bounds);
64 virtual ~AutofillPopupControllerImpl(); 64 virtual ~AutofillPopupControllerImpl();
65 65
66 // AutofillPopupController implementation. 66 // AutofillPopupController implementation.
67 virtual void ViewDestroyed() OVERRIDE;
68 virtual void UpdateBoundsAndRedrawPopup() OVERRIDE; 67 virtual void UpdateBoundsAndRedrawPopup() OVERRIDE;
69 virtual void MouseHovered(int x, int y) OVERRIDE; 68 virtual void MouseHovered(int x, int y) OVERRIDE;
70 virtual void MouseClicked(int x, int y) OVERRIDE; 69 virtual void MouseClicked(int x, int y) OVERRIDE;
71 virtual void MouseExitedPopup() OVERRIDE; 70 virtual void MouseExitedPopup() OVERRIDE;
72 virtual void AcceptSuggestion(size_t index) OVERRIDE; 71 virtual void AcceptSuggestion(size_t index) OVERRIDE;
73 virtual int GetIconResourceID(const string16& resource_name) OVERRIDE; 72 virtual int GetIconResourceID(const string16& resource_name) OVERRIDE;
74 virtual bool CanDelete(size_t index) const OVERRIDE; 73 virtual bool CanDelete(size_t index) const OVERRIDE;
75 virtual gfx::Rect GetRowBounds(size_t index) OVERRIDE; 74 virtual gfx::Rect GetRowBounds(size_t index) OVERRIDE;
76 virtual void SetPopupBounds(const gfx::Rect& bounds) OVERRIDE; 75 virtual void SetPopupBounds(const gfx::Rect& bounds) OVERRIDE;
77 virtual const gfx::Rect& popup_bounds() const OVERRIDE; 76 virtual const gfx::Rect& popup_bounds() const OVERRIDE;
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
196 gfx::Font warning_font_; 195 gfx::Font warning_font_;
197 #endif 196 #endif
198 197
199 // The line that is currently selected by the user. 198 // The line that is currently selected by the user.
200 // |kNoSelection| indicates that no line is currently selected. 199 // |kNoSelection| indicates that no line is currently selected.
201 int selected_line_; 200 int selected_line_;
202 201
203 // Used to indicate if the delete icon within a row is currently selected. 202 // Used to indicate if the delete icon within a row is currently selected.
204 bool delete_icon_hovered_; 203 bool delete_icon_hovered_;
205 204
206 // True if |HideInternal| has already been called. 205 // Used to check that the hide function was called, to check that the class
207 bool is_hiding_; 206 // is only destroyed through the Hide function. Remove after Dev channel
207 // release.
208 bool hide_called_;
Ilya Sherman 2013/02/28 00:22:04 I meant that you should do this for each of the vi
csharp 2013/03/04 22:22:03 Right, fixed.
208 209
209 base::WeakPtrFactory<AutofillPopupControllerImpl> weak_ptr_factory_; 210 base::WeakPtrFactory<AutofillPopupControllerImpl> weak_ptr_factory_;
210 }; 211 };
211 212
212 #endif // CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_POPUP_CONTROLLER_IMPL_H_ 213 #endif // CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_POPUP_CONTROLLER_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698