OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_PROFILES_VIEW_WIN_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_AUTOFILL_PROFILES_VIEW_WIN_H_ |
6 #define CHROME_BROWSER_UI_VIEWS_AUTOFILL_PROFILES_VIEW_WIN_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_AUTOFILL_PROFILES_VIEW_WIN_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <list> | 9 #include <list> |
10 #include <map> | 10 #include <map> |
11 #include <vector> | 11 #include <vector> |
12 | 12 |
13 #include "base/compiler_specific.h" | 13 #include "base/compiler_specific.h" |
14 #include "base/string16.h" | 14 #include "base/string16.h" |
15 #include "chrome/browser/autofill/autofill_dialog.h" | 15 #include "chrome/browser/autofill/autofill_dialog.h" |
16 #include "chrome/browser/autofill/autofill_profile.h" | 16 #include "chrome/browser/autofill/autofill_profile.h" |
17 #include "chrome/browser/autofill/personal_data_manager.h" | 17 #include "chrome/browser/autofill/personal_data_manager.h" |
18 #include "chrome/browser/prefs/pref_member.h" | 18 #include "chrome/browser/prefs/pref_member.h" |
19 #include "content/common/notification_observer.h" | 19 #include "content/common/notification_observer.h" |
20 #include "ui/base/models/combobox_model.h" | 20 #include "ui/base/models/combobox_model.h" |
21 #include "ui/base/models/table_model.h" | 21 #include "ui/base/models/table_model.h" |
22 #include "views/controls/combobox/combobox.h" | 22 #include "views/controls/combobox/combobox.h" |
23 #include "views/controls/link.h" | 23 #include "views/controls/link.h" |
24 #include "views/controls/table/table_view_observer.h" | 24 #include "views/controls/table/table_view_observer.h" |
25 #include "views/controls/textfield/textfield.h" | 25 #include "views/controls/textfield/textfield_controller.h" |
26 #include "views/focus/focus_manager.h" | 26 #include "views/focus/focus_manager.h" |
27 #include "views/view.h" | 27 #include "views/view.h" |
28 #include "views/window/dialog_delegate.h" | 28 #include "views/window/dialog_delegate.h" |
29 | 29 |
30 namespace views { | 30 namespace views { |
31 class Checkbox; | 31 class Checkbox; |
32 class GridLayout; | 32 class GridLayout; |
33 class ImageButton; | 33 class ImageButton; |
34 class Label; | 34 class Label; |
35 class RadioButton; | 35 class RadioButton; |
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
242 DISALLOW_COPY_AND_ASSIGN(PhoneSubView); | 242 DISALLOW_COPY_AND_ASSIGN(PhoneSubView); |
243 }; | 243 }; |
244 | 244 |
245 // Forward declaration. | 245 // Forward declaration. |
246 class StringVectorComboboxModel; | 246 class StringVectorComboboxModel; |
247 | 247 |
248 // Sub-view for editing/adding a credit card or address. | 248 // Sub-view for editing/adding a credit card or address. |
249 class EditableSetViewContents : public views::View, | 249 class EditableSetViewContents : public views::View, |
250 public views::DialogDelegate, | 250 public views::DialogDelegate, |
251 public views::ButtonListener, | 251 public views::ButtonListener, |
252 public views::Textfield::Controller, | 252 public views::TextfieldController, |
253 public views::Combobox::Listener { | 253 public views::Combobox::Listener { |
254 public: | 254 public: |
255 EditableSetViewContents(AutoFillProfilesView* observer, | 255 EditableSetViewContents(AutoFillProfilesView* observer, |
256 bool new_item, | 256 bool new_item, |
257 const EditableSetInfo& field_set); | 257 const EditableSetInfo& field_set); |
258 virtual ~EditableSetViewContents() {} | 258 virtual ~EditableSetViewContents() {} |
259 | 259 |
260 protected: | 260 protected: |
261 // views::View methods: | 261 // views::View: |
262 virtual void Layout(); | 262 virtual void Layout(); |
263 virtual gfx::Size GetPreferredSize(); | 263 virtual gfx::Size GetPreferredSize(); |
264 virtual void ViewHierarchyChanged(bool is_add, views::View* parent, | 264 virtual void ViewHierarchyChanged(bool is_add, |
| 265 views::View* parent, |
265 views::View* child); | 266 views::View* child); |
266 | 267 |
267 // views::DialogDelegate methods: | 268 // views::DialogDelegate: |
268 virtual int GetDialogButtons() const; | 269 virtual int GetDialogButtons() const; |
269 virtual std::wstring GetDialogButtonLabel( | 270 virtual std::wstring GetDialogButtonLabel( |
270 MessageBoxFlags::DialogButton button) const; | 271 MessageBoxFlags::DialogButton button) const; |
271 virtual bool IsDialogButtonEnabled( | 272 virtual bool IsDialogButtonEnabled( |
272 MessageBoxFlags::DialogButton button) const; | 273 MessageBoxFlags::DialogButton button) const; |
273 virtual bool CanResize() const { return false; } | 274 virtual bool CanResize() const { return false; } |
274 virtual bool CanMaximize() const { return false; } | 275 virtual bool CanMaximize() const { return false; } |
275 virtual bool IsModal() const { return true; } | 276 virtual bool IsModal() const { return true; } |
276 virtual bool HasAlwaysOnTopMenu() const { return false; } | 277 virtual bool HasAlwaysOnTopMenu() const { return false; } |
277 virtual std::wstring GetWindowTitle() const; | 278 virtual std::wstring GetWindowTitle() const; |
278 virtual void WindowClosing(); | 279 virtual void WindowClosing(); |
279 virtual views::View* GetContentsView(); | 280 virtual views::View* GetContentsView(); |
280 virtual bool Cancel(); | 281 virtual bool Cancel(); |
281 virtual bool Accept(); | 282 virtual bool Accept(); |
282 | 283 |
283 // views::ButtonListener methods: | 284 // views::ButtonListener: |
284 virtual void ButtonPressed(views::Button* sender, | 285 virtual void ButtonPressed(views::Button* sender, |
285 const views::Event& event); | 286 const views::Event& event); |
286 | 287 |
287 // views::Textfield::Controller methods: | 288 // views::TextfieldController: |
288 virtual void ContentsChanged(views::Textfield* sender, | 289 virtual void ContentsChanged(views::Textfield* sender, |
289 const string16& new_contents); | 290 const string16& new_contents); |
290 virtual bool HandleKeyEvent(views::Textfield* sender, | 291 virtual bool HandleKeyEvent(views::Textfield* sender, |
291 const views::KeyEvent& keystroke); | 292 const views::KeyEvent& keystroke); |
292 | 293 |
293 // views::Combobox::Listener methods: | 294 // views::Combobox::Listener methods: |
294 virtual void ItemChanged(views::Combobox* combo_box, | 295 virtual void ItemChanged(views::Combobox* combo_box, |
295 int prev_index, | 296 int prev_index, |
296 int new_index); | 297 int new_index); |
297 private: | 298 private: |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
432 scoped_ptr<ContentListTableModel> table_model_; | 433 scoped_ptr<ContentListTableModel> table_model_; |
433 views::FocusManager* focus_manager_; | 434 views::FocusManager* focus_manager_; |
434 bool child_dialog_opened_; | 435 bool child_dialog_opened_; |
435 | 436 |
436 static AutoFillProfilesView* instance_; | 437 static AutoFillProfilesView* instance_; |
437 | 438 |
438 DISALLOW_COPY_AND_ASSIGN(AutoFillProfilesView); | 439 DISALLOW_COPY_AND_ASSIGN(AutoFillProfilesView); |
439 }; | 440 }; |
440 | 441 |
441 #endif // CHROME_BROWSER_UI_VIEWS_AUTOFILL_PROFILES_VIEW_WIN_H_ | 442 #endif // CHROME_BROWSER_UI_VIEWS_AUTOFILL_PROFILES_VIEW_WIN_H_ |
OLD | NEW |