OLD | NEW |
---|---|
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 | 9 |
10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
243 public: | 243 public: |
244 SectionContainer(const string16& label, | 244 SectionContainer(const string16& label, |
245 views::View* controls, | 245 views::View* controls, |
246 views::Button* proxy_button); | 246 views::Button* proxy_button); |
247 virtual ~SectionContainer(); | 247 virtual ~SectionContainer(); |
248 | 248 |
249 // Sets the visual appearance of the section to active (considered active | 249 // Sets the visual appearance of the section to active (considered active |
250 // when showing the menu or hovered by the mouse cursor). | 250 // when showing the menu or hovered by the mouse cursor). |
251 void SetActive(bool active); | 251 void SetActive(bool active); |
252 | 252 |
253 // Whether this section can be actively styled or not. If |can_activate| is | |
Evan Stade
2013/03/26 19:29:54
I don't know what "actively styled" means.
Dan Beam
2013/03/27 00:38:27
s/actively styled/active/
| |
254 // false and this view is currently active, it's deactivated. | |
255 void SetCanActivate(bool can_activate); | |
256 | |
253 // Sets whether mouse events should be forwarded to |proxy_button_|. | 257 // Sets whether mouse events should be forwarded to |proxy_button_|. |
254 void SetForwardMouseEvents(bool forward); | 258 void SetForwardMouseEvents(bool forward); |
255 | 259 |
256 // views::View implementation. | 260 // views::View implementation. |
257 virtual void OnMouseMoved(const ui::MouseEvent& event) OVERRIDE; | 261 virtual void OnMouseMoved(const ui::MouseEvent& event) OVERRIDE; |
258 virtual void OnMouseEntered(const ui::MouseEvent& event) OVERRIDE; | 262 virtual void OnMouseEntered(const ui::MouseEvent& event) OVERRIDE; |
259 virtual void OnMouseExited(const ui::MouseEvent& event) OVERRIDE; | 263 virtual void OnMouseExited(const ui::MouseEvent& event) OVERRIDE; |
260 virtual bool OnMousePressed(const ui::MouseEvent& event) OVERRIDE; | 264 virtual bool OnMousePressed(const ui::MouseEvent& event) OVERRIDE; |
261 virtual void OnMouseReleased(const ui::MouseEvent& event) OVERRIDE; | 265 virtual void OnMouseReleased(const ui::MouseEvent& event) OVERRIDE; |
262 | 266 |
267 bool can_activate() const { return can_activate_; } | |
268 | |
263 private: | 269 private: |
264 // Converts |event| to one suitable for |proxy_button_|. | 270 // Converts |event| to one suitable for |proxy_button_|. |
265 static ui::MouseEvent ProxyEvent(const ui::MouseEvent& event); | 271 static ui::MouseEvent ProxyEvent(const ui::MouseEvent& event); |
266 | 272 |
267 // Mouse events on |this| are sent to this button. | 273 // Mouse events on |this| are sent to this button. |
268 views::Button* proxy_button_; // Weak reference. | 274 views::Button* proxy_button_; // Weak reference. |
269 | 275 |
276 // When true, this section container can be actively styled. | |
277 bool can_activate_; | |
278 | |
270 // When true, mouse events will be forwarded to |proxy_button_|. | 279 // When true, mouse events will be forwarded to |proxy_button_|. |
271 bool forward_mouse_events_; | 280 bool forward_mouse_events_; |
272 | 281 |
273 DISALLOW_COPY_AND_ASSIGN(SectionContainer); | 282 DISALLOW_COPY_AND_ASSIGN(SectionContainer); |
274 }; | 283 }; |
275 | 284 |
276 // A view that contains a suggestion (such as a known address) and a link to | 285 // A view that contains a suggestion (such as a known address) and a link to |
277 // edit the suggestion. | 286 // edit the suggestion. |
278 class SuggestionView : public views::View { | 287 class SuggestionView : public views::View { |
279 public: | 288 public: |
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
462 | 471 |
463 // The focus manager for |window_|. | 472 // The focus manager for |window_|. |
464 views::FocusManager* focus_manager_; | 473 views::FocusManager* focus_manager_; |
465 | 474 |
466 DISALLOW_COPY_AND_ASSIGN(AutofillDialogViews); | 475 DISALLOW_COPY_AND_ASSIGN(AutofillDialogViews); |
467 }; | 476 }; |
468 | 477 |
469 } // namespace autofill | 478 } // namespace autofill |
470 | 479 |
471 #endif // CHROME_BROWSER_UI_VIEWS_AUTOFILL_AUTOFILL_DIALOG_VIEWS_H_ | 480 #endif // CHROME_BROWSER_UI_VIEWS_AUTOFILL_AUTOFILL_DIALOG_VIEWS_H_ |
OLD | NEW |