| OLD | NEW |
| (Empty) |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CHROME_BROWSER_UI_VIEWS_OPTIONS_CONTENT_PAGE_VIEW_H_ | |
| 6 #define CHROME_BROWSER_UI_VIEWS_OPTIONS_CONTENT_PAGE_VIEW_H_ | |
| 7 #pragma once | |
| 8 | |
| 9 #include "chrome/browser/autofill/personal_data_manager.h" | |
| 10 #include "chrome/browser/prefs/pref_member.h" | |
| 11 #include "chrome/browser/sync/profile_sync_service.h" | |
| 12 #include "chrome/browser/ui/views/confirm_message_box_dialog.h" | |
| 13 #include "chrome/browser/ui/views/options/options_page_view.h" | |
| 14 #include "views/controls/button/button.h" | |
| 15 #include "views/controls/link.h" | |
| 16 #include "views/view.h" | |
| 17 | |
| 18 namespace views { | |
| 19 class Checkbox; | |
| 20 class Label; | |
| 21 class NativeButton; | |
| 22 class RadioButton; | |
| 23 } | |
| 24 class FileDisplayArea; | |
| 25 class OptionsGroupView; | |
| 26 class PrefService; | |
| 27 | |
| 28 //////////////////////////////////////////////////////////////////////////////// | |
| 29 // ContentPageView | |
| 30 | |
| 31 class ContentPageView : public OptionsPageView, | |
| 32 public views::LinkController, | |
| 33 public ProfileSyncServiceObserver, | |
| 34 public views::ButtonListener, | |
| 35 public ConfirmMessageBoxObserver { | |
| 36 public: | |
| 37 explicit ContentPageView(Profile* profile); | |
| 38 virtual ~ContentPageView(); | |
| 39 | |
| 40 // views::ButtonListener implementation: | |
| 41 virtual void ButtonPressed(views::Button* sender, const views::Event& event); | |
| 42 | |
| 43 // views::LinkController method. | |
| 44 virtual void LinkActivated(views::Link* source, int event_flags); | |
| 45 | |
| 46 // ConfirmMessageBoxObserver implementation. | |
| 47 virtual void OnConfirmMessageAccept(); | |
| 48 | |
| 49 // ProfileSyncServiceObserver method. | |
| 50 virtual void OnStateChanged(); | |
| 51 | |
| 52 protected: | |
| 53 // OptionsPageView implementation: | |
| 54 virtual void InitControlLayout(); | |
| 55 virtual void NotifyPrefChanged(const std::string* pref_name); | |
| 56 | |
| 57 // views::View overrides: | |
| 58 virtual void Layout(); | |
| 59 | |
| 60 private: | |
| 61 // Updates various sync controls based on the current sync state. | |
| 62 void UpdateSyncControls(); | |
| 63 | |
| 64 // Returns whether initialization of controls is done or not. | |
| 65 bool is_initialized() const { | |
| 66 // If initialization is already done, all the UI controls data members | |
| 67 // should be non-NULL. So check for one of them to determine if controls | |
| 68 // are already initialized or not. | |
| 69 return sync_group_ != NULL; | |
| 70 } | |
| 71 | |
| 72 // Init all the dialog controls. | |
| 73 void InitPasswordSavingGroup(); | |
| 74 void InitFormAutofillGroup(); | |
| 75 void InitBrowsingDataGroup(); | |
| 76 void InitThemesGroup(); | |
| 77 void InitSyncGroup(); | |
| 78 | |
| 79 // Controls for the Password Saving group | |
| 80 views::NativeButton* show_passwords_button_; | |
| 81 OptionsGroupView* passwords_group_; | |
| 82 views::RadioButton* passwords_asktosave_radio_; | |
| 83 views::RadioButton* passwords_neversave_radio_; | |
| 84 | |
| 85 // Controls for the Form Autofill group | |
| 86 views::NativeButton* change_autofill_settings_button_; | |
| 87 OptionsGroupView* form_autofill_group_; | |
| 88 | |
| 89 // Controls for the Themes group | |
| 90 OptionsGroupView* themes_group_; | |
| 91 views::NativeButton* themes_reset_button_; | |
| 92 views::Link* themes_gallery_link_; | |
| 93 | |
| 94 // Controls for the browsing data group. | |
| 95 OptionsGroupView* browsing_data_group_; | |
| 96 views::NativeButton* import_button_; | |
| 97 | |
| 98 // Controls for the Sync group. | |
| 99 OptionsGroupView* sync_group_; | |
| 100 views::Label* sync_status_label_; | |
| 101 views::Link* sync_action_link_; | |
| 102 views::NativeButton* sync_start_stop_button_; | |
| 103 views::NativeButton* sync_customize_button_; | |
| 104 views::Link* privacy_dashboard_link_; | |
| 105 | |
| 106 BooleanPrefMember ask_to_save_passwords_; | |
| 107 BooleanPrefMember form_autofill_enabled_; | |
| 108 StringPrefMember is_using_default_theme_; | |
| 109 | |
| 110 // Cached pointer to ProfileSyncService, if it exists. Kept up to date | |
| 111 // and NULL-ed out on destruction. | |
| 112 ProfileSyncService* sync_service_; | |
| 113 | |
| 114 DISALLOW_COPY_AND_ASSIGN(ContentPageView); | |
| 115 }; | |
| 116 | |
| 117 #endif // CHROME_BROWSER_UI_VIEWS_OPTIONS_CONTENT_PAGE_VIEW_H_ | |
| OLD | NEW |