diff options
author | tfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-02-19 14:12:23 +0000 |
---|---|---|
committer | tfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-02-19 14:12:23 +0000 |
commit | 1ab7761d57f2144fac3f03958e571410b595a2b9 (patch) | |
tree | b955a9d1e73f56d953339e852a7402faf9141a09 /chrome/browser | |
parent | c1338959f5d9fa970750a3007c52f3151b877232 (diff) | |
download | chromium_src-1ab7761d57f2144fac3f03958e571410b595a2b9.zip chromium_src-1ab7761d57f2144fac3f03958e571410b595a2b9.tar.gz chromium_src-1ab7761d57f2144fac3f03958e571410b595a2b9.tar.bz2 |
WebUI: Move chrome/browser/dom_ui/options/ to chrome/browser/webui/options.
To reduce the size of this change I've left stub header files in chrome/browser/dom_ui/options.
I'll updated the references and delete the stub files later.
BUG=59945, 59946
TEST=trybots
Review URL: http://codereview.chromium.org/6469067
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@75496 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
76 files changed, 1755 insertions, 1479 deletions
diff --git a/chrome/browser/dom_ui/options/about_page_handler.h b/chrome/browser/dom_ui/options/about_page_handler.h index 60fefbc..09b96ff 100644 --- a/chrome/browser/dom_ui/options/about_page_handler.h +++ b/chrome/browser/dom_ui/options/about_page_handler.h @@ -1,65 +1,12 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef CHROME_BROWSER_DOM_UI_OPTIONS_ABOUT_PAGE_HANDLER_H_ #define CHROME_BROWSER_DOM_UI_OPTIONS_ABOUT_PAGE_HANDLER_H_ +#pragma once -#include <string> - -#include "chrome/browser/dom_ui/options/options_ui.h" - -#if defined(OS_CHROMEOS) -#include "chrome/browser/chromeos/cros/update_library.h" -#include "chrome/browser/chromeos/version_loader.h" -#endif - -// ChromeOS about page UI handler. -class AboutPageHandler : public OptionsPageUIHandler { - public: - AboutPageHandler(); - virtual ~AboutPageHandler(); - - // OptionsUIHandler implementation. - virtual void GetLocalizedValues(DictionaryValue* localized_strings); - virtual void RegisterMessages(); - - private: - // The function is called from JavaScript when the about page is ready. - void PageReady(const ListValue* args); - - // The function is called from JavaScript to set the release track like - // "beta-channel" and "dev-channel". - void SetReleaseTrack(const ListValue* args); - -#if defined(OS_CHROMEOS) - // Initiates update check. - void CheckNow(const ListValue* args); - - // Restarts the system. - void RestartNow(const ListValue* args); - - // Callback from chromeos::VersionLoader giving the version. - void OnOSVersion(chromeos::VersionLoader::Handle handle, - std::string version); - void UpdateStatus(const chromeos::UpdateLibrary::Status& status); - - // Handles asynchronously loading the version. - chromeos::VersionLoader loader_; - - // Used to request the version. - CancelableRequestConsumer consumer_; - - // Update Observer - class UpdateObserver; - scoped_ptr<UpdateObserver> update_observer_; - - int progress_; - bool sticky_; - bool started_; -#endif - - DISALLOW_COPY_AND_ASSIGN(AboutPageHandler); -}; +#include "chrome/browser/webui/options/about_page_handler.h" +// TODO(tfarina): remove this file once all includes have been updated. #endif // CHROME_BROWSER_DOM_UI_OPTIONS_ABOUT_PAGE_HANDLER_H_ diff --git a/chrome/browser/dom_ui/options/add_startup_page_handler.h b/chrome/browser/dom_ui/options/add_startup_page_handler.h index da87a82..e251bcf 100644 --- a/chrome/browser/dom_ui/options/add_startup_page_handler.h +++ b/chrome/browser/dom_ui/options/add_startup_page_handler.h @@ -6,38 +6,7 @@ #define CHROME_BROWSER_DOM_UI_OPTIONS_ADD_STARTUP_PAGE_HANDLER_H_ #pragma once -#include "base/basictypes.h" -#include "chrome/browser/dom_ui/options/options_ui.h" -#include "ui/base/models/table_model_observer.h" - -class PossibleURLModel; - -// Chrome personal options page UI handler. -class AddStartupPageHandler : public OptionsPageUIHandler, - public ui::TableModelObserver { - public: - AddStartupPageHandler(); - virtual ~AddStartupPageHandler(); - - // OptionsPageUIHandler implementation. - virtual void Initialize(); - virtual void GetLocalizedValues(DictionaryValue* localized_strings); - virtual void RegisterMessages(); - - // ui::TableModelObserver implementation. - virtual void OnModelChanged(); - virtual void OnItemsChanged(int start, int length); - virtual void OnItemsAdded(int start, int length); - virtual void OnItemsRemoved(int start, int length); - - private: - // Request to update the text field with the URL of the recent page at the - // given index, formatted for user input. Called from WebUI. - void UpdateFieldWithRecentPage(const ListValue* args); - - scoped_ptr<PossibleURLModel> url_table_model_; - - DISALLOW_COPY_AND_ASSIGN(AddStartupPageHandler); -}; +#include "chrome/browser/webui/options/add_startup_page_handler.h" +// TODO(tfarina): remove this file once all includes have been updated. #endif // CHROME_BROWSER_DOM_UI_OPTIONS_ADD_STARTUP_PAGE_HANDLER_H_ diff --git a/chrome/browser/dom_ui/options/advanced_options_handler.h b/chrome/browser/dom_ui/options/advanced_options_handler.h index 22ceebe..4b61de1 100644 --- a/chrome/browser/dom_ui/options/advanced_options_handler.h +++ b/chrome/browser/dom_ui/options/advanced_options_handler.h @@ -6,178 +6,7 @@ #define CHROME_BROWSER_DOM_UI_OPTIONS_ADVANCED_OPTIONS_HANDLER_H_ #pragma once -#include "chrome/browser/dom_ui/options/options_ui.h" -#include "chrome/browser/prefs/pref_member.h" -#include "chrome/browser/prefs/pref_set_observer.h" -#include "chrome/browser/printing/cloud_print/cloud_print_setup_flow.h" -#include "chrome/browser/remoting/remoting_options_handler.h" -#include "chrome/browser/ui/shell_dialogs.h" - -class OptionsManagedBannerHandler; - -// Chrome advanced options page UI handler. -class AdvancedOptionsHandler - : public OptionsPageUIHandler, - public SelectFileDialog::Listener, - public CloudPrintSetupFlow::Delegate { - public: - AdvancedOptionsHandler(); - virtual ~AdvancedOptionsHandler(); - - // OptionsUIHandler implementation. - virtual void GetLocalizedValues(DictionaryValue* localized_strings); - virtual void Initialize(); - - // WebUIMessageHandler implementation. - virtual WebUIMessageHandler* Attach(WebUI* web_ui); - virtual void RegisterMessages(); - - // NotificationObserver implementation. - virtual void Observe(NotificationType type, - const NotificationSource& source, - const NotificationDetails& details); - - // SelectFileDialog::Listener implementation - virtual void FileSelected(const FilePath& path, int index, void* params); - - // CloudPrintSetupFlow::Delegate implementation. - virtual void OnDialogClosed(); - - private: - // Callback for the "selectDownloadLocation" message. This will prompt - // the user for a destination folder using platform-specific APIs. - void HandleSelectDownloadLocation(const ListValue* args); - - // Callback for the "promptForDownloadAction" message. This will set - // the ask for save location pref accordingly. - void HandlePromptForDownload(const ListValue* args); - - // Callback for the "autoOpenFileTypesResetToDefault" message. This will - // remove all auto-open file-type settings. - void HandleAutoOpenButton(const ListValue* args); - - // Callback for the "metricsReportingCheckboxAction" message. This is called - // if the user toggles the metrics reporting checkbox. - void HandleMetricsReportingCheckbox(const ListValue* args); - - // Callback for the "defaultFontSizeAction" message. This is called if the - // user changes the default font size. |args| is an array that contains - // one item, the font size as a numeric value. - void HandleDefaultFontSize(const ListValue* args); - -#if defined(OS_WIN) - // Callback for the "Check SSL Revocation" checkbox. This is needed so we - // can support manual handling on Windows. - void HandleCheckRevocationCheckbox(const ListValue* args); - - // Callback for the "Use SSL3" checkbox. This is needed so we can support - // manual handling on Windows. - void HandleUseSSL3Checkbox(const ListValue* args); - - // Callback for the "Use TLS1" checkbox. This is needed so we can support - // manual handling on Windows. - void HandleUseTLS1Checkbox(const ListValue* args); - - // Callback for the "Show Gears Settings" button. - void HandleShowGearsSettings(const ListValue* args); -#endif - -#if !defined(OS_CHROMEOS) - // Callback for the "showNetworkProxySettings" message. This will invoke - // an appropriate dialog for configuring proxy settings. - void ShowNetworkProxySettings(const ListValue* args); -#endif - -#if !defined(USE_NSS) - // Callback for the "showManageSSLCertificates" message. This will invoke - // an appropriate certificate management action based on the platform. - void ShowManageSSLCertificates(const ListValue* args); -#endif - -#if !defined(OS_CHROMEOS) - // Callback for the Sign in to Cloud Print button. This will start - // the authentication process. - void ShowCloudPrintSetupDialog(const ListValue* args); - - // Callback for the Disable Cloud Print button. This will sign out - // of cloud print. - void HandleDisableCloudPrintProxy(const ListValue* args); - - // Callback for the Cloud Print manage button. This will open a new - // tab pointed at the management URL. - void ShowCloudPrintManagePage(const ListValue* args); - - // Pings the service to send us it's current notion of the enabled state. - void RefreshCloudPrintStatusFromService(); - - // Setup the enabled or disabled state of the cloud print proxy - // management UI. - void SetupCloudPrintProxySection(); - - // Remove cloud print proxy section if cloud print proxy management UI is - // disabled. - void RemoveCloudPrintProxySection(); - -#endif - -#if defined(ENABLE_REMOTING) && !defined(OS_CHROMEOS) - // Removes remoting section. Called if remoting is not enabled. - void RemoveRemotingSection(); - - // Callback for Setup Remoting button. - void ShowRemotingSetupDialog(const ListValue* args); - - // Disable Remoting. - void DisableRemoting(const ListValue* args); -#endif - - // Setup the checked state for the metrics reporting checkbox. - void SetupMetricsReportingCheckbox(); - - // Setup the visibility for the metrics reporting setting. - void SetupMetricsReportingSettingVisibility(); - - void SetupFontSizeLabel(); - - // Setup the download path based on user preferences. - void SetupDownloadLocationPath(); - - // Setup the pref whether to prompt for download location every time. - void SetupPromptForDownload(); - - // Setup the enabled state of the reset button. - void SetupAutoOpenFileTypesDisabledAttribute(); - - // Setup the proxy settings section UI. - void SetupProxySettingsSection(); - -#if defined(OS_WIN) - // Setup the checked state for SSL related checkboxes. - void SetupSSLConfigSettings(); -#endif - - scoped_refptr<SelectFileDialog> select_folder_dialog_; - -#if !defined(OS_CHROMEOS) - BooleanPrefMember enable_metrics_recording_; - StringPrefMember cloud_print_proxy_email_; - BooleanPrefMember cloud_print_proxy_enabled_; - bool cloud_print_proxy_ui_enabled_; -#endif - -#if defined(ENABLE_REMOTING) && !defined(OS_CHROMEOS) - remoting::RemotingOptionsHandler remoting_options_handler_; -#endif - - FilePathPrefMember default_download_location_; - BooleanPrefMember ask_for_save_location_; - StringPrefMember auto_open_files_; - IntegerPrefMember default_font_size_; - IntegerPrefMember default_fixed_font_size_; - scoped_ptr<PrefSetObserver> proxy_prefs_; - scoped_ptr<OptionsManagedBannerHandler> banner_handler_; - - DISALLOW_COPY_AND_ASSIGN(AdvancedOptionsHandler); -}; +#include "chrome/browser/webui/options/advanced_options_handler.h" +// TODO(tfarina): remove this file once all includes have been updated. #endif // CHROME_BROWSER_DOM_UI_OPTIONS_ADVANCED_OPTIONS_HANDLER_H_ diff --git a/chrome/browser/dom_ui/options/advanced_options_utils.h b/chrome/browser/dom_ui/options/advanced_options_utils.h index a60f89f..7e9507c 100644 --- a/chrome/browser/dom_ui/options/advanced_options_utils.h +++ b/chrome/browser/dom_ui/options/advanced_options_utils.h @@ -1,25 +1,12 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef CHROME_BROWSER_DOM_UI_OPTIONS_ADVANCED_OPTIONS_UTILS_H_ #define CHROME_BROWSER_DOM_UI_OPTIONS_ADVANCED_OPTIONS_UTILS_H_ +#pragma once -#include "base/basictypes.h" - -class TabContents; - -// Chrome advanced options utility methods. -class AdvancedOptionsUtilities { - public: - // Invoke UI for network proxy settings. - static void ShowNetworkProxySettings(TabContents*); - - // Invoke UI for SSL certificates. - static void ShowManageSSLCertificates(TabContents*); - - private: - DISALLOW_IMPLICIT_CONSTRUCTORS(AdvancedOptionsUtilities); -}; +#include "chrome/browser/webui/options/advanced_options_utils.h" +// TODO(tfarina): remove this file once all includes have been updated. #endif // CHROME_BROWSER_DOM_UI_OPTIONS_ADVANCED_OPTIONS_UTILS_H_ diff --git a/chrome/browser/dom_ui/options/autofill_options_handler.h b/chrome/browser/dom_ui/options/autofill_options_handler.h index 52de3e2..26a7bfd 100644 --- a/chrome/browser/dom_ui/options/autofill_options_handler.h +++ b/chrome/browser/dom_ui/options/autofill_options_handler.h @@ -4,75 +4,9 @@ #ifndef CHROME_BROWSER_DOM_UI_OPTIONS_AUTOFILL_OPTIONS_HANDLER_H_ #define CHROME_BROWSER_DOM_UI_OPTIONS_AUTOFILL_OPTIONS_HANDLER_H_ +#pragma once -#include <string> - -#include "chrome/browser/autofill/personal_data_manager.h" -#include "chrome/browser/dom_ui/options/options_ui.h" - -class DictionaryValue; -class ListValue; - -class AutoFillOptionsHandler : public OptionsPageUIHandler, - public PersonalDataManager::Observer { - public: - AutoFillOptionsHandler(); - virtual ~AutoFillOptionsHandler(); - - // OptionsUIHandler implementation. - virtual void GetLocalizedValues(DictionaryValue* localized_strings); - virtual void Initialize(); - virtual void RegisterMessages(); - - // PersonalDataManager::Observer implementation. - virtual void OnPersonalDataLoaded(); - virtual void OnPersonalDataChanged(); - - private: - // Loads the strings for the address and credit card overlays. - void SetAddressOverlayStrings(DictionaryValue* localized_strings); - void SetCreditCardOverlayStrings(DictionaryValue* localized_strings); - - // Loads AutoFill addresses and credit cards using the PersonalDataManager. - void LoadAutoFillData(); - - // Removes an address from the PersonalDataManager. - // |args| - A string, the GUID of the address to remove. - void RemoveAddress(const ListValue* args); - - // Removes a credit card from the PersonalDataManager. - // |args| - A string, the GUID of the credit card to remove. - void RemoveCreditCard(const ListValue* args); - - // Requests profile data for a specific address. Calls into WebUI with the - // loaded profile data to open the address editor. - // |args| - A string, the GUID of the address to load. - void LoadAddressEditor(const ListValue* args); - - // Requests profile data for a specific credit card. Calls into WebUI with the - // loaded profile data to open the credit card editor. - // |args| - A string, the GUID of the credit card to load. - void LoadCreditCardEditor(const ListValue* args); - - // Adds or updates an address, depending on the GUID of the profile. If the - // GUID is empty, a new address is added to the WebDatabase; otherwise, the - // address with the matching GUID is updated. Called from WebUI. - // |args| - an array containing the GUID of the address followed by the - // address data. - void SetAddress(const ListValue* args); - - // Adds or updates a credit card, depending on the GUID of the profile. If the - // GUID is empty, a new credit card is added to the WebDatabase; otherwise, - // the credit card with the matching GUID is updated. Called from WebUI. - // |args| - an array containing the GUID of the credit card followed by the - // credit card data. - void SetCreditCard(const ListValue* args); - - // The personal data manager, used to load AutoFill profiles and credit cards. - // Unowned pointer, may not be NULL. - PersonalDataManager* personal_data_; - - DISALLOW_COPY_AND_ASSIGN(AutoFillOptionsHandler); -}; +#include "chrome/browser/webui/options/autofill_options_handler.h" +// TODO(tfarina): remove this file once all includes have been updated. #endif // CHROME_BROWSER_DOM_UI_OPTIONS_AUTOFILL_OPTIONS_HANDLER_H_ diff --git a/chrome/browser/dom_ui/options/browser_options_handler.h b/chrome/browser/dom_ui/options/browser_options_handler.h index be174dd..cef9920 100644 --- a/chrome/browser/dom_ui/options/browser_options_handler.h +++ b/chrome/browser/dom_ui/options/browser_options_handler.h @@ -6,107 +6,7 @@ #define CHROME_BROWSER_DOM_UI_OPTIONS_BROWSER_OPTIONS_HANDLER_H_ #pragma once -#include "chrome/browser/dom_ui/options/options_ui.h" -#include "chrome/browser/prefs/pref_member.h" -#include "chrome/browser/search_engines/template_url_model_observer.h" -#include "chrome/browser/shell_integration.h" -#include "ui/base/models/table_model_observer.h" - -class CustomHomePagesTableModel; -class OptionsManagedBannerHandler; -class StringPrefMember; -class TemplateURLModel; - -// Chrome browser options page UI handler. -class BrowserOptionsHandler : public OptionsPageUIHandler, - public ShellIntegration::DefaultBrowserObserver, - public TemplateURLModelObserver, - public ui::TableModelObserver { - public: - BrowserOptionsHandler(); - virtual ~BrowserOptionsHandler(); - - virtual void Initialize(); - - // OptionsUIHandler implementation. - virtual void GetLocalizedValues(DictionaryValue* localized_strings); - virtual void RegisterMessages(); - - // ShellIntegration::DefaultBrowserObserver implementation. - virtual void SetDefaultBrowserUIState( - ShellIntegration::DefaultBrowserUIState state); - - // TemplateURLModelObserver implementation. - virtual void OnTemplateURLModelChanged(); - - // ui::TableModelObserver implementation. - virtual void OnModelChanged(); - virtual void OnItemsChanged(int start, int length); - virtual void OnItemsAdded(int start, int length); - virtual void OnItemsRemoved(int start, int length); - - private: - // NotificationObserver implementation. - virtual void Observe(NotificationType type, - const NotificationSource& source, - const NotificationDetails& details); - - // Sets the home page to the given string. Called from WebUI. - void SetHomePage(const ListValue* args); - - // Makes this the default browser. Called from WebUI. - void BecomeDefaultBrowser(const ListValue* args); - - // Sets the search engine at the given index to be default. Called from WebUI. - void SetDefaultSearchEngine(const ListValue* args); - - // Removes the startup page at the given indexes. Called from WebUI. - void RemoveStartupPages(const ListValue* args); - - // Adds a startup page with the given URL after the given index. - // Called from WebUI. - void AddStartupPage(const ListValue* args); - - // Changes the startup page at the given index to the given URL. - // Called from WebUI. - void EditStartupPage(const ListValue* args); - - // Sets the startup page set to the current pages. Called from WebUI. - void SetStartupPagesToCurrentPages(const ListValue* args); - - // Returns the string ID for the given default browser state. - int StatusStringIdForState(ShellIntegration::DefaultBrowserState state); - - // Gets the current default browser state, and asynchronously reports it to - // the WebUI page. - void UpdateDefaultBrowserState(); - - // Updates the UI with the given state for the default browser. - void SetDefaultBrowserUIString(int status_string_id); - - // Loads the current set of custom startup pages and reports it to the WebUI. - void UpdateStartupPages(); - - // Loads the possible default search engine list and reports it to the WebUI. - void UpdateSearchEngines(); - - // Writes the current set of startup pages to prefs. - void SaveStartupPagesPref(); - - scoped_refptr<ShellIntegration::DefaultBrowserWorker> default_browser_worker_; - - StringPrefMember homepage_; - BooleanPrefMember default_browser_policy_; - - TemplateURLModel* template_url_model_; // Weak. - - // TODO(stuartmorgan): Once there are no other clients of - // CustomHomePagesTableModel, consider changing it to something more like - // TemplateURLModel. - scoped_ptr<CustomHomePagesTableModel> startup_custom_pages_table_model_; - scoped_ptr<OptionsManagedBannerHandler> banner_handler_; - - DISALLOW_COPY_AND_ASSIGN(BrowserOptionsHandler); -}; +#include "chrome/browser/webui/options/browser_options_handler.h" +// TODO(tfarina): remove this file once all includes have been updated. #endif // CHROME_BROWSER_DOM_UI_OPTIONS_BROWSER_OPTIONS_HANDLER_H_ diff --git a/chrome/browser/dom_ui/options/certificate_manager_handler.h b/chrome/browser/dom_ui/options/certificate_manager_handler.h index 24a6169..1500337 100644 --- a/chrome/browser/dom_ui/options/certificate_manager_handler.h +++ b/chrome/browser/dom_ui/options/certificate_manager_handler.h @@ -6,156 +6,7 @@ #define CHROME_BROWSER_DOM_UI_OPTIONS_CERTIFICATE_MANAGER_HANDLER_H_ #pragma once -#include <string> - -#include "base/scoped_ptr.h" -#include "chrome/browser/cancelable_request.h" -#include "chrome/browser/certificate_manager_model.h" -#include "chrome/browser/dom_ui/options/options_ui.h" -#include "chrome/browser/ui/shell_dialogs.h" -#include "net/base/cert_database.h" -#include "ui/gfx/native_widget_types.h" - -class FileAccessProvider; - -class CertificateManagerHandler : public OptionsPageUIHandler, - public CertificateManagerModel::Observer, - public SelectFileDialog::Listener { - public: - CertificateManagerHandler(); - virtual ~CertificateManagerHandler(); - - // OptionsUIHandler implementation. - virtual void GetLocalizedValues(DictionaryValue* localized_strings); - virtual void RegisterMessages(); - - // CertificateManagerModel::Observer implementation. - virtual void CertificatesRefreshed(); - - // SelectFileDialog::Listener implementation. - virtual void FileSelected(const FilePath& path, int index, void* params); - virtual void FileSelectionCanceled(void* params); - - private: - // View certificate. - void View(const ListValue* args); - - // Edit server certificate trust values. - void EditServer(const ListValue* args); - - // Edit certificate authority trust values. The sequence goes like: - // 1. user clicks edit button -> CertificateEditCaTrustOverlay.show -> - // GetCATrust -> CertificateEditCaTrustOverlay.populateTrust - // 2. user clicks ok -> EditCATrust -> CertificateEditCaTrustOverlay.dismiss - void GetCATrust(const ListValue* args); - void EditCATrust(const ListValue* args); - - // Cleanup state stored during import or export process. - void CancelImportExportProcess(const ListValue* args); - void ImportExportCleanup(); - - // Export to PKCS #12 file. The sequence goes like: - // 1a. user click on export button -> ExportPersonal -> launches file - // selector - // 1b. user click on export all button -> ExportAllPersonal -> launches file - // selector - // 2. user selects file -> ExportPersonalFileSelected -> launches password - // dialog - // 3. user enters password -> ExportPersonalPasswordSelected -> unlock slots - // 4. slots unlocked -> ExportPersonalSlotsUnlocked -> exports to memory - // buffer -> starts async write operation - // 5. write finishes (or fails) -> ExportPersonalFileWritten - void ExportPersonal(const ListValue* args); - void ExportAllPersonal(const ListValue* args); - void ExportPersonalFileSelected(const FilePath& path); - void ExportPersonalPasswordSelected(const ListValue* args); - void ExportPersonalSlotsUnlocked(); - void ExportPersonalFileWritten(int write_errno, int bytes_written); - - // Import from PKCS #12 file. The sequence goes like: - // 1. user click on import button -> StartImportPersonal -> launches file - // selector - // 2. user selects file -> ImportPersonalFileSelected -> launches password - // dialog - // 3. user enters password -> ImportPersonalPasswordSelected -> starts async - // read operation - // 4. read operation completes -> ImportPersonalFileRead -> unlock slot - // 5. slot unlocked -> ImportPersonalSlotUnlocked attempts to - // import with previously entered password - // 6a. if import succeeds -> ImportExportCleanup - // 6b. if import fails -> show error, ImportExportCleanup - // TODO(mattm): allow retrying with different password - void StartImportPersonal(const ListValue* args); - void ImportPersonalFileSelected(const FilePath& path); - void ImportPersonalPasswordSelected(const ListValue* args); - void ImportPersonalFileRead(int read_errno, std::string data); - void ImportPersonalSlotUnlocked(); - - // Import Server certificates from file. Sequence goes like: - // 1. user clicks on import button -> ImportServer -> launches file selector - // 2. user selects file -> ImportServerFileSelected -> starts async read - // 3. read completes -> ImportServerFileRead -> parse certs -> attempt import - // 4a. if import succeeds -> ImportExportCleanup - // 4b. if import fails -> show error, ImportExportCleanup - void ImportServer(const ListValue* args); - void ImportServerFileSelected(const FilePath& path); - void ImportServerFileRead(int read_errno, std::string data); - - // Import Certificate Authorities from file. Sequence goes like: - // 1. user clicks on import button -> ImportCA -> launches file selector - // 2. user selects file -> ImportCAFileSelected -> starts async read - // 3. read completes -> ImportCAFileRead -> parse certs -> - // CertificateEditCaTrustOverlay.showImport - // 4. user clicks ok -> ImportCATrustSelected -> attempt import - // 5a. if import succeeds -> ImportExportCleanup - // 5b. if import fails -> show error, ImportExportCleanup - void ImportCA(const ListValue* args); - void ImportCAFileSelected(const FilePath& path); - void ImportCAFileRead(int read_errno, std::string data); - void ImportCATrustSelected(const ListValue* args); - - // Export a certificate. - void Export(const ListValue* args); - - // Delete certificate and private key (if any). - void Delete(const ListValue* args); - - // Populate the trees in all the tabs. - void Populate(const ListValue* args); - - // Populate the given tab's tree. - void PopulateTree(const std::string& tab_name, net::CertType type); - - // Display a WebUI error message box. - void ShowError(const std::string& title, const std::string& error) const; - - // Display a WebUI error message box for import failures. - // Depends on |selected_cert_list_| being set to the imports that we - // attempted to import. - void ShowImportErrors( - const std::string& title, - const net::CertDatabase::ImportCertFailureList& not_imported) const; - - gfx::NativeWindow GetParentWindow() const; - - // The Certificates Manager model - scoped_ptr<CertificateManagerModel> certificate_manager_model_; - - // For multi-step import or export processes, we need to store the path, - // password, etc the user chose while we wait for them to enter a password, - // wait for file to be read, etc. - FilePath file_path_; - string16 password_; - std::string file_data_; - net::CertificateList selected_cert_list_; - scoped_refptr<SelectFileDialog> select_file_dialog_; - scoped_refptr<net::CryptoModule> module_; - - // Used in reading and writing certificate files. - CancelableRequestConsumer consumer_; - scoped_refptr<FileAccessProvider> file_access_provider_; - - DISALLOW_COPY_AND_ASSIGN(CertificateManagerHandler); -}; +#include "chrome/browser/webui/options/certificate_manager_handler.h" +// TODO(tfarina): remove this file once all includes have been updated. #endif // CHROME_BROWSER_DOM_UI_OPTIONS_CERTIFICATE_MANAGER_HANDLER_H_ diff --git a/chrome/browser/dom_ui/options/clear_browser_data_handler.h b/chrome/browser/dom_ui/options/clear_browser_data_handler.h index e475eb0..873993f 100644 --- a/chrome/browser/dom_ui/options/clear_browser_data_handler.h +++ b/chrome/browser/dom_ui/options/clear_browser_data_handler.h @@ -1,4 +1,4 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -6,49 +6,7 @@ #define CHROME_BROWSER_DOM_UI_OPTIONS_CLEAR_BROWSER_DATA_HANDLER_H_ #pragma once -#include "chrome/browser/dom_ui/options/options_ui.h" -#include "chrome/browser/browsing_data_remover.h" -#include "chrome/browser/plugin_data_remover_helper.h" - -// Clear browser data handler page UI handler. -class ClearBrowserDataHandler : public OptionsPageUIHandler, - public BrowsingDataRemover::Observer { - public: - ClearBrowserDataHandler(); - virtual ~ClearBrowserDataHandler(); - - // OptionsUIHandler implementation. - virtual void Initialize(); - - virtual void GetLocalizedValues(DictionaryValue* localized_strings); - - // WebUIMessageHandler implementation. - virtual void RegisterMessages(); - - // NotificationObserver implementation. - virtual void Observe(NotificationType type, - const NotificationSource& source, - const NotificationDetails& details); - - private: - // Javascript callback to start clearing data. - void HandleClearBrowserData(const ListValue* value); - - // Updates the UI to reflect whether clearing LSO data is supported. - void UpdateClearPluginLSOData(); - - // Callback from BrowsingDataRemover. Closes the dialog. - virtual void OnBrowsingDataRemoverDone(); - - // If non-null it means removal is in progress. BrowsingDataRemover takes care - // of deleting itself when done. - BrowsingDataRemover* remover_; - - // Used for asynchronously updating the preference stating whether clearing - // LSO data is supported. - PluginDataRemoverHelper clear_plugin_lso_data_enabled_; - - DISALLOW_COPY_AND_ASSIGN(ClearBrowserDataHandler); -}; +#include "chrome/browser/webui/options/clear_browser_data_handler.h" +// TODO(tfarina): remove this file once all includes have been updated. #endif // CHROME_BROWSER_DOM_UI_OPTIONS_CLEAR_BROWSER_DATA_HANDLER_H_ diff --git a/chrome/browser/dom_ui/options/content_settings_handler.h b/chrome/browser/dom_ui/options/content_settings_handler.h index adc16db..85e67b4 100644 --- a/chrome/browser/dom_ui/options/content_settings_handler.h +++ b/chrome/browser/dom_ui/options/content_settings_handler.h @@ -6,107 +6,7 @@ #define CHROME_BROWSER_DOM_UI_OPTIONS_CONTENT_SETTINGS_HANDLER_H_ #pragma once -#include "chrome/browser/dom_ui/options/options_ui.h" -#include "chrome/browser/plugin_data_remover_helper.h" -#include "chrome/browser/prefs/pref_change_registrar.h" -#include "chrome/common/content_settings_types.h" -#include "chrome/common/notification_observer.h" -#include "chrome/common/notification_registrar.h" - -class HostContentSettingsMap; - -class ContentSettingsHandler : public OptionsPageUIHandler { - public: - ContentSettingsHandler(); - virtual ~ContentSettingsHandler(); - - // OptionsUIHandler implementation. - virtual void GetLocalizedValues(DictionaryValue* localized_strings); - - virtual void Initialize(); - - virtual void RegisterMessages(); - - // NotificationObserver implementation. - virtual void Observe(NotificationType type, - const NotificationSource& source, - const NotificationDetails& details); - - // Gets a string identifier for the group name, for use in HTML. - static std::string ContentSettingsTypeToGroupName(ContentSettingsType type); - - private: - // Functions that call into the page ----------------------------------------- - - // Updates the page with the default settings (allow, ask, block, etc.) - void UpdateSettingDefaultFromModel(ContentSettingsType type); - // Updates the state of the "Clear plugin LSO data on exit" checkbox. - void UpdateClearPluginLSOData(); - - // Clobbers and rebuilds the specific content setting type exceptions table. - void UpdateExceptionsViewFromModel(ContentSettingsType type); - // Clobbers and rebuilds all the exceptions tables in the page (both normal - // and OTR tables). - void UpdateAllExceptionsViewsFromModel(); - // As above, but only OTR tables. - void UpdateAllOTRExceptionsViewsFromModel(); - // Clobbers and rebuilds just the geolocation exception table. - void UpdateGeolocationExceptionsView(); - // Clobbers and rebuilds just the desktop notification exception table. - void UpdateNotificationExceptionsView(); - // Clobbers and rebuilds an exception table that's managed by the host content - // settings map. - void UpdateExceptionsViewFromHostContentSettingsMap(ContentSettingsType type); - // As above, but acts on the OTR table for the content setting type. - void UpdateExceptionsViewFromOTRHostContentSettingsMap( - ContentSettingsType type); - - // Callbacks used by the page ------------------------------------------------ - - // Sets the default value for a specific content type. |args| includes the - // content type and a string describing the new default the user has - // chosen. - void SetContentFilter(const ListValue* args); - - // Removes the given row from the table. The first entry in |args| is the - // content type, and the rest of the arguments depend on the content type - // to be removed. - void RemoveException(const ListValue* args); - - // Changes the value of an exception. Called after the user is done editing an - // exception. - void SetException(const ListValue* args); - - // Called to decide whether a given pattern is valid, or if it should be - // rejected. Called while the user is editing an exception pattern. - void CheckExceptionPatternValidity(const ListValue* args); - - // Sets the global 3rd party cookies pref. - void SetAllowThirdPartyCookies(const ListValue* args); - - // Utility functions --------------------------------------------------------- - - // Gets the HostContentSettingsMap for the normal profile. - HostContentSettingsMap* GetContentSettingsMap(); - - // Gets the HostContentSettingsMap for the incognito profile, or NULL if there - // is no active incognito session. - HostContentSettingsMap* GetOTRContentSettingsMap(); - - // Gets the default setting in string form. - std::string GetSettingDefaultFromModel(ContentSettingsType type); - - // Returns true if the default setting for the given content settings type - // |type| is managed. - bool GetDefaultSettingManagedFromModel(ContentSettingsType type); - - // Member variables --------------------------------------------------------- - - NotificationRegistrar notification_registrar_; - PrefChangeRegistrar pref_change_registrar_; - PluginDataRemoverHelper clear_plugin_lso_data_enabled_; - - DISALLOW_COPY_AND_ASSIGN(ContentSettingsHandler); -}; +#include "chrome/browser/webui/options/content_settings_handler.h" +// TODO(tfarina): remove this file once all includes have been updated. #endif // CHROME_BROWSER_DOM_UI_OPTIONS_CONTENT_SETTINGS_HANDLER_H_ diff --git a/chrome/browser/dom_ui/options/cookies_view_handler.h b/chrome/browser/dom_ui/options/cookies_view_handler.h index 12e52be..73810a3c 100644 --- a/chrome/browser/dom_ui/options/cookies_view_handler.h +++ b/chrome/browser/dom_ui/options/cookies_view_handler.h @@ -6,61 +6,7 @@ #define CHROME_BROWSER_DOM_UI_OPTIONS_COOKIES_VIEW_HANDLER_H_ #pragma once -#include "base/scoped_ptr.h" -#include "chrome/browser/cookies_tree_model.h" -#include "chrome/browser/dom_ui/options/options_ui.h" - -class CookiesViewHandler : public OptionsPageUIHandler, - public CookiesTreeModel::Observer { - public: - CookiesViewHandler(); - virtual ~CookiesViewHandler(); - - // OptionsUIHandler implementation. - virtual void GetLocalizedValues(DictionaryValue* localized_strings); - virtual void RegisterMessages(); - - // ui::TreeModel::Observer implementation. - virtual void TreeNodesAdded(ui::TreeModel* model, - ui::TreeModelNode* parent, - int start, - int count); - virtual void TreeNodesRemoved(ui::TreeModel* model, - ui::TreeModelNode* parent, - int start, - int count); - virtual void TreeNodeChanged(ui::TreeModel* model, ui::TreeModelNode* node) {} - virtual void TreeModelBeginBatch(CookiesTreeModel* model); - virtual void TreeModelEndBatch(CookiesTreeModel* model); - - private: - // Updates search filter for cookies tree model. - void UpdateSearchResults(const ListValue* args); - - // Remove all sites data. - void RemoveAll(const ListValue* args); - - // Remove selected sites data. - void Remove(const ListValue* args); - - // Get the tree node using the tree path info in |args| and call - // SendChildren to pass back children nodes data to WebUI. - void LoadChildren(const ListValue* args); - - // Gets tree node from given path. Return NULL if path is not valid. - CookieTreeNode* GetTreeNodeFromPath(const std::string& path); - - // Get children nodes data and pass it to 'CookiesView.loadChildren' to - // update the WebUI. - void SendChildren(CookieTreeNode* parent); - - // The Cookies Tree model - scoped_ptr<CookiesTreeModel> cookies_tree_model_; - - // Flag to indicate whether there is a batch update in progress. - bool batch_update_; - - DISALLOW_COPY_AND_ASSIGN(CookiesViewHandler); -}; +#include "chrome/browser/webui/options/cookies_view_handler.h" +// TODO(tfarina): remove this file once all includes have been updated. #endif // CHROME_BROWSER_DOM_UI_OPTIONS_COOKIES_VIEW_HANDLER_H_ diff --git a/chrome/browser/dom_ui/options/core_options_handler.h b/chrome/browser/dom_ui/options/core_options_handler.h index cc6c2c1..535aa25 100644 --- a/chrome/browser/dom_ui/options/core_options_handler.h +++ b/chrome/browser/dom_ui/options/core_options_handler.h @@ -6,103 +6,7 @@ #define CHROME_BROWSER_DOM_UI_OPTIONS_CORE_OPTIONS_HANDLER_H_ #pragma once -#include <map> -#include <string> - -#include "base/values.h" -#include "chrome/browser/dom_ui/options/options_ui.h" -#include "chrome/browser/prefs/pref_change_registrar.h" - -// Core options UI handler. -// Handles resource and JS calls common to all options sub-pages. -class CoreOptionsHandler : public OptionsPageUIHandler { - public: - CoreOptionsHandler(); - virtual ~CoreOptionsHandler(); - - // OptionsUIHandler implementation. - virtual void GetLocalizedValues(DictionaryValue* localized_strings); - virtual void Uninitialize(); - - // NotificationObserver implementation. - virtual void Observe(NotificationType type, - const NotificationSource& source, - const NotificationDetails& details); - - // WebUIMessageHandler implementation. - virtual void RegisterMessages(); - virtual WebUIMessageHandler* Attach(WebUI* web_ui); - - protected: - // Fetches a pref value of given |pref_name|. - // Note that caller owns the returned Value. - virtual Value* FetchPref(const std::string& pref_name); - - // Observes a pref of given |pref_name|. - virtual void ObservePref(const std::string& pref_name); - - // Sets a pref |value| to given |pref_name|. - virtual void SetPref(const std::string& pref_name, - const Value* value, - const std::string& metric); - - // Clears pref value for given |pref_name|. - void ClearPref(const std::string& pref_name, const std::string& metric); - - // Stops observing given preference identified by |path|. - virtual void StopObservingPref(const std::string& path); - - // Records a user metric action for the given value. - void ProcessUserMetric(const Value* value, - const std::string& metric); - - typedef std::multimap<std::string, std::wstring> PreferenceCallbackMap; - PreferenceCallbackMap pref_callback_map_; - private: - // Callback for the "coreOptionsInitialize" message. This message will - // trigger the Initialize() method of all other handlers so that final - // setup can be performed before the page is shown. - void HandleInitialize(const ListValue* args); - - // Callback for the "fetchPrefs" message. This message accepts the list of - // preference names passed as the |args| parameter (ListValue). It passes - // results dictionary of preference values by calling prefsFetched() JS method - // on the page. - void HandleFetchPrefs(const ListValue* args); - - // Callback for the "observePrefs" message. This message initiates - // notification observing for given array of preference names. - void HandleObservePrefs(const ListValue* args); - - // Callbacks for the "set<type>Pref" message. This message saves the new - // preference value. |args| is an array of parameters as follows: - // item 0 - name of the preference. - // item 1 - the value of the preference in string form. - // item 2 - name of the metric identifier (optional). - void HandleSetBooleanPref(const ListValue* args); - void HandleSetIntegerPref(const ListValue* args); - void HandleSetDoublePref(const ListValue* args); - void HandleSetStringPref(const ListValue* args); - void HandleSetListPref(const ListValue* args); - - void HandleSetPref(const ListValue* args, Value::ValueType type); - - // Callback for the "clearPref" message. This message clears a preference - // value. |args| is an array of parameters as follows: - // item 0 - name of the preference. - // item 1 - name of the metric identifier (optional). - void HandleClearPref(const ListValue* args); - - // Callback for the "coreOptionsUserMetricsAction" message. This records - // an action that should be tracked if metrics recording is enabled. |args| - // is an array that contains a single item, the name of the metric identifier. - void HandleUserMetricsAction(const ListValue* args); - - void NotifyPrefChanged(const std::string* pref_name); - - PrefChangeRegistrar registrar_; - - DISALLOW_COPY_AND_ASSIGN(CoreOptionsHandler); -}; +#include "chrome/browser/webui/options/core_options_handler.h" +// TODO(tfarina): remove this file once all includes have been updated. #endif // CHROME_BROWSER_DOM_UI_OPTIONS_CORE_OPTIONS_HANDLER_H_ diff --git a/chrome/browser/dom_ui/options/dom_options_util.h b/chrome/browser/dom_ui/options/dom_options_util.h index 9cbac39..beeebdb 100644 --- a/chrome/browser/dom_ui/options/dom_options_util.h +++ b/chrome/browser/dom_ui/options/dom_options_util.h @@ -1,4 +1,4 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -6,16 +6,7 @@ #define CHROME_BROWSER_DOM_UI_OPTIONS_DOM_OPTIONS_UTIL_H_ #pragma once -#include "base/string16.h" - -namespace dom_options_util { - -// Strips the trailing colon from a string. Used to remove the colon from -// section titles on platforms that append it. -// TODO(jhawkins): Remove this once the platform-specific options dialogs are -// removed. -string16 StripColon(const string16& str); - -} // namespace options_util +#include "chrome/browser/webui/options/dom_options_util.h" +// TODO(tfarina): remove this file once all includes have been updated. #endif // CHROME_BROWSER_DOM_UI_OPTIONS_DOM_OPTIONS_UTIL_H_ diff --git a/chrome/browser/dom_ui/options/font_settings_handler.h b/chrome/browser/dom_ui/options/font_settings_handler.h index ad7a907..dd9196b 100644 --- a/chrome/browser/dom_ui/options/font_settings_handler.h +++ b/chrome/browser/dom_ui/options/font_settings_handler.h @@ -6,39 +6,7 @@ #define CHROME_BROWSER_DOM_UI_OPTIONS_FONT_SETTINGS_HANDLER_H_ #pragma once -#include "chrome/browser/dom_ui/options/options_ui.h" -#include "chrome/browser/prefs/pref_member.h" - -// Font settings overlay page UI handler. -class FontSettingsHandler : public OptionsPageUIHandler { - public: - FontSettingsHandler(); - virtual ~FontSettingsHandler(); - - // OptionsUIHandler implementation. - virtual void GetLocalizedValues(DictionaryValue* localized_strings); - virtual void Initialize(); - - // WebUIMessageHandler implementation. - virtual WebUIMessageHandler* Attach(WebUI* web_ui); - - // NotificationObserver implementation. - virtual void Observe(NotificationType type, - const NotificationSource& source, - const NotificationDetails& details); - - private: - void SetupSerifFontSample(); - void SetupFixedFontSample(); - void SetupMinimumFontSample(); - - StringPrefMember serif_font_; - StringPrefMember fixed_font_; - IntegerPrefMember default_font_size_; - IntegerPrefMember default_fixed_font_size_; - IntegerPrefMember minimum_font_size_; - - DISALLOW_COPY_AND_ASSIGN(FontSettingsHandler); -}; +#include "chrome/browser/webui/options/font_settings_handler.h" +// TODO(tfarina): remove this file once all includes have been updated. #endif // CHROME_BROWSER_DOM_UI_OPTIONS_FONT_SETTINGS_HANDLER_H_ diff --git a/chrome/browser/dom_ui/options/font_settings_utils.h b/chrome/browser/dom_ui/options/font_settings_utils.h index 5ac232c..012c2a5 100644 --- a/chrome/browser/dom_ui/options/font_settings_utils.h +++ b/chrome/browser/dom_ui/options/font_settings_utils.h @@ -1,4 +1,4 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -6,20 +6,7 @@ #define CHROME_BROWSER_DOM_UI_OPTIONS_FONT_SETTINGS_UTILS_H_ #pragma once -#include "base/basictypes.h" - -class ListValue; -class PrefService; - -// Chrome advanced options utility methods. -class FontSettingsUtilities { - public: - static ListValue* GetFontsList(); - - static void ValidateSavedFonts(PrefService* prefs); - - private: - DISALLOW_IMPLICIT_CONSTRUCTORS(FontSettingsUtilities); -}; +#include "chrome/browser/webui/options/font_settings_utils.h" +// TODO(tfarina): remove this file once all includes have been updated. #endif // CHROME_BROWSER_DOM_UI_OPTIONS_FONT_SETTINGS_UTILS_H_ diff --git a/chrome/browser/dom_ui/options/import_data_handler.h b/chrome/browser/dom_ui/options/import_data_handler.h index bc50ad1..e2e5eee 100644 --- a/chrome/browser/dom_ui/options/import_data_handler.h +++ b/chrome/browser/dom_ui/options/import_data_handler.h @@ -1,48 +1,12 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef CHROME_BROWSER_DOM_UI_OPTIONS_IMPORT_DATA_HANDLER_H_ #define CHROME_BROWSER_DOM_UI_OPTIONS_IMPORT_DATA_HANDLER_H_ +#pragma once -#include "base/ref_counted.h" -#include "chrome/browser/dom_ui/options/options_ui.h" -#include "chrome/browser/importer/importer.h" - -// Chrome personal stuff import data overlay UI handler. -class ImportDataHandler : public OptionsPageUIHandler, - public ImporterHost::Observer, - public ImporterList::Observer { - public: - ImportDataHandler(); - virtual ~ImportDataHandler(); - - // OptionsUIHandler implementation. - virtual void GetLocalizedValues(DictionaryValue* localized_strings); - virtual void Initialize(); - - // WebUIMessageHandler implementation. - virtual void RegisterMessages(); - - private: - void ImportData(const ListValue* args); - - // ImporterHost::Observer implementation. - virtual void ImportStarted(); - virtual void ImportItemStarted(importer::ImportItem item); - virtual void ImportItemEnded(importer::ImportItem item); - virtual void ImportEnded(); - - // ImporterList::Observer implementation. - virtual void SourceProfilesLoaded(); - - scoped_refptr<ImporterList> importer_list_; - - // If non-null it means importing is in progress. ImporterHost takes care - // of deleting itself when import is complete. - ImporterHost* importer_host_; // weak - - DISALLOW_COPY_AND_ASSIGN(ImportDataHandler); -}; +#include "chrome/browser/webui/options/import_data_handler.h" +// TODO(tfarina): remove this file once all includes have been updated. #endif // CHROME_BROWSER_DOM_UI_OPTIONS_IMPORT_DATA_HANDLER_H_ diff --git a/chrome/browser/dom_ui/options/language_options_handler.h b/chrome/browser/dom_ui/options/language_options_handler.h index 1f1181c..e2448eb 100644 --- a/chrome/browser/dom_ui/options/language_options_handler.h +++ b/chrome/browser/dom_ui/options/language_options_handler.h @@ -6,38 +6,7 @@ #define CHROME_BROWSER_DOM_UI_OPTIONS_LANGUAGE_OPTIONS_HANDLER_H_ #pragma once -#include "chrome/browser/dom_ui/options/language_options_handler_common.h" - -// Language options UI page handler for non-Chrome OS platforms. For Chrome OS, -// see chromeos::CrosLanguageOptionsHandler. -class LanguageOptionsHandler : public LanguageOptionsHandlerCommon { - public: - LanguageOptionsHandler(); - virtual ~LanguageOptionsHandler(); - - // OptionsUIHandler implementation. - virtual void GetLocalizedValues(DictionaryValue* localized_strings); - - // WebUIMessageHandler implementation. - virtual void RegisterMessages(); - - // The following static method is public for ease of testing. - - // Gets the list of languages from the given input descriptors. - // The return value will look like: - // [{'code': 'fi', 'displayName': 'Finnish', 'nativeDisplayName': 'suomi'}, - // ...] - static ListValue* GetLanguageList(); - - private: - // LanguageOptionsHandlerCommon implementation. - virtual string16 GetProductName(); - virtual void SetApplicationLocale(std::string language_code); - - // Called when the restart button is clicked. - void RestartCallback(const ListValue* args); - - DISALLOW_COPY_AND_ASSIGN(LanguageOptionsHandler); -}; +#include "chrome/browser/webui/options/language_options_handler.h" +// TODO(tfarina): remove this file once all includes have been updated. #endif // CHROME_BROWSER_DOM_UI_OPTIONS_LANGUAGE_OPTIONS_HANDLER_H_ diff --git a/chrome/browser/dom_ui/options/language_options_handler_common.h b/chrome/browser/dom_ui/options/language_options_handler_common.h index 9871ce4..05c0ce7 100644 --- a/chrome/browser/dom_ui/options/language_options_handler_common.h +++ b/chrome/browser/dom_ui/options/language_options_handler_common.h @@ -6,61 +6,7 @@ #define CHROME_BROWSER_DOM_UI_OPTIONS_LANGUAGE_OPTIONS_HANDLER_COMMON_H_ #pragma once -#include "chrome/browser/dom_ui/options/options_ui.h" - -class DictionaryValue; -class ListValue; - -// The base class for language options page UI handlers. This class has code -// common to the Chrome OS and non-Chrome OS implementation of the handler. -class LanguageOptionsHandlerCommon : public OptionsPageUIHandler { - public: - LanguageOptionsHandlerCommon(); - virtual ~LanguageOptionsHandlerCommon(); - - // OptionsUIHandler implementation. - virtual void GetLocalizedValues(DictionaryValue* localized_strings); - - // DOMMessageHandler implementation. - virtual void RegisterMessages(); - - // The following static methods are public for ease of testing. - - // Gets the set of language codes that can be used as UI language. - // The return value will look like: - // {'en-US': true, 'fi': true, 'fr': true, ...} - // - // Note that true in values does not mean anything. We just use the - // dictionary as a set. - static DictionaryValue* GetUILanguageCodeSet(); - - // Gets the set of language codes that can be used for spellchecking. - // The return value will look like: - // {'en-US': true, 'fi': true, 'fr': true, ...} - // - // Note that true in values does not mean anything. We just use the - // dictionary as a set. - static DictionaryValue* GetSpellCheckLanguageCodeSet(); - - private: - // Returns the name of the product (ex. "Chrome" or "Chrome OS"). - virtual string16 GetProductName() = 0; - - // Sets the application locale. - virtual void SetApplicationLocale(std::string language_code) = 0; - - // Called when the language options is opened. - void LanguageOptionsOpenCallback(const ListValue* args); - - // Called when the UI language is changed. - // |args| will contain the language code as string (ex. "fr"). - void UiLanguageChangeCallback(const ListValue* args); - - // Called when the spell check language is changed. - // |args| will contain the language code as string (ex. "fr"). - void SpellCheckLanguageChangeCallback(const ListValue* args); - - DISALLOW_COPY_AND_ASSIGN(LanguageOptionsHandlerCommon); -}; +#include "chrome/browser/webui/options/language_options_handler_common.h" +// TODO(tfarina): remove this file once all includes have been updated. #endif // CHROME_BROWSER_DOM_UI_OPTIONS_LANGUAGE_OPTIONS_HANDLER_COMMON_H_ diff --git a/chrome/browser/dom_ui/options/options_managed_banner_handler.h b/chrome/browser/dom_ui/options/options_managed_banner_handler.h index 49047df..c7422ca 100644 --- a/chrome/browser/dom_ui/options/options_managed_banner_handler.h +++ b/chrome/browser/dom_ui/options/options_managed_banner_handler.h @@ -6,34 +6,7 @@ #define CHROME_BROWSER_DOM_UI_OPTIONS_OPTIONS_MANAGED_BANNER_HANDLER_H_ #pragma once -#include "base/string16.h" -#include "chrome/browser/policy/managed_prefs_banner_base.h" -#include "chrome/browser/ui/options/options_window.h" - -class WebUI; - -// Managed options banner handler. -// Controls the display of a banner if an options panel contains options -// that are under administator control. -class OptionsManagedBannerHandler : public policy::ManagedPrefsBannerBase { - public: - OptionsManagedBannerHandler(WebUI* web_ui, const string16& page_name, - OptionsPage page); - virtual ~OptionsManagedBannerHandler(); - - protected: - // ManagedPrefsBannerBase implementation. - virtual void OnUpdateVisibility(); - - private: - // Set the managed options banner to be visible or invisible. - void SetupBannerVisibilty(); - - WebUI* web_ui_; // weak reference to the WebUI. - string16 page_name_; // current options page name. - OptionsPage page_; // current options page value. - - DISALLOW_COPY_AND_ASSIGN(OptionsManagedBannerHandler); -}; +#include "chrome/browser/webui/options/options_managed_banner_handler.h" +// TODO(tfarina): remove this file once all includes have been updated. #endif // CHROME_BROWSER_DOM_UI_OPTIONS_OPTIONS_MANAGED_BANNER_HANDLER_H_ diff --git a/chrome/browser/dom_ui/options/options_ui.h b/chrome/browser/dom_ui/options/options_ui.h index 84928d7..c1a04eb 100644 --- a/chrome/browser/dom_ui/options/options_ui.h +++ b/chrome/browser/dom_ui/options/options_ui.h @@ -6,114 +6,7 @@ #define CHROME_BROWSER_DOM_UI_OPTIONS_OPTIONS_UI_H_ #pragma once -#include <string> - -#include "base/scoped_ptr.h" -#include "chrome/browser/webui/chrome_url_data_manager.h" -#include "chrome/browser/webui/web_ui.h" -#include "chrome/common/notification_observer.h" -#include "chrome/common/notification_registrar.h" -#include "chrome/common/notification_type.h" - -class GURL; -class PrefService; -struct UserMetricsAction; - -class OptionsUIHTMLSource : public ChromeURLDataManager::DataSource { - public: - // The constructor takes over ownership of |localized_strings|. - explicit OptionsUIHTMLSource(DictionaryValue* localized_strings); - virtual ~OptionsUIHTMLSource(); - - // Called when the network layer has requested a resource underneath - // the path we registered. - virtual void StartDataRequest(const std::string& path, - bool is_off_the_record, - int request_id); - virtual std::string GetMimeType(const std::string&) const; - - private: - // Localized strings collection. - scoped_ptr<DictionaryValue> localized_strings_; - - DISALLOW_COPY_AND_ASSIGN(OptionsUIHTMLSource); -}; - -// The base class handler of Javascript messages of options pages. -class OptionsPageUIHandler : public WebUIMessageHandler, - public NotificationObserver { - public: - OptionsPageUIHandler(); - virtual ~OptionsPageUIHandler(); - - // Is this handler enabled? - virtual bool IsEnabled(); - - // Collects localized strings for options page. - virtual void GetLocalizedValues(DictionaryValue* localized_strings) = 0; - - // Initialize the page. Called once the DOM is available for manipulation. - // This will be called only once. - virtual void Initialize() {} - - // Uninitializes the page. Called just before the object is destructed. - virtual void Uninitialize() {} - - // WebUIMessageHandler implementation. - virtual void RegisterMessages() {} - - // NotificationObserver implementation. - virtual void Observe(NotificationType type, - const NotificationSource& source, - const NotificationDetails& details) {} - - void UserMetricsRecordAction(const UserMetricsAction& action); - - protected: - struct OptionsStringResource { - // The name of the resource in templateData. - const char* name; - // The .grd ID for the resource (IDS_*). - int id; - // True if the trailing colon should be stripped on platforms that - // don't want trailing colons. - bool strip_colon; - }; - // A helper for simplifying the process of registering strings in WebUI. - static void RegisterStrings(DictionaryValue* localized_strings, - const OptionsStringResource* resources, - size_t length); - - // Registers string resources for a page's header and tab title. - static void RegisterTitle(DictionaryValue* localized_strings, - const std::string& variable_name, - int title_id); - - NotificationRegistrar registrar_; - - private: - DISALLOW_COPY_AND_ASSIGN(OptionsPageUIHandler); -}; - -class OptionsUI : public WebUI { - public: - explicit OptionsUI(TabContents* contents); - virtual ~OptionsUI(); - - static RefCountedMemory* GetFaviconResourceBytes(); - virtual void RenderViewCreated(RenderViewHost* render_view_host); - virtual void DidBecomeActiveForReusedRenderView(); - - void InitializeHandlers(); - - private: - // Adds OptionsPageUiHandler to the handlers list if handler is enabled. - void AddOptionsPageUIHandler(DictionaryValue* localized_strings, - OptionsPageUIHandler* handler); - - bool initialized_handlers_; - - DISALLOW_COPY_AND_ASSIGN(OptionsUI); -}; +#include "chrome/browser/webui/options/options_ui.h" +// TODO(tfarina): remove this file once all includes have been updated. #endif // CHROME_BROWSER_DOM_UI_OPTIONS_OPTIONS_UI_H_ diff --git a/chrome/browser/dom_ui/options/password_manager_handler.h b/chrome/browser/dom_ui/options/password_manager_handler.h index af94e6b..787b853 100644 --- a/chrome/browser/dom_ui/options/password_manager_handler.h +++ b/chrome/browser/dom_ui/options/password_manager_handler.h @@ -4,110 +4,9 @@ #ifndef CHROME_BROWSER_DOM_UI_OPTIONS_PASSWORD_MANAGER_HANDLER_H_ #define CHROME_BROWSER_DOM_UI_OPTIONS_PASSWORD_MANAGER_HANDLER_H_ +#pragma once -#include <string> -#include <vector> - -#include "chrome/browser/dom_ui/options/options_ui.h" -#include "chrome/browser/password_manager/password_store.h" - -class PasswordManagerHandler : public OptionsPageUIHandler { - public: - PasswordManagerHandler(); - virtual ~PasswordManagerHandler(); - - // OptionsUIHandler implementation. - virtual void GetLocalizedValues(DictionaryValue* localized_strings); - - virtual void Initialize(); - - virtual void RegisterMessages(); - - private: - // The password store associated with the currently active profile. - PasswordStore* GetPasswordStore(); - - // Called when the JS PasswordManager object is initialized. - void UpdatePasswordLists(const ListValue* args); - - // Remove an entry. - // @param value the entry index to be removed. - void RemoveSavedPassword(const ListValue* args); - - // Remove an password exception. - // @param value the entry index to be removed. - void RemovePasswordException(const ListValue* args); - - // Remove all saved passwords - void RemoveAllSavedPasswords(const ListValue* args); - - // Remove All password exceptions - void RemoveAllPasswordExceptions(const ListValue* args); - - // Get password value for the selected entry. - // @param value the selected entry index. - void ShowSelectedPassword(const ListValue* args); - - // Sets the password and exception list contents to the given data. - // We take ownership of the PasswordForms in the vector. - void SetPasswordList(); - void SetPasswordExceptionList(); - - // A short class to mediate requests to the password store. - class ListPopulater : public PasswordStoreConsumer { - public: - explicit ListPopulater(PasswordManagerHandler* page); - virtual ~ListPopulater(); - - // Send a query to the password store to populate a list. - virtual void Populate() = 0; - - // Send the password store's reply back to the handler. - virtual void OnPasswordStoreRequestDone( - int handle, const std::vector<webkit_glue::PasswordForm*>& result) = 0; - - protected: - PasswordManagerHandler* page_; - int pending_login_query_; - }; - - // A short class to mediate requests to the password store for passwordlist. - class PasswordListPopulater : public ListPopulater { - public: - explicit PasswordListPopulater(PasswordManagerHandler* page); - - // Send a query to the password store to populate a password list. - virtual void Populate(); - - // Send the password store's reply back to the handler. - virtual void OnPasswordStoreRequestDone( - int handle, const std::vector<webkit_glue::PasswordForm*>& result); - }; - - // A short class to mediate requests to the password store for exceptions. - class PasswordExceptionListPopulater : public ListPopulater { - public: - explicit PasswordExceptionListPopulater(PasswordManagerHandler* page); - - // Send a query to the password store to populate a passwordException list. - virtual void Populate(); - - // Send the password store's reply back to the handler. - virtual void OnPasswordStoreRequestDone( - int handle, const std::vector<webkit_glue::PasswordForm*>& result); - }; - - // Password store consumer for populating the password list and exceptions. - PasswordListPopulater populater_; - PasswordExceptionListPopulater exception_populater_; - - std::vector<webkit_glue::PasswordForm*> password_list_; - std::vector<webkit_glue::PasswordForm*> password_exception_list_; - - // User's pref - std::string languages_; - - DISALLOW_COPY_AND_ASSIGN(PasswordManagerHandler); -}; +#include "chrome/browser/webui/options/password_manager_handler.h" +// TODO(tfarina): remove this file once all includes have been updated. #endif // CHROME_BROWSER_DOM_UI_OPTIONS_PASSWORD_MANAGER_HANDLER_H_ diff --git a/chrome/browser/dom_ui/options/personal_options_handler.h b/chrome/browser/dom_ui/options/personal_options_handler.h index 0340f79..92e9e29 100644 --- a/chrome/browser/dom_ui/options/personal_options_handler.h +++ b/chrome/browser/dom_ui/options/personal_options_handler.h @@ -6,61 +6,7 @@ #define CHROME_BROWSER_DOM_UI_OPTIONS_PERSONAL_OPTIONS_HANDLER_H_ #pragma once -#include "base/basictypes.h" -#include "chrome/browser/browser_signin.h" -#include "chrome/browser/dom_ui/options/options_ui.h" -#include "chrome/browser/sync/profile_sync_service.h" - -class OptionsManagedBannerHandler; - -// Chrome personal options page UI handler. -class PersonalOptionsHandler : public OptionsPageUIHandler, - public ProfileSyncServiceObserver, - public BrowserSignin::SigninDelegate { - public: - PersonalOptionsHandler(); - virtual ~PersonalOptionsHandler(); - - // OptionsUIHandler implementation. - virtual void GetLocalizedValues(DictionaryValue* localized_strings); - virtual void Initialize(); - - // WebUIMessageHandler implementation. - virtual void RegisterMessages(); - - // NotificationObserver implementation. - virtual void Observe(NotificationType type, - const NotificationSource& source, - const NotificationDetails& details); - - // ProfileSyncServiceObserver implementation. - virtual void OnStateChanged(); - - // BrowserSignin::SigninDelegate implementation. - virtual void OnLoginSuccess(); - virtual void OnLoginFailure(const GoogleServiceAuthError& error); - - private: - void ObserveThemeChanged(); - void ShowSyncActionDialog(const ListValue* args); - void ShowSyncLoginDialog(const ListValue* args); - void ShowCustomizeSyncDialog(const ListValue* args); - void ThemesReset(const ListValue* args); -#if defined(TOOLKIT_GTK) - void ThemesSetGTK(const ListValue* args); -#endif - - // Called when the user updates the set of enabled data types to sync. |args| - // is ignored. - void OnPreferredDataTypesUpdated(const ListValue* args); - -#if defined(OS_CHROMEOS) - void LoadAccountPicture(const ListValue* args); -#endif - - scoped_ptr<OptionsManagedBannerHandler> banner_handler_; - - DISALLOW_COPY_AND_ASSIGN(PersonalOptionsHandler); -}; +#include "chrome/browser/webui/options/personal_options_handler.h" +// TODO(tfarina): remove this file once all includes have been updated. #endif // CHROME_BROWSER_DOM_UI_OPTIONS_PERSONAL_OPTIONS_HANDLER_H_ diff --git a/chrome/browser/dom_ui/options/search_engine_manager_handler.h b/chrome/browser/dom_ui/options/search_engine_manager_handler.h index 1a87cc6..f391f51 100644 --- a/chrome/browser/dom_ui/options/search_engine_manager_handler.h +++ b/chrome/browser/dom_ui/options/search_engine_manager_handler.h @@ -4,70 +4,9 @@ #ifndef CHROME_BROWSER_DOM_UI_OPTIONS_SEARCH_ENGINE_MANAGER_HANDLER_H_ #define CHROME_BROWSER_DOM_UI_OPTIONS_SEARCH_ENGINE_MANAGER_HANDLER_H_ +#pragma once -#include "chrome/browser/dom_ui/options/options_ui.h" -#include "chrome/browser/search_engines/edit_search_engine_controller.h" -#include "ui/base/models/table_model_observer.h" - -class KeywordEditorController; - -class SearchEngineManagerHandler : public OptionsPageUIHandler, - public ui::TableModelObserver, - public EditSearchEngineControllerDelegate { - public: - SearchEngineManagerHandler(); - virtual ~SearchEngineManagerHandler(); - - virtual void Initialize(); - - // OptionsUIHandler implementation. - virtual void GetLocalizedValues(DictionaryValue* localized_strings); - - // ui::TableModelObserver implementation. - virtual void OnModelChanged(); - virtual void OnItemsChanged(int start, int length); - virtual void OnItemsAdded(int start, int length); - virtual void OnItemsRemoved(int start, int length); - - // EditSearchEngineControllerDelegate implementation. - virtual void OnEditedKeyword(const TemplateURL* template_url, - const string16& title, - const string16& keyword, - const std::string& url); - - virtual void RegisterMessages(); - - private: - scoped_ptr<KeywordEditorController> list_controller_; - scoped_ptr<EditSearchEngineController> edit_controller_; - - // Removes the search engine at the given index. Called from WebUI. - void RemoveSearchEngine(const ListValue* args); - - // Sets the search engine at the given index to be default. Called from WebUI. - void SetDefaultSearchEngine(const ListValue* args); - - // Starts an edit session for the search engine at the given index. If the - // index is -1, starts editing a new search engine instead of an existing one. - // Called from WebUI. - void EditSearchEngine(const ListValue* args); - - // Validates the given search engine values, and reports the results back - // to WebUI. Called from WebUI. - void CheckSearchEngineInfoValidity(const ListValue* args); - - // Called when an edit is cancelled. - // Called from WebUI. - void EditCancelled(const ListValue* args); - - // Called when an edit is finished and should be saved. - // Called from WebUI. - void EditCompleted(const ListValue* args); - - // Returns a dictionary to pass to WebUI representing the given search engine. - DictionaryValue* CreateDictionaryForEngine(int index, bool is_default); - - DISALLOW_COPY_AND_ASSIGN(SearchEngineManagerHandler); -}; +#include "chrome/browser/webui/options/search_engine_manager_handler.h" +// TODO(tfarina): remove this file once all includes have been updated. #endif // CHROME_BROWSER_DOM_UI_OPTIONS_SEARCH_ENGINE_MANAGER_HANDLER_H_ diff --git a/chrome/browser/dom_ui/options/stop_syncing_handler.h b/chrome/browser/dom_ui/options/stop_syncing_handler.h index f586556..cd69363 100644 --- a/chrome/browser/dom_ui/options/stop_syncing_handler.h +++ b/chrome/browser/dom_ui/options/stop_syncing_handler.h @@ -1,28 +1,12 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef CHROME_BROWSER_DOM_UI_OPTIONS_STOP_SYNCING_HANDLER_H_ #define CHROME_BROWSER_DOM_UI_OPTIONS_STOP_SYNCING_HANDLER_H_ +#pragma once -#include "chrome/browser/dom_ui/options/options_ui.h" - -// Chrome personal stuff stop syncing overlay UI handler. -class StopSyncingHandler : public OptionsPageUIHandler { - public: - StopSyncingHandler(); - virtual ~StopSyncingHandler(); - - // OptionsUIHandler implementation. - virtual void GetLocalizedValues(DictionaryValue* localized_strings); - - // WebUIMessageHandler implementation. - virtual void RegisterMessages(); - - private: - void StopSyncing(const ListValue* args); - - DISALLOW_COPY_AND_ASSIGN(StopSyncingHandler); -}; +#include "chrome/browser/webui/options/stop_syncing_handler.h" +// TODO(tfarina): remove this file once all includes have been updated. #endif // CHROME_BROWSER_DOM_UI_OPTIONS_STOP_SYNCING_HANDLER_H_ diff --git a/chrome/browser/dom_ui/options/OWNERS b/chrome/browser/webui/options/OWNERS index 67257e6..67257e6 100644 --- a/chrome/browser/dom_ui/options/OWNERS +++ b/chrome/browser/webui/options/OWNERS diff --git a/chrome/browser/dom_ui/options/about_page_handler.cc b/chrome/browser/webui/options/about_page_handler.cc index 703d1f9..703d1f9 100644 --- a/chrome/browser/dom_ui/options/about_page_handler.cc +++ b/chrome/browser/webui/options/about_page_handler.cc diff --git a/chrome/browser/webui/options/about_page_handler.h b/chrome/browser/webui/options/about_page_handler.h new file mode 100644 index 0000000..96ec69c --- /dev/null +++ b/chrome/browser/webui/options/about_page_handler.h @@ -0,0 +1,65 @@ +// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CHROME_BROWSER_WEBUI_OPTIONS_ABOUT_PAGE_HANDLER_H_ +#define CHROME_BROWSER_WEBUI_OPTIONS_ABOUT_PAGE_HANDLER_H_ + +#include <string> + +#include "chrome/browser/dom_ui/options/options_ui.h" + +#if defined(OS_CHROMEOS) +#include "chrome/browser/chromeos/cros/update_library.h" +#include "chrome/browser/chromeos/version_loader.h" +#endif + +// ChromeOS about page UI handler. +class AboutPageHandler : public OptionsPageUIHandler { + public: + AboutPageHandler(); + virtual ~AboutPageHandler(); + + // OptionsUIHandler implementation. + virtual void GetLocalizedValues(DictionaryValue* localized_strings); + virtual void RegisterMessages(); + + private: + // The function is called from JavaScript when the about page is ready. + void PageReady(const ListValue* args); + + // The function is called from JavaScript to set the release track like + // "beta-channel" and "dev-channel". + void SetReleaseTrack(const ListValue* args); + +#if defined(OS_CHROMEOS) + // Initiates update check. + void CheckNow(const ListValue* args); + + // Restarts the system. + void RestartNow(const ListValue* args); + + // Callback from chromeos::VersionLoader giving the version. + void OnOSVersion(chromeos::VersionLoader::Handle handle, + std::string version); + void UpdateStatus(const chromeos::UpdateLibrary::Status& status); + + // Handles asynchronously loading the version. + chromeos::VersionLoader loader_; + + // Used to request the version. + CancelableRequestConsumer consumer_; + + // Update Observer + class UpdateObserver; + scoped_ptr<UpdateObserver> update_observer_; + + int progress_; + bool sticky_; + bool started_; +#endif + + DISALLOW_COPY_AND_ASSIGN(AboutPageHandler); +}; + +#endif // CHROME_BROWSER_WEBUI_OPTIONS_ABOUT_PAGE_HANDLER_H_ diff --git a/chrome/browser/dom_ui/options/add_startup_page_handler.cc b/chrome/browser/webui/options/add_startup_page_handler.cc index 9ecf5d0..9ecf5d0 100644 --- a/chrome/browser/dom_ui/options/add_startup_page_handler.cc +++ b/chrome/browser/webui/options/add_startup_page_handler.cc diff --git a/chrome/browser/webui/options/add_startup_page_handler.h b/chrome/browser/webui/options/add_startup_page_handler.h new file mode 100644 index 0000000..3cc915f --- /dev/null +++ b/chrome/browser/webui/options/add_startup_page_handler.h @@ -0,0 +1,43 @@ +// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CHROME_BROWSER_WEBUI_OPTIONS_ADD_STARTUP_PAGE_HANDLER_H_ +#define CHROME_BROWSER_WEBUI_OPTIONS_ADD_STARTUP_PAGE_HANDLER_H_ +#pragma once + +#include "base/basictypes.h" +#include "chrome/browser/dom_ui/options/options_ui.h" +#include "ui/base/models/table_model_observer.h" + +class PossibleURLModel; + +// Chrome personal options page UI handler. +class AddStartupPageHandler : public OptionsPageUIHandler, + public ui::TableModelObserver { + public: + AddStartupPageHandler(); + virtual ~AddStartupPageHandler(); + + // OptionsPageUIHandler implementation. + virtual void Initialize(); + virtual void GetLocalizedValues(DictionaryValue* localized_strings); + virtual void RegisterMessages(); + + // ui::TableModelObserver implementation. + virtual void OnModelChanged(); + virtual void OnItemsChanged(int start, int length); + virtual void OnItemsAdded(int start, int length); + virtual void OnItemsRemoved(int start, int length); + + private: + // Request to update the text field with the URL of the recent page at the + // given index, formatted for user input. Called from WebUI. + void UpdateFieldWithRecentPage(const ListValue* args); + + scoped_ptr<PossibleURLModel> url_table_model_; + + DISALLOW_COPY_AND_ASSIGN(AddStartupPageHandler); +}; + +#endif // CHROME_BROWSER_WEBUI_OPTIONS_ADD_STARTUP_PAGE_HANDLER_H_ diff --git a/chrome/browser/dom_ui/options/advanced_options_handler.cc b/chrome/browser/webui/options/advanced_options_handler.cc index 1d9152c..1d9152c 100644 --- a/chrome/browser/dom_ui/options/advanced_options_handler.cc +++ b/chrome/browser/webui/options/advanced_options_handler.cc diff --git a/chrome/browser/webui/options/advanced_options_handler.h b/chrome/browser/webui/options/advanced_options_handler.h new file mode 100644 index 0000000..f02aba5 --- /dev/null +++ b/chrome/browser/webui/options/advanced_options_handler.h @@ -0,0 +1,183 @@ +// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CHROME_BROWSER_WEBUI_OPTIONS_ADVANCED_OPTIONS_HANDLER_H_ +#define CHROME_BROWSER_WEBUI_OPTIONS_ADVANCED_OPTIONS_HANDLER_H_ +#pragma once + +#include "chrome/browser/dom_ui/options/options_ui.h" +#include "chrome/browser/prefs/pref_member.h" +#include "chrome/browser/prefs/pref_set_observer.h" +#include "chrome/browser/printing/cloud_print/cloud_print_setup_flow.h" +#include "chrome/browser/remoting/remoting_options_handler.h" +#include "chrome/browser/ui/shell_dialogs.h" + +class OptionsManagedBannerHandler; + +// Chrome advanced options page UI handler. +class AdvancedOptionsHandler + : public OptionsPageUIHandler, + public SelectFileDialog::Listener, + public CloudPrintSetupFlow::Delegate { + public: + AdvancedOptionsHandler(); + virtual ~AdvancedOptionsHandler(); + + // OptionsUIHandler implementation. + virtual void GetLocalizedValues(DictionaryValue* localized_strings); + virtual void Initialize(); + + // WebUIMessageHandler implementation. + virtual WebUIMessageHandler* Attach(WebUI* web_ui); + virtual void RegisterMessages(); + + // NotificationObserver implementation. + virtual void Observe(NotificationType type, + const NotificationSource& source, + const NotificationDetails& details); + + // SelectFileDialog::Listener implementation + virtual void FileSelected(const FilePath& path, int index, void* params); + + // CloudPrintSetupFlow::Delegate implementation. + virtual void OnDialogClosed(); + + private: + // Callback for the "selectDownloadLocation" message. This will prompt + // the user for a destination folder using platform-specific APIs. + void HandleSelectDownloadLocation(const ListValue* args); + + // Callback for the "promptForDownloadAction" message. This will set + // the ask for save location pref accordingly. + void HandlePromptForDownload(const ListValue* args); + + // Callback for the "autoOpenFileTypesResetToDefault" message. This will + // remove all auto-open file-type settings. + void HandleAutoOpenButton(const ListValue* args); + + // Callback for the "metricsReportingCheckboxAction" message. This is called + // if the user toggles the metrics reporting checkbox. + void HandleMetricsReportingCheckbox(const ListValue* args); + + // Callback for the "defaultFontSizeAction" message. This is called if the + // user changes the default font size. |args| is an array that contains + // one item, the font size as a numeric value. + void HandleDefaultFontSize(const ListValue* args); + +#if defined(OS_WIN) + // Callback for the "Check SSL Revocation" checkbox. This is needed so we + // can support manual handling on Windows. + void HandleCheckRevocationCheckbox(const ListValue* args); + + // Callback for the "Use SSL3" checkbox. This is needed so we can support + // manual handling on Windows. + void HandleUseSSL3Checkbox(const ListValue* args); + + // Callback for the "Use TLS1" checkbox. This is needed so we can support + // manual handling on Windows. + void HandleUseTLS1Checkbox(const ListValue* args); + + // Callback for the "Show Gears Settings" button. + void HandleShowGearsSettings(const ListValue* args); +#endif + +#if !defined(OS_CHROMEOS) + // Callback for the "showNetworkProxySettings" message. This will invoke + // an appropriate dialog for configuring proxy settings. + void ShowNetworkProxySettings(const ListValue* args); +#endif + +#if !defined(USE_NSS) + // Callback for the "showManageSSLCertificates" message. This will invoke + // an appropriate certificate management action based on the platform. + void ShowManageSSLCertificates(const ListValue* args); +#endif + +#if !defined(OS_CHROMEOS) + // Callback for the Sign in to Cloud Print button. This will start + // the authentication process. + void ShowCloudPrintSetupDialog(const ListValue* args); + + // Callback for the Disable Cloud Print button. This will sign out + // of cloud print. + void HandleDisableCloudPrintProxy(const ListValue* args); + + // Callback for the Cloud Print manage button. This will open a new + // tab pointed at the management URL. + void ShowCloudPrintManagePage(const ListValue* args); + + // Pings the service to send us it's current notion of the enabled state. + void RefreshCloudPrintStatusFromService(); + + // Setup the enabled or disabled state of the cloud print proxy + // management UI. + void SetupCloudPrintProxySection(); + + // Remove cloud print proxy section if cloud print proxy management UI is + // disabled. + void RemoveCloudPrintProxySection(); + +#endif + +#if defined(ENABLE_REMOTING) && !defined(OS_CHROMEOS) + // Removes remoting section. Called if remoting is not enabled. + void RemoveRemotingSection(); + + // Callback for Setup Remoting button. + void ShowRemotingSetupDialog(const ListValue* args); + + // Disable Remoting. + void DisableRemoting(const ListValue* args); +#endif + + // Setup the checked state for the metrics reporting checkbox. + void SetupMetricsReportingCheckbox(); + + // Setup the visibility for the metrics reporting setting. + void SetupMetricsReportingSettingVisibility(); + + void SetupFontSizeLabel(); + + // Setup the download path based on user preferences. + void SetupDownloadLocationPath(); + + // Setup the pref whether to prompt for download location every time. + void SetupPromptForDownload(); + + // Setup the enabled state of the reset button. + void SetupAutoOpenFileTypesDisabledAttribute(); + + // Setup the proxy settings section UI. + void SetupProxySettingsSection(); + +#if defined(OS_WIN) + // Setup the checked state for SSL related checkboxes. + void SetupSSLConfigSettings(); +#endif + + scoped_refptr<SelectFileDialog> select_folder_dialog_; + +#if !defined(OS_CHROMEOS) + BooleanPrefMember enable_metrics_recording_; + StringPrefMember cloud_print_proxy_email_; + BooleanPrefMember cloud_print_proxy_enabled_; + bool cloud_print_proxy_ui_enabled_; +#endif + +#if defined(ENABLE_REMOTING) && !defined(OS_CHROMEOS) + remoting::RemotingOptionsHandler remoting_options_handler_; +#endif + + FilePathPrefMember default_download_location_; + BooleanPrefMember ask_for_save_location_; + StringPrefMember auto_open_files_; + IntegerPrefMember default_font_size_; + IntegerPrefMember default_fixed_font_size_; + scoped_ptr<PrefSetObserver> proxy_prefs_; + scoped_ptr<OptionsManagedBannerHandler> banner_handler_; + + DISALLOW_COPY_AND_ASSIGN(AdvancedOptionsHandler); +}; + +#endif // CHROME_BROWSER_WEBUI_OPTIONS_ADVANCED_OPTIONS_HANDLER_H_ diff --git a/chrome/browser/webui/options/advanced_options_utils.h b/chrome/browser/webui/options/advanced_options_utils.h new file mode 100644 index 0000000..312a718 --- /dev/null +++ b/chrome/browser/webui/options/advanced_options_utils.h @@ -0,0 +1,25 @@ +// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CHROME_BROWSER_WEBUI_OPTIONS_ADVANCED_OPTIONS_UTILS_H_ +#define CHROME_BROWSER_WEBUI_OPTIONS_ADVANCED_OPTIONS_UTILS_H_ + +#include "base/basictypes.h" + +class TabContents; + +// Chrome advanced options utility methods. +class AdvancedOptionsUtilities { + public: + // Invoke UI for network proxy settings. + static void ShowNetworkProxySettings(TabContents*); + + // Invoke UI for SSL certificates. + static void ShowManageSSLCertificates(TabContents*); + + private: + DISALLOW_IMPLICIT_CONSTRUCTORS(AdvancedOptionsUtilities); +}; + +#endif // CHROME_BROWSER_WEBUI_OPTIONS_ADVANCED_OPTIONS_UTILS_H_ diff --git a/chrome/browser/dom_ui/options/advanced_options_utils_gtk.cc b/chrome/browser/webui/options/advanced_options_utils_gtk.cc index 7b89b50..951e1a5 100644 --- a/chrome/browser/dom_ui/options/advanced_options_utils_gtk.cc +++ b/chrome/browser/webui/options/advanced_options_utils_gtk.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. diff --git a/chrome/browser/dom_ui/options/advanced_options_utils_mac.mm b/chrome/browser/webui/options/advanced_options_utils_mac.mm index e3bd4f7..e3bd4f7 100644 --- a/chrome/browser/dom_ui/options/advanced_options_utils_mac.mm +++ b/chrome/browser/webui/options/advanced_options_utils_mac.mm diff --git a/chrome/browser/dom_ui/options/advanced_options_utils_win.cc b/chrome/browser/webui/options/advanced_options_utils_win.cc index 7cf6f454..893cda1 100644 --- a/chrome/browser/dom_ui/options/advanced_options_utils_win.cc +++ b/chrome/browser/webui/options/advanced_options_utils_win.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. diff --git a/chrome/browser/dom_ui/options/autofill_options_handler.cc b/chrome/browser/webui/options/autofill_options_handler.cc index 32810c8..32810c8 100644 --- a/chrome/browser/dom_ui/options/autofill_options_handler.cc +++ b/chrome/browser/webui/options/autofill_options_handler.cc diff --git a/chrome/browser/webui/options/autofill_options_handler.h b/chrome/browser/webui/options/autofill_options_handler.h new file mode 100644 index 0000000..e117408 --- /dev/null +++ b/chrome/browser/webui/options/autofill_options_handler.h @@ -0,0 +1,78 @@ +// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CHROME_BROWSER_WEBUI_OPTIONS_AUTOFILL_OPTIONS_HANDLER_H_ +#define CHROME_BROWSER_WEBUI_OPTIONS_AUTOFILL_OPTIONS_HANDLER_H_ + +#include <string> + +#include "chrome/browser/autofill/personal_data_manager.h" +#include "chrome/browser/dom_ui/options/options_ui.h" + +class DictionaryValue; +class ListValue; + +class AutoFillOptionsHandler : public OptionsPageUIHandler, + public PersonalDataManager::Observer { + public: + AutoFillOptionsHandler(); + virtual ~AutoFillOptionsHandler(); + + // OptionsUIHandler implementation. + virtual void GetLocalizedValues(DictionaryValue* localized_strings); + virtual void Initialize(); + virtual void RegisterMessages(); + + // PersonalDataManager::Observer implementation. + virtual void OnPersonalDataLoaded(); + virtual void OnPersonalDataChanged(); + + private: + // Loads the strings for the address and credit card overlays. + void SetAddressOverlayStrings(DictionaryValue* localized_strings); + void SetCreditCardOverlayStrings(DictionaryValue* localized_strings); + + // Loads AutoFill addresses and credit cards using the PersonalDataManager. + void LoadAutoFillData(); + + // Removes an address from the PersonalDataManager. + // |args| - A string, the GUID of the address to remove. + void RemoveAddress(const ListValue* args); + + // Removes a credit card from the PersonalDataManager. + // |args| - A string, the GUID of the credit card to remove. + void RemoveCreditCard(const ListValue* args); + + // Requests profile data for a specific address. Calls into WebUI with the + // loaded profile data to open the address editor. + // |args| - A string, the GUID of the address to load. + void LoadAddressEditor(const ListValue* args); + + // Requests profile data for a specific credit card. Calls into WebUI with the + // loaded profile data to open the credit card editor. + // |args| - A string, the GUID of the credit card to load. + void LoadCreditCardEditor(const ListValue* args); + + // Adds or updates an address, depending on the GUID of the profile. If the + // GUID is empty, a new address is added to the WebDatabase; otherwise, the + // address with the matching GUID is updated. Called from WebUI. + // |args| - an array containing the GUID of the address followed by the + // address data. + void SetAddress(const ListValue* args); + + // Adds or updates a credit card, depending on the GUID of the profile. If the + // GUID is empty, a new credit card is added to the WebDatabase; otherwise, + // the credit card with the matching GUID is updated. Called from WebUI. + // |args| - an array containing the GUID of the credit card followed by the + // credit card data. + void SetCreditCard(const ListValue* args); + + // The personal data manager, used to load AutoFill profiles and credit cards. + // Unowned pointer, may not be NULL. + PersonalDataManager* personal_data_; + + DISALLOW_COPY_AND_ASSIGN(AutoFillOptionsHandler); +}; + +#endif // CHROME_BROWSER_WEBUI_OPTIONS_AUTOFILL_OPTIONS_HANDLER_H_ diff --git a/chrome/browser/dom_ui/options/browser_options_handler.cc b/chrome/browser/webui/options/browser_options_handler.cc index 10aa148..10aa148 100644 --- a/chrome/browser/dom_ui/options/browser_options_handler.cc +++ b/chrome/browser/webui/options/browser_options_handler.cc diff --git a/chrome/browser/webui/options/browser_options_handler.h b/chrome/browser/webui/options/browser_options_handler.h new file mode 100644 index 0000000..dba6c9a --- /dev/null +++ b/chrome/browser/webui/options/browser_options_handler.h @@ -0,0 +1,112 @@ +// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CHROME_BROWSER_WEBUI_OPTIONS_BROWSER_OPTIONS_HANDLER_H_ +#define CHROME_BROWSER_WEBUI_OPTIONS_BROWSER_OPTIONS_HANDLER_H_ +#pragma once + +#include "chrome/browser/dom_ui/options/options_ui.h" +#include "chrome/browser/prefs/pref_member.h" +#include "chrome/browser/search_engines/template_url_model_observer.h" +#include "chrome/browser/shell_integration.h" +#include "ui/base/models/table_model_observer.h" + +class CustomHomePagesTableModel; +class OptionsManagedBannerHandler; +class StringPrefMember; +class TemplateURLModel; + +// Chrome browser options page UI handler. +class BrowserOptionsHandler : public OptionsPageUIHandler, + public ShellIntegration::DefaultBrowserObserver, + public TemplateURLModelObserver, + public ui::TableModelObserver { + public: + BrowserOptionsHandler(); + virtual ~BrowserOptionsHandler(); + + virtual void Initialize(); + + // OptionsUIHandler implementation. + virtual void GetLocalizedValues(DictionaryValue* localized_strings); + virtual void RegisterMessages(); + + // ShellIntegration::DefaultBrowserObserver implementation. + virtual void SetDefaultBrowserUIState( + ShellIntegration::DefaultBrowserUIState state); + + // TemplateURLModelObserver implementation. + virtual void OnTemplateURLModelChanged(); + + // ui::TableModelObserver implementation. + virtual void OnModelChanged(); + virtual void OnItemsChanged(int start, int length); + virtual void OnItemsAdded(int start, int length); + virtual void OnItemsRemoved(int start, int length); + + private: + // NotificationObserver implementation. + virtual void Observe(NotificationType type, + const NotificationSource& source, + const NotificationDetails& details); + + // Sets the home page to the given string. Called from WebUI. + void SetHomePage(const ListValue* args); + + // Makes this the default browser. Called from WebUI. + void BecomeDefaultBrowser(const ListValue* args); + + // Sets the search engine at the given index to be default. Called from WebUI. + void SetDefaultSearchEngine(const ListValue* args); + + // Removes the startup page at the given indexes. Called from WebUI. + void RemoveStartupPages(const ListValue* args); + + // Adds a startup page with the given URL after the given index. + // Called from WebUI. + void AddStartupPage(const ListValue* args); + + // Changes the startup page at the given index to the given URL. + // Called from WebUI. + void EditStartupPage(const ListValue* args); + + // Sets the startup page set to the current pages. Called from WebUI. + void SetStartupPagesToCurrentPages(const ListValue* args); + + // Returns the string ID for the given default browser state. + int StatusStringIdForState(ShellIntegration::DefaultBrowserState state); + + // Gets the current default browser state, and asynchronously reports it to + // the WebUI page. + void UpdateDefaultBrowserState(); + + // Updates the UI with the given state for the default browser. + void SetDefaultBrowserUIString(int status_string_id); + + // Loads the current set of custom startup pages and reports it to the WebUI. + void UpdateStartupPages(); + + // Loads the possible default search engine list and reports it to the WebUI. + void UpdateSearchEngines(); + + // Writes the current set of startup pages to prefs. + void SaveStartupPagesPref(); + + scoped_refptr<ShellIntegration::DefaultBrowserWorker> default_browser_worker_; + + StringPrefMember homepage_; + BooleanPrefMember default_browser_policy_; + + TemplateURLModel* template_url_model_; // Weak. + + // TODO(stuartmorgan): Once there are no other clients of + // CustomHomePagesTableModel, consider changing it to something more like + // TemplateURLModel. + scoped_ptr<CustomHomePagesTableModel> startup_custom_pages_table_model_; + scoped_ptr<OptionsManagedBannerHandler> banner_handler_; + + DISALLOW_COPY_AND_ASSIGN(BrowserOptionsHandler); +}; + +#endif // CHROME_BROWSER_WEBUI_OPTIONS_BROWSER_OPTIONS_HANDLER_H_ diff --git a/chrome/browser/dom_ui/options/certificate_manager_handler.cc b/chrome/browser/webui/options/certificate_manager_handler.cc index a0cd4ba..a0cd4ba 100644 --- a/chrome/browser/dom_ui/options/certificate_manager_handler.cc +++ b/chrome/browser/webui/options/certificate_manager_handler.cc diff --git a/chrome/browser/webui/options/certificate_manager_handler.h b/chrome/browser/webui/options/certificate_manager_handler.h new file mode 100644 index 0000000..1065599 --- /dev/null +++ b/chrome/browser/webui/options/certificate_manager_handler.h @@ -0,0 +1,161 @@ +// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CHROME_BROWSER_WEBUI_OPTIONS_CERTIFICATE_MANAGER_HANDLER_H_ +#define CHROME_BROWSER_WEBUI_OPTIONS_CERTIFICATE_MANAGER_HANDLER_H_ +#pragma once + +#include <string> + +#include "base/scoped_ptr.h" +#include "chrome/browser/cancelable_request.h" +#include "chrome/browser/certificate_manager_model.h" +#include "chrome/browser/dom_ui/options/options_ui.h" +#include "chrome/browser/ui/shell_dialogs.h" +#include "net/base/cert_database.h" +#include "ui/gfx/native_widget_types.h" + +class FileAccessProvider; + +class CertificateManagerHandler : public OptionsPageUIHandler, + public CertificateManagerModel::Observer, + public SelectFileDialog::Listener { + public: + CertificateManagerHandler(); + virtual ~CertificateManagerHandler(); + + // OptionsUIHandler implementation. + virtual void GetLocalizedValues(DictionaryValue* localized_strings); + virtual void RegisterMessages(); + + // CertificateManagerModel::Observer implementation. + virtual void CertificatesRefreshed(); + + // SelectFileDialog::Listener implementation. + virtual void FileSelected(const FilePath& path, int index, void* params); + virtual void FileSelectionCanceled(void* params); + + private: + // View certificate. + void View(const ListValue* args); + + // Edit server certificate trust values. + void EditServer(const ListValue* args); + + // Edit certificate authority trust values. The sequence goes like: + // 1. user clicks edit button -> CertificateEditCaTrustOverlay.show -> + // GetCATrust -> CertificateEditCaTrustOverlay.populateTrust + // 2. user clicks ok -> EditCATrust -> CertificateEditCaTrustOverlay.dismiss + void GetCATrust(const ListValue* args); + void EditCATrust(const ListValue* args); + + // Cleanup state stored during import or export process. + void CancelImportExportProcess(const ListValue* args); + void ImportExportCleanup(); + + // Export to PKCS #12 file. The sequence goes like: + // 1a. user click on export button -> ExportPersonal -> launches file + // selector + // 1b. user click on export all button -> ExportAllPersonal -> launches file + // selector + // 2. user selects file -> ExportPersonalFileSelected -> launches password + // dialog + // 3. user enters password -> ExportPersonalPasswordSelected -> unlock slots + // 4. slots unlocked -> ExportPersonalSlotsUnlocked -> exports to memory + // buffer -> starts async write operation + // 5. write finishes (or fails) -> ExportPersonalFileWritten + void ExportPersonal(const ListValue* args); + void ExportAllPersonal(const ListValue* args); + void ExportPersonalFileSelected(const FilePath& path); + void ExportPersonalPasswordSelected(const ListValue* args); + void ExportPersonalSlotsUnlocked(); + void ExportPersonalFileWritten(int write_errno, int bytes_written); + + // Import from PKCS #12 file. The sequence goes like: + // 1. user click on import button -> StartImportPersonal -> launches file + // selector + // 2. user selects file -> ImportPersonalFileSelected -> launches password + // dialog + // 3. user enters password -> ImportPersonalPasswordSelected -> starts async + // read operation + // 4. read operation completes -> ImportPersonalFileRead -> unlock slot + // 5. slot unlocked -> ImportPersonalSlotUnlocked attempts to + // import with previously entered password + // 6a. if import succeeds -> ImportExportCleanup + // 6b. if import fails -> show error, ImportExportCleanup + // TODO(mattm): allow retrying with different password + void StartImportPersonal(const ListValue* args); + void ImportPersonalFileSelected(const FilePath& path); + void ImportPersonalPasswordSelected(const ListValue* args); + void ImportPersonalFileRead(int read_errno, std::string data); + void ImportPersonalSlotUnlocked(); + + // Import Server certificates from file. Sequence goes like: + // 1. user clicks on import button -> ImportServer -> launches file selector + // 2. user selects file -> ImportServerFileSelected -> starts async read + // 3. read completes -> ImportServerFileRead -> parse certs -> attempt import + // 4a. if import succeeds -> ImportExportCleanup + // 4b. if import fails -> show error, ImportExportCleanup + void ImportServer(const ListValue* args); + void ImportServerFileSelected(const FilePath& path); + void ImportServerFileRead(int read_errno, std::string data); + + // Import Certificate Authorities from file. Sequence goes like: + // 1. user clicks on import button -> ImportCA -> launches file selector + // 2. user selects file -> ImportCAFileSelected -> starts async read + // 3. read completes -> ImportCAFileRead -> parse certs -> + // CertificateEditCaTrustOverlay.showImport + // 4. user clicks ok -> ImportCATrustSelected -> attempt import + // 5a. if import succeeds -> ImportExportCleanup + // 5b. if import fails -> show error, ImportExportCleanup + void ImportCA(const ListValue* args); + void ImportCAFileSelected(const FilePath& path); + void ImportCAFileRead(int read_errno, std::string data); + void ImportCATrustSelected(const ListValue* args); + + // Export a certificate. + void Export(const ListValue* args); + + // Delete certificate and private key (if any). + void Delete(const ListValue* args); + + // Populate the trees in all the tabs. + void Populate(const ListValue* args); + + // Populate the given tab's tree. + void PopulateTree(const std::string& tab_name, net::CertType type); + + // Display a WebUI error message box. + void ShowError(const std::string& title, const std::string& error) const; + + // Display a WebUI error message box for import failures. + // Depends on |selected_cert_list_| being set to the imports that we + // attempted to import. + void ShowImportErrors( + const std::string& title, + const net::CertDatabase::ImportCertFailureList& not_imported) const; + + gfx::NativeWindow GetParentWindow() const; + + // The Certificates Manager model + scoped_ptr<CertificateManagerModel> certificate_manager_model_; + + // For multi-step import or export processes, we need to store the path, + // password, etc the user chose while we wait for them to enter a password, + // wait for file to be read, etc. + FilePath file_path_; + string16 password_; + std::string file_data_; + net::CertificateList selected_cert_list_; + scoped_refptr<SelectFileDialog> select_file_dialog_; + scoped_refptr<net::CryptoModule> module_; + + // Used in reading and writing certificate files. + CancelableRequestConsumer consumer_; + scoped_refptr<FileAccessProvider> file_access_provider_; + + DISALLOW_COPY_AND_ASSIGN(CertificateManagerHandler); +}; + +#endif // CHROME_BROWSER_WEBUI_OPTIONS_CERTIFICATE_MANAGER_HANDLER_H_ diff --git a/chrome/browser/dom_ui/options/clear_browser_data_handler.cc b/chrome/browser/webui/options/clear_browser_data_handler.cc index 08afd5d..08afd5d 100644 --- a/chrome/browser/dom_ui/options/clear_browser_data_handler.cc +++ b/chrome/browser/webui/options/clear_browser_data_handler.cc diff --git a/chrome/browser/webui/options/clear_browser_data_handler.h b/chrome/browser/webui/options/clear_browser_data_handler.h new file mode 100644 index 0000000..9c1c2ef --- /dev/null +++ b/chrome/browser/webui/options/clear_browser_data_handler.h @@ -0,0 +1,54 @@ +// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CHROME_BROWSER_WEBUI_OPTIONS_CLEAR_BROWSER_DATA_HANDLER_H_ +#define CHROME_BROWSER_WEBUI_OPTIONS_CLEAR_BROWSER_DATA_HANDLER_H_ +#pragma once + +#include "chrome/browser/dom_ui/options/options_ui.h" +#include "chrome/browser/browsing_data_remover.h" +#include "chrome/browser/plugin_data_remover_helper.h" + +// Clear browser data handler page UI handler. +class ClearBrowserDataHandler : public OptionsPageUIHandler, + public BrowsingDataRemover::Observer { + public: + ClearBrowserDataHandler(); + virtual ~ClearBrowserDataHandler(); + + // OptionsUIHandler implementation. + virtual void Initialize(); + + virtual void GetLocalizedValues(DictionaryValue* localized_strings); + + // WebUIMessageHandler implementation. + virtual void RegisterMessages(); + + // NotificationObserver implementation. + virtual void Observe(NotificationType type, + const NotificationSource& source, + const NotificationDetails& details); + + private: + // Javascript callback to start clearing data. + void HandleClearBrowserData(const ListValue* value); + + // Updates the UI to reflect whether clearing LSO data is supported. + void UpdateClearPluginLSOData(); + + // Callback from BrowsingDataRemover. Closes the dialog. + virtual void OnBrowsingDataRemoverDone(); + + // If non-null it means removal is in progress. BrowsingDataRemover takes care + // of deleting itself when done. + BrowsingDataRemover* remover_; + + // Used for asynchronously updating the preference stating whether clearing + // LSO data is supported. + PluginDataRemoverHelper clear_plugin_lso_data_enabled_; + + DISALLOW_COPY_AND_ASSIGN(ClearBrowserDataHandler); +}; + +#endif // CHROME_BROWSER_WEBUI_OPTIONS_CLEAR_BROWSER_DATA_HANDLER_H_ diff --git a/chrome/browser/dom_ui/options/content_settings_handler.cc b/chrome/browser/webui/options/content_settings_handler.cc index 4a7a649..4a7a649 100644 --- a/chrome/browser/dom_ui/options/content_settings_handler.cc +++ b/chrome/browser/webui/options/content_settings_handler.cc diff --git a/chrome/browser/webui/options/content_settings_handler.h b/chrome/browser/webui/options/content_settings_handler.h new file mode 100644 index 0000000..4bc7bcf --- /dev/null +++ b/chrome/browser/webui/options/content_settings_handler.h @@ -0,0 +1,112 @@ +// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CHROME_BROWSER_WEBUI_OPTIONS_CONTENT_SETTINGS_HANDLER_H_ +#define CHROME_BROWSER_WEBUI_OPTIONS_CONTENT_SETTINGS_HANDLER_H_ +#pragma once + +#include "chrome/browser/dom_ui/options/options_ui.h" +#include "chrome/browser/plugin_data_remover_helper.h" +#include "chrome/browser/prefs/pref_change_registrar.h" +#include "chrome/common/content_settings_types.h" +#include "chrome/common/notification_observer.h" +#include "chrome/common/notification_registrar.h" + +class HostContentSettingsMap; + +class ContentSettingsHandler : public OptionsPageUIHandler { + public: + ContentSettingsHandler(); + virtual ~ContentSettingsHandler(); + + // OptionsUIHandler implementation. + virtual void GetLocalizedValues(DictionaryValue* localized_strings); + + virtual void Initialize(); + + virtual void RegisterMessages(); + + // NotificationObserver implementation. + virtual void Observe(NotificationType type, + const NotificationSource& source, + const NotificationDetails& details); + + // Gets a string identifier for the group name, for use in HTML. + static std::string ContentSettingsTypeToGroupName(ContentSettingsType type); + + private: + // Functions that call into the page ----------------------------------------- + + // Updates the page with the default settings (allow, ask, block, etc.) + void UpdateSettingDefaultFromModel(ContentSettingsType type); + // Updates the state of the "Clear plugin LSO data on exit" checkbox. + void UpdateClearPluginLSOData(); + + // Clobbers and rebuilds the specific content setting type exceptions table. + void UpdateExceptionsViewFromModel(ContentSettingsType type); + // Clobbers and rebuilds all the exceptions tables in the page (both normal + // and OTR tables). + void UpdateAllExceptionsViewsFromModel(); + // As above, but only OTR tables. + void UpdateAllOTRExceptionsViewsFromModel(); + // Clobbers and rebuilds just the geolocation exception table. + void UpdateGeolocationExceptionsView(); + // Clobbers and rebuilds just the desktop notification exception table. + void UpdateNotificationExceptionsView(); + // Clobbers and rebuilds an exception table that's managed by the host content + // settings map. + void UpdateExceptionsViewFromHostContentSettingsMap(ContentSettingsType type); + // As above, but acts on the OTR table for the content setting type. + void UpdateExceptionsViewFromOTRHostContentSettingsMap( + ContentSettingsType type); + + // Callbacks used by the page ------------------------------------------------ + + // Sets the default value for a specific content type. |args| includes the + // content type and a string describing the new default the user has + // chosen. + void SetContentFilter(const ListValue* args); + + // Removes the given row from the table. The first entry in |args| is the + // content type, and the rest of the arguments depend on the content type + // to be removed. + void RemoveException(const ListValue* args); + + // Changes the value of an exception. Called after the user is done editing an + // exception. + void SetException(const ListValue* args); + + // Called to decide whether a given pattern is valid, or if it should be + // rejected. Called while the user is editing an exception pattern. + void CheckExceptionPatternValidity(const ListValue* args); + + // Sets the global 3rd party cookies pref. + void SetAllowThirdPartyCookies(const ListValue* args); + + // Utility functions --------------------------------------------------------- + + // Gets the HostContentSettingsMap for the normal profile. + HostContentSettingsMap* GetContentSettingsMap(); + + // Gets the HostContentSettingsMap for the incognito profile, or NULL if there + // is no active incognito session. + HostContentSettingsMap* GetOTRContentSettingsMap(); + + // Gets the default setting in string form. + std::string GetSettingDefaultFromModel(ContentSettingsType type); + + // Returns true if the default setting for the given content settings type + // |type| is managed. + bool GetDefaultSettingManagedFromModel(ContentSettingsType type); + + // Member variables --------------------------------------------------------- + + NotificationRegistrar notification_registrar_; + PrefChangeRegistrar pref_change_registrar_; + PluginDataRemoverHelper clear_plugin_lso_data_enabled_; + + DISALLOW_COPY_AND_ASSIGN(ContentSettingsHandler); +}; + +#endif // CHROME_BROWSER_WEBUI_OPTIONS_CONTENT_SETTINGS_HANDLER_H_ diff --git a/chrome/browser/dom_ui/options/cookies_view_handler.cc b/chrome/browser/webui/options/cookies_view_handler.cc index edde6b6..edde6b6 100644 --- a/chrome/browser/dom_ui/options/cookies_view_handler.cc +++ b/chrome/browser/webui/options/cookies_view_handler.cc diff --git a/chrome/browser/webui/options/cookies_view_handler.h b/chrome/browser/webui/options/cookies_view_handler.h new file mode 100644 index 0000000..8aa9f1d --- /dev/null +++ b/chrome/browser/webui/options/cookies_view_handler.h @@ -0,0 +1,66 @@ +// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CHROME_BROWSER_WEBUI_OPTIONS_COOKIES_VIEW_HANDLER_H_ +#define CHROME_BROWSER_WEBUI_OPTIONS_COOKIES_VIEW_HANDLER_H_ +#pragma once + +#include "base/scoped_ptr.h" +#include "chrome/browser/cookies_tree_model.h" +#include "chrome/browser/dom_ui/options/options_ui.h" + +class CookiesViewHandler : public OptionsPageUIHandler, + public CookiesTreeModel::Observer { + public: + CookiesViewHandler(); + virtual ~CookiesViewHandler(); + + // OptionsUIHandler implementation. + virtual void GetLocalizedValues(DictionaryValue* localized_strings); + virtual void RegisterMessages(); + + // ui::TreeModel::Observer implementation. + virtual void TreeNodesAdded(ui::TreeModel* model, + ui::TreeModelNode* parent, + int start, + int count); + virtual void TreeNodesRemoved(ui::TreeModel* model, + ui::TreeModelNode* parent, + int start, + int count); + virtual void TreeNodeChanged(ui::TreeModel* model, ui::TreeModelNode* node) {} + virtual void TreeModelBeginBatch(CookiesTreeModel* model); + virtual void TreeModelEndBatch(CookiesTreeModel* model); + + private: + // Updates search filter for cookies tree model. + void UpdateSearchResults(const ListValue* args); + + // Remove all sites data. + void RemoveAll(const ListValue* args); + + // Remove selected sites data. + void Remove(const ListValue* args); + + // Get the tree node using the tree path info in |args| and call + // SendChildren to pass back children nodes data to WebUI. + void LoadChildren(const ListValue* args); + + // Gets tree node from given path. Return NULL if path is not valid. + CookieTreeNode* GetTreeNodeFromPath(const std::string& path); + + // Get children nodes data and pass it to 'CookiesView.loadChildren' to + // update the WebUI. + void SendChildren(CookieTreeNode* parent); + + // The Cookies Tree model + scoped_ptr<CookiesTreeModel> cookies_tree_model_; + + // Flag to indicate whether there is a batch update in progress. + bool batch_update_; + + DISALLOW_COPY_AND_ASSIGN(CookiesViewHandler); +}; + +#endif // CHROME_BROWSER_WEBUI_OPTIONS_COOKIES_VIEW_HANDLER_H_ diff --git a/chrome/browser/dom_ui/options/core_options_handler.cc b/chrome/browser/webui/options/core_options_handler.cc index 5a20e8b..5a20e8b 100644 --- a/chrome/browser/dom_ui/options/core_options_handler.cc +++ b/chrome/browser/webui/options/core_options_handler.cc diff --git a/chrome/browser/webui/options/core_options_handler.h b/chrome/browser/webui/options/core_options_handler.h new file mode 100644 index 0000000..c1fc9dd --- /dev/null +++ b/chrome/browser/webui/options/core_options_handler.h @@ -0,0 +1,108 @@ +// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CHROME_BROWSER_WEBUI_OPTIONS_CORE_OPTIONS_HANDLER_H_ +#define CHROME_BROWSER_WEBUI_OPTIONS_CORE_OPTIONS_HANDLER_H_ +#pragma once + +#include <map> +#include <string> + +#include "base/values.h" +#include "chrome/browser/dom_ui/options/options_ui.h" +#include "chrome/browser/prefs/pref_change_registrar.h" + +// Core options UI handler. +// Handles resource and JS calls common to all options sub-pages. +class CoreOptionsHandler : public OptionsPageUIHandler { + public: + CoreOptionsHandler(); + virtual ~CoreOptionsHandler(); + + // OptionsUIHandler implementation. + virtual void GetLocalizedValues(DictionaryValue* localized_strings); + virtual void Uninitialize(); + + // NotificationObserver implementation. + virtual void Observe(NotificationType type, + const NotificationSource& source, + const NotificationDetails& details); + + // WebUIMessageHandler implementation. + virtual void RegisterMessages(); + virtual WebUIMessageHandler* Attach(WebUI* web_ui); + + protected: + // Fetches a pref value of given |pref_name|. + // Note that caller owns the returned Value. + virtual Value* FetchPref(const std::string& pref_name); + + // Observes a pref of given |pref_name|. + virtual void ObservePref(const std::string& pref_name); + + // Sets a pref |value| to given |pref_name|. + virtual void SetPref(const std::string& pref_name, + const Value* value, + const std::string& metric); + + // Clears pref value for given |pref_name|. + void ClearPref(const std::string& pref_name, const std::string& metric); + + // Stops observing given preference identified by |path|. + virtual void StopObservingPref(const std::string& path); + + // Records a user metric action for the given value. + void ProcessUserMetric(const Value* value, + const std::string& metric); + + typedef std::multimap<std::string, std::wstring> PreferenceCallbackMap; + PreferenceCallbackMap pref_callback_map_; + private: + // Callback for the "coreOptionsInitialize" message. This message will + // trigger the Initialize() method of all other handlers so that final + // setup can be performed before the page is shown. + void HandleInitialize(const ListValue* args); + + // Callback for the "fetchPrefs" message. This message accepts the list of + // preference names passed as the |args| parameter (ListValue). It passes + // results dictionary of preference values by calling prefsFetched() JS method + // on the page. + void HandleFetchPrefs(const ListValue* args); + + // Callback for the "observePrefs" message. This message initiates + // notification observing for given array of preference names. + void HandleObservePrefs(const ListValue* args); + + // Callbacks for the "set<type>Pref" message. This message saves the new + // preference value. |args| is an array of parameters as follows: + // item 0 - name of the preference. + // item 1 - the value of the preference in string form. + // item 2 - name of the metric identifier (optional). + void HandleSetBooleanPref(const ListValue* args); + void HandleSetIntegerPref(const ListValue* args); + void HandleSetDoublePref(const ListValue* args); + void HandleSetStringPref(const ListValue* args); + void HandleSetListPref(const ListValue* args); + + void HandleSetPref(const ListValue* args, Value::ValueType type); + + // Callback for the "clearPref" message. This message clears a preference + // value. |args| is an array of parameters as follows: + // item 0 - name of the preference. + // item 1 - name of the metric identifier (optional). + void HandleClearPref(const ListValue* args); + + // Callback for the "coreOptionsUserMetricsAction" message. This records + // an action that should be tracked if metrics recording is enabled. |args| + // is an array that contains a single item, the name of the metric identifier. + void HandleUserMetricsAction(const ListValue* args); + + void NotifyPrefChanged(const std::string* pref_name); + + PrefChangeRegistrar registrar_; + + DISALLOW_COPY_AND_ASSIGN(CoreOptionsHandler); +}; + +#endif // CHROME_BROWSER_WEBUI_OPTIONS_CORE_OPTIONS_HANDLER_H_ diff --git a/chrome/browser/dom_ui/options/dom_options_util.cc b/chrome/browser/webui/options/dom_options_util.cc index 2eb8ec3..2eb8ec3 100644 --- a/chrome/browser/dom_ui/options/dom_options_util.cc +++ b/chrome/browser/webui/options/dom_options_util.cc diff --git a/chrome/browser/webui/options/dom_options_util.h b/chrome/browser/webui/options/dom_options_util.h new file mode 100644 index 0000000..83a7521 --- /dev/null +++ b/chrome/browser/webui/options/dom_options_util.h @@ -0,0 +1,21 @@ +// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CHROME_BROWSER_WEBUI_OPTIONS_DOM_OPTIONS_UTIL_H_ +#define CHROME_BROWSER_WEBUI_OPTIONS_DOM_OPTIONS_UTIL_H_ +#pragma once + +#include "base/string16.h" + +namespace dom_options_util { + +// Strips the trailing colon from a string. Used to remove the colon from +// section titles on platforms that append it. +// TODO(jhawkins): Remove this once the platform-specific options dialogs are +// removed. +string16 StripColon(const string16& str); + +} // namespace options_util + +#endif // CHROME_BROWSER_WEBUI_OPTIONS_DOM_OPTIONS_UTIL_H_ diff --git a/chrome/browser/dom_ui/options/font_settings_handler.cc b/chrome/browser/webui/options/font_settings_handler.cc index 6942acd..6942acd 100644 --- a/chrome/browser/dom_ui/options/font_settings_handler.cc +++ b/chrome/browser/webui/options/font_settings_handler.cc diff --git a/chrome/browser/webui/options/font_settings_handler.h b/chrome/browser/webui/options/font_settings_handler.h new file mode 100644 index 0000000..646604a --- /dev/null +++ b/chrome/browser/webui/options/font_settings_handler.h @@ -0,0 +1,44 @@ +// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CHROME_BROWSER_WEBUI_OPTIONS_FONT_SETTINGS_HANDLER_H_ +#define CHROME_BROWSER_WEBUI_OPTIONS_FONT_SETTINGS_HANDLER_H_ +#pragma once + +#include "chrome/browser/dom_ui/options/options_ui.h" +#include "chrome/browser/prefs/pref_member.h" + +// Font settings overlay page UI handler. +class FontSettingsHandler : public OptionsPageUIHandler { + public: + FontSettingsHandler(); + virtual ~FontSettingsHandler(); + + // OptionsUIHandler implementation. + virtual void GetLocalizedValues(DictionaryValue* localized_strings); + virtual void Initialize(); + + // WebUIMessageHandler implementation. + virtual WebUIMessageHandler* Attach(WebUI* web_ui); + + // NotificationObserver implementation. + virtual void Observe(NotificationType type, + const NotificationSource& source, + const NotificationDetails& details); + + private: + void SetupSerifFontSample(); + void SetupFixedFontSample(); + void SetupMinimumFontSample(); + + StringPrefMember serif_font_; + StringPrefMember fixed_font_; + IntegerPrefMember default_font_size_; + IntegerPrefMember default_fixed_font_size_; + IntegerPrefMember minimum_font_size_; + + DISALLOW_COPY_AND_ASSIGN(FontSettingsHandler); +}; + +#endif // CHROME_BROWSER_WEBUI_OPTIONS_FONT_SETTINGS_HANDLER_H_ diff --git a/chrome/browser/webui/options/font_settings_utils.h b/chrome/browser/webui/options/font_settings_utils.h new file mode 100644 index 0000000..00cf63f --- /dev/null +++ b/chrome/browser/webui/options/font_settings_utils.h @@ -0,0 +1,25 @@ +// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CHROME_BROWSER_WEBUI_OPTIONS_FONT_SETTINGS_UTILS_H_ +#define CHROME_BROWSER_WEBUI_OPTIONS_FONT_SETTINGS_UTILS_H_ +#pragma once + +#include "base/basictypes.h" + +class ListValue; +class PrefService; + +// Chrome advanced options utility methods. +class FontSettingsUtilities { + public: + static ListValue* GetFontsList(); + + static void ValidateSavedFonts(PrefService* prefs); + + private: + DISALLOW_IMPLICIT_CONSTRUCTORS(FontSettingsUtilities); +}; + +#endif // CHROME_BROWSER_WEBUI_OPTIONS_FONT_SETTINGS_UTILS_H_ diff --git a/chrome/browser/dom_ui/options/font_settings_utils_gtk.cc b/chrome/browser/webui/options/font_settings_utils_gtk.cc index d1aaefb5..fa2459e 100644 --- a/chrome/browser/dom_ui/options/font_settings_utils_gtk.cc +++ b/chrome/browser/webui/options/font_settings_utils_gtk.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. diff --git a/chrome/browser/dom_ui/options/font_settings_utils_mac.mm b/chrome/browser/webui/options/font_settings_utils_mac.mm index bfdff36..bfdff36 100644 --- a/chrome/browser/dom_ui/options/font_settings_utils_mac.mm +++ b/chrome/browser/webui/options/font_settings_utils_mac.mm diff --git a/chrome/browser/dom_ui/options/font_settings_utils_win.cc b/chrome/browser/webui/options/font_settings_utils_win.cc index 9a7c9bb..9a7c9bb 100644 --- a/chrome/browser/dom_ui/options/font_settings_utils_win.cc +++ b/chrome/browser/webui/options/font_settings_utils_win.cc diff --git a/chrome/browser/dom_ui/options/import_data_handler.cc b/chrome/browser/webui/options/import_data_handler.cc index 3931d09..3931d09 100644 --- a/chrome/browser/dom_ui/options/import_data_handler.cc +++ b/chrome/browser/webui/options/import_data_handler.cc diff --git a/chrome/browser/webui/options/import_data_handler.h b/chrome/browser/webui/options/import_data_handler.h new file mode 100644 index 0000000..f77c135 --- /dev/null +++ b/chrome/browser/webui/options/import_data_handler.h @@ -0,0 +1,48 @@ +// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CHROME_BROWSER_WEBUI_OPTIONS_IMPORT_DATA_HANDLER_H_ +#define CHROME_BROWSER_WEBUI_OPTIONS_IMPORT_DATA_HANDLER_H_ + +#include "base/ref_counted.h" +#include "chrome/browser/dom_ui/options/options_ui.h" +#include "chrome/browser/importer/importer.h" + +// Chrome personal stuff import data overlay UI handler. +class ImportDataHandler : public OptionsPageUIHandler, + public ImporterHost::Observer, + public ImporterList::Observer { + public: + ImportDataHandler(); + virtual ~ImportDataHandler(); + + // OptionsUIHandler implementation. + virtual void GetLocalizedValues(DictionaryValue* localized_strings); + virtual void Initialize(); + + // WebUIMessageHandler implementation. + virtual void RegisterMessages(); + + private: + void ImportData(const ListValue* args); + + // ImporterHost::Observer implementation. + virtual void ImportStarted(); + virtual void ImportItemStarted(importer::ImportItem item); + virtual void ImportItemEnded(importer::ImportItem item); + virtual void ImportEnded(); + + // ImporterList::Observer implementation. + virtual void SourceProfilesLoaded(); + + scoped_refptr<ImporterList> importer_list_; + + // If non-null it means importing is in progress. ImporterHost takes care + // of deleting itself when import is complete. + ImporterHost* importer_host_; // weak + + DISALLOW_COPY_AND_ASSIGN(ImportDataHandler); +}; + +#endif // CHROME_BROWSER_WEBUI_OPTIONS_IMPORT_DATA_HANDLER_H_ diff --git a/chrome/browser/dom_ui/options/language_options_handler.cc b/chrome/browser/webui/options/language_options_handler.cc index f3119d5..f3119d5 100644 --- a/chrome/browser/dom_ui/options/language_options_handler.cc +++ b/chrome/browser/webui/options/language_options_handler.cc diff --git a/chrome/browser/webui/options/language_options_handler.h b/chrome/browser/webui/options/language_options_handler.h new file mode 100644 index 0000000..f314ce1 --- /dev/null +++ b/chrome/browser/webui/options/language_options_handler.h @@ -0,0 +1,43 @@ +// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CHROME_BROWSER_WEBUI_OPTIONS_LANGUAGE_OPTIONS_HANDLER_H_ +#define CHROME_BROWSER_WEBUI_OPTIONS_LANGUAGE_OPTIONS_HANDLER_H_ +#pragma once + +#include "chrome/browser/dom_ui/options/language_options_handler_common.h" + +// Language options UI page handler for non-Chrome OS platforms. For Chrome OS, +// see chromeos::CrosLanguageOptionsHandler. +class LanguageOptionsHandler : public LanguageOptionsHandlerCommon { + public: + LanguageOptionsHandler(); + virtual ~LanguageOptionsHandler(); + + // OptionsUIHandler implementation. + virtual void GetLocalizedValues(DictionaryValue* localized_strings); + + // WebUIMessageHandler implementation. + virtual void RegisterMessages(); + + // The following static method is public for ease of testing. + + // Gets the list of languages from the given input descriptors. + // The return value will look like: + // [{'code': 'fi', 'displayName': 'Finnish', 'nativeDisplayName': 'suomi'}, + // ...] + static ListValue* GetLanguageList(); + + private: + // LanguageOptionsHandlerCommon implementation. + virtual string16 GetProductName(); + virtual void SetApplicationLocale(std::string language_code); + + // Called when the restart button is clicked. + void RestartCallback(const ListValue* args); + + DISALLOW_COPY_AND_ASSIGN(LanguageOptionsHandler); +}; + +#endif // CHROME_BROWSER_WEBUI_OPTIONS_LANGUAGE_OPTIONS_HANDLER_H_ diff --git a/chrome/browser/dom_ui/options/language_options_handler_common.cc b/chrome/browser/webui/options/language_options_handler_common.cc index e2e4403..e2e4403 100644 --- a/chrome/browser/dom_ui/options/language_options_handler_common.cc +++ b/chrome/browser/webui/options/language_options_handler_common.cc diff --git a/chrome/browser/webui/options/language_options_handler_common.h b/chrome/browser/webui/options/language_options_handler_common.h new file mode 100644 index 0000000..2dd2846 --- /dev/null +++ b/chrome/browser/webui/options/language_options_handler_common.h @@ -0,0 +1,66 @@ +// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CHROME_BROWSER_WEBUI_OPTIONS_LANGUAGE_OPTIONS_HANDLER_COMMON_H_ +#define CHROME_BROWSER_WEBUI_OPTIONS_LANGUAGE_OPTIONS_HANDLER_COMMON_H_ +#pragma once + +#include "chrome/browser/dom_ui/options/options_ui.h" + +class DictionaryValue; +class ListValue; + +// The base class for language options page UI handlers. This class has code +// common to the Chrome OS and non-Chrome OS implementation of the handler. +class LanguageOptionsHandlerCommon : public OptionsPageUIHandler { + public: + LanguageOptionsHandlerCommon(); + virtual ~LanguageOptionsHandlerCommon(); + + // OptionsUIHandler implementation. + virtual void GetLocalizedValues(DictionaryValue* localized_strings); + + // DOMMessageHandler implementation. + virtual void RegisterMessages(); + + // The following static methods are public for ease of testing. + + // Gets the set of language codes that can be used as UI language. + // The return value will look like: + // {'en-US': true, 'fi': true, 'fr': true, ...} + // + // Note that true in values does not mean anything. We just use the + // dictionary as a set. + static DictionaryValue* GetUILanguageCodeSet(); + + // Gets the set of language codes that can be used for spellchecking. + // The return value will look like: + // {'en-US': true, 'fi': true, 'fr': true, ...} + // + // Note that true in values does not mean anything. We just use the + // dictionary as a set. + static DictionaryValue* GetSpellCheckLanguageCodeSet(); + + private: + // Returns the name of the product (ex. "Chrome" or "Chrome OS"). + virtual string16 GetProductName() = 0; + + // Sets the application locale. + virtual void SetApplicationLocale(std::string language_code) = 0; + + // Called when the language options is opened. + void LanguageOptionsOpenCallback(const ListValue* args); + + // Called when the UI language is changed. + // |args| will contain the language code as string (ex. "fr"). + void UiLanguageChangeCallback(const ListValue* args); + + // Called when the spell check language is changed. + // |args| will contain the language code as string (ex. "fr"). + void SpellCheckLanguageChangeCallback(const ListValue* args); + + DISALLOW_COPY_AND_ASSIGN(LanguageOptionsHandlerCommon); +}; + +#endif // CHROME_BROWSER_WEBUI_OPTIONS_LANGUAGE_OPTIONS_HANDLER_COMMON_H_ diff --git a/chrome/browser/dom_ui/options/language_options_handler_unittest.cc b/chrome/browser/webui/options/language_options_handler_unittest.cc index 3b616c4..3b616c4 100644 --- a/chrome/browser/dom_ui/options/language_options_handler_unittest.cc +++ b/chrome/browser/webui/options/language_options_handler_unittest.cc diff --git a/chrome/browser/dom_ui/options/options_managed_banner_handler.cc b/chrome/browser/webui/options/options_managed_banner_handler.cc index 81d2ccc..81d2ccc 100644 --- a/chrome/browser/dom_ui/options/options_managed_banner_handler.cc +++ b/chrome/browser/webui/options/options_managed_banner_handler.cc diff --git a/chrome/browser/webui/options/options_managed_banner_handler.h b/chrome/browser/webui/options/options_managed_banner_handler.h new file mode 100644 index 0000000..052c408 --- /dev/null +++ b/chrome/browser/webui/options/options_managed_banner_handler.h @@ -0,0 +1,39 @@ +// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CHROME_BROWSER_WEBUI_OPTIONS_OPTIONS_MANAGED_BANNER_HANDLER_H_ +#define CHROME_BROWSER_WEBUI_OPTIONS_OPTIONS_MANAGED_BANNER_HANDLER_H_ +#pragma once + +#include "base/string16.h" +#include "chrome/browser/policy/managed_prefs_banner_base.h" +#include "chrome/browser/ui/options/options_window.h" + +class WebUI; + +// Managed options banner handler. +// Controls the display of a banner if an options panel contains options +// that are under administator control. +class OptionsManagedBannerHandler : public policy::ManagedPrefsBannerBase { + public: + OptionsManagedBannerHandler(WebUI* web_ui, const string16& page_name, + OptionsPage page); + virtual ~OptionsManagedBannerHandler(); + + protected: + // ManagedPrefsBannerBase implementation. + virtual void OnUpdateVisibility(); + + private: + // Set the managed options banner to be visible or invisible. + void SetupBannerVisibilty(); + + WebUI* web_ui_; // weak reference to the WebUI. + string16 page_name_; // current options page name. + OptionsPage page_; // current options page value. + + DISALLOW_COPY_AND_ASSIGN(OptionsManagedBannerHandler); +}; + +#endif // CHROME_BROWSER_WEBUI_OPTIONS_OPTIONS_MANAGED_BANNER_HANDLER_H_ diff --git a/chrome/browser/dom_ui/options/options_ui.cc b/chrome/browser/webui/options/options_ui.cc index 06eafff..06eafff 100644 --- a/chrome/browser/dom_ui/options/options_ui.cc +++ b/chrome/browser/webui/options/options_ui.cc diff --git a/chrome/browser/webui/options/options_ui.h b/chrome/browser/webui/options/options_ui.h new file mode 100644 index 0000000..e708b6c --- /dev/null +++ b/chrome/browser/webui/options/options_ui.h @@ -0,0 +1,119 @@ +// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CHROME_BROWSER_WEBUI_OPTIONS_OPTIONS_UI_H_ +#define CHROME_BROWSER_WEBUI_OPTIONS_OPTIONS_UI_H_ +#pragma once + +#include <string> + +#include "base/scoped_ptr.h" +#include "chrome/browser/webui/chrome_url_data_manager.h" +#include "chrome/browser/webui/web_ui.h" +#include "chrome/common/notification_observer.h" +#include "chrome/common/notification_registrar.h" +#include "chrome/common/notification_type.h" + +class GURL; +class PrefService; +struct UserMetricsAction; + +class OptionsUIHTMLSource : public ChromeURLDataManager::DataSource { + public: + // The constructor takes over ownership of |localized_strings|. + explicit OptionsUIHTMLSource(DictionaryValue* localized_strings); + virtual ~OptionsUIHTMLSource(); + + // Called when the network layer has requested a resource underneath + // the path we registered. + virtual void StartDataRequest(const std::string& path, + bool is_off_the_record, + int request_id); + virtual std::string GetMimeType(const std::string&) const; + + private: + // Localized strings collection. + scoped_ptr<DictionaryValue> localized_strings_; + + DISALLOW_COPY_AND_ASSIGN(OptionsUIHTMLSource); +}; + +// The base class handler of Javascript messages of options pages. +class OptionsPageUIHandler : public WebUIMessageHandler, + public NotificationObserver { + public: + OptionsPageUIHandler(); + virtual ~OptionsPageUIHandler(); + + // Is this handler enabled? + virtual bool IsEnabled(); + + // Collects localized strings for options page. + virtual void GetLocalizedValues(DictionaryValue* localized_strings) = 0; + + // Initialize the page. Called once the DOM is available for manipulation. + // This will be called only once. + virtual void Initialize() {} + + // Uninitializes the page. Called just before the object is destructed. + virtual void Uninitialize() {} + + // WebUIMessageHandler implementation. + virtual void RegisterMessages() {} + + // NotificationObserver implementation. + virtual void Observe(NotificationType type, + const NotificationSource& source, + const NotificationDetails& details) {} + + void UserMetricsRecordAction(const UserMetricsAction& action); + + protected: + struct OptionsStringResource { + // The name of the resource in templateData. + const char* name; + // The .grd ID for the resource (IDS_*). + int id; + // True if the trailing colon should be stripped on platforms that + // don't want trailing colons. + bool strip_colon; + }; + // A helper for simplifying the process of registering strings in WebUI. + static void RegisterStrings(DictionaryValue* localized_strings, + const OptionsStringResource* resources, + size_t length); + + // Registers string resources for a page's header and tab title. + static void RegisterTitle(DictionaryValue* localized_strings, + const std::string& variable_name, + int title_id); + + NotificationRegistrar registrar_; + + private: + DISALLOW_COPY_AND_ASSIGN(OptionsPageUIHandler); +}; + +class OptionsUI : public WebUI { + public: + explicit OptionsUI(TabContents* contents); + virtual ~OptionsUI(); + + static RefCountedMemory* GetFaviconResourceBytes(); + virtual void RenderViewCreated(RenderViewHost* render_view_host); + virtual void DidBecomeActiveForReusedRenderView(); + + void InitializeHandlers(); + + private: + // Adds OptionsPageUiHandler to the handlers list if handler is enabled. + void AddOptionsPageUIHandler(DictionaryValue* localized_strings, + OptionsPageUIHandler* handler); + + bool initialized_handlers_; + + DISALLOW_COPY_AND_ASSIGN(OptionsUI); +}; + +#endif // CHROME_BROWSER_WEBUI_OPTIONS_OPTIONS_UI_H_ diff --git a/chrome/browser/dom_ui/options/options_ui_uitest.cc b/chrome/browser/webui/options/options_ui_uitest.cc index d6061aa..d6061aa 100644 --- a/chrome/browser/dom_ui/options/options_ui_uitest.cc +++ b/chrome/browser/webui/options/options_ui_uitest.cc diff --git a/chrome/browser/dom_ui/options/password_manager_handler.cc b/chrome/browser/webui/options/password_manager_handler.cc index f14643f..f14643f 100644 --- a/chrome/browser/dom_ui/options/password_manager_handler.cc +++ b/chrome/browser/webui/options/password_manager_handler.cc diff --git a/chrome/browser/webui/options/password_manager_handler.h b/chrome/browser/webui/options/password_manager_handler.h new file mode 100644 index 0000000..3f528c0 --- /dev/null +++ b/chrome/browser/webui/options/password_manager_handler.h @@ -0,0 +1,113 @@ +// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CHROME_BROWSER_WEBUI_OPTIONS_PASSWORD_MANAGER_HANDLER_H_ +#define CHROME_BROWSER_WEBUI_OPTIONS_PASSWORD_MANAGER_HANDLER_H_ + +#include <string> +#include <vector> + +#include "chrome/browser/dom_ui/options/options_ui.h" +#include "chrome/browser/password_manager/password_store.h" + +class PasswordManagerHandler : public OptionsPageUIHandler { + public: + PasswordManagerHandler(); + virtual ~PasswordManagerHandler(); + + // OptionsUIHandler implementation. + virtual void GetLocalizedValues(DictionaryValue* localized_strings); + + virtual void Initialize(); + + virtual void RegisterMessages(); + + private: + // The password store associated with the currently active profile. + PasswordStore* GetPasswordStore(); + + // Called when the JS PasswordManager object is initialized. + void UpdatePasswordLists(const ListValue* args); + + // Remove an entry. + // @param value the entry index to be removed. + void RemoveSavedPassword(const ListValue* args); + + // Remove an password exception. + // @param value the entry index to be removed. + void RemovePasswordException(const ListValue* args); + + // Remove all saved passwords + void RemoveAllSavedPasswords(const ListValue* args); + + // Remove All password exceptions + void RemoveAllPasswordExceptions(const ListValue* args); + + // Get password value for the selected entry. + // @param value the selected entry index. + void ShowSelectedPassword(const ListValue* args); + + // Sets the password and exception list contents to the given data. + // We take ownership of the PasswordForms in the vector. + void SetPasswordList(); + void SetPasswordExceptionList(); + + // A short class to mediate requests to the password store. + class ListPopulater : public PasswordStoreConsumer { + public: + explicit ListPopulater(PasswordManagerHandler* page); + virtual ~ListPopulater(); + + // Send a query to the password store to populate a list. + virtual void Populate() = 0; + + // Send the password store's reply back to the handler. + virtual void OnPasswordStoreRequestDone( + int handle, const std::vector<webkit_glue::PasswordForm*>& result) = 0; + + protected: + PasswordManagerHandler* page_; + int pending_login_query_; + }; + + // A short class to mediate requests to the password store for passwordlist. + class PasswordListPopulater : public ListPopulater { + public: + explicit PasswordListPopulater(PasswordManagerHandler* page); + + // Send a query to the password store to populate a password list. + virtual void Populate(); + + // Send the password store's reply back to the handler. + virtual void OnPasswordStoreRequestDone( + int handle, const std::vector<webkit_glue::PasswordForm*>& result); + }; + + // A short class to mediate requests to the password store for exceptions. + class PasswordExceptionListPopulater : public ListPopulater { + public: + explicit PasswordExceptionListPopulater(PasswordManagerHandler* page); + + // Send a query to the password store to populate a passwordException list. + virtual void Populate(); + + // Send the password store's reply back to the handler. + virtual void OnPasswordStoreRequestDone( + int handle, const std::vector<webkit_glue::PasswordForm*>& result); + }; + + // Password store consumer for populating the password list and exceptions. + PasswordListPopulater populater_; + PasswordExceptionListPopulater exception_populater_; + + std::vector<webkit_glue::PasswordForm*> password_list_; + std::vector<webkit_glue::PasswordForm*> password_exception_list_; + + // User's pref + std::string languages_; + + DISALLOW_COPY_AND_ASSIGN(PasswordManagerHandler); +}; + +#endif // CHROME_BROWSER_WEBUI_OPTIONS_PASSWORD_MANAGER_HANDLER_H_ diff --git a/chrome/browser/dom_ui/options/personal_options_handler.cc b/chrome/browser/webui/options/personal_options_handler.cc index 64968f2..64968f2 100644 --- a/chrome/browser/dom_ui/options/personal_options_handler.cc +++ b/chrome/browser/webui/options/personal_options_handler.cc diff --git a/chrome/browser/webui/options/personal_options_handler.h b/chrome/browser/webui/options/personal_options_handler.h new file mode 100644 index 0000000..67e2793 --- /dev/null +++ b/chrome/browser/webui/options/personal_options_handler.h @@ -0,0 +1,66 @@ +// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CHROME_BROWSER_WEBUI_OPTIONS_PERSONAL_OPTIONS_HANDLER_H_ +#define CHROME_BROWSER_WEBUI_OPTIONS_PERSONAL_OPTIONS_HANDLER_H_ +#pragma once + +#include "base/basictypes.h" +#include "chrome/browser/browser_signin.h" +#include "chrome/browser/dom_ui/options/options_ui.h" +#include "chrome/browser/sync/profile_sync_service.h" + +class OptionsManagedBannerHandler; + +// Chrome personal options page UI handler. +class PersonalOptionsHandler : public OptionsPageUIHandler, + public ProfileSyncServiceObserver, + public BrowserSignin::SigninDelegate { + public: + PersonalOptionsHandler(); + virtual ~PersonalOptionsHandler(); + + // OptionsUIHandler implementation. + virtual void GetLocalizedValues(DictionaryValue* localized_strings); + virtual void Initialize(); + + // WebUIMessageHandler implementation. + virtual void RegisterMessages(); + + // NotificationObserver implementation. + virtual void Observe(NotificationType type, + const NotificationSource& source, + const NotificationDetails& details); + + // ProfileSyncServiceObserver implementation. + virtual void OnStateChanged(); + + // BrowserSignin::SigninDelegate implementation. + virtual void OnLoginSuccess(); + virtual void OnLoginFailure(const GoogleServiceAuthError& error); + + private: + void ObserveThemeChanged(); + void ShowSyncActionDialog(const ListValue* args); + void ShowSyncLoginDialog(const ListValue* args); + void ShowCustomizeSyncDialog(const ListValue* args); + void ThemesReset(const ListValue* args); +#if defined(TOOLKIT_GTK) + void ThemesSetGTK(const ListValue* args); +#endif + + // Called when the user updates the set of enabled data types to sync. |args| + // is ignored. + void OnPreferredDataTypesUpdated(const ListValue* args); + +#if defined(OS_CHROMEOS) + void LoadAccountPicture(const ListValue* args); +#endif + + scoped_ptr<OptionsManagedBannerHandler> banner_handler_; + + DISALLOW_COPY_AND_ASSIGN(PersonalOptionsHandler); +}; + +#endif // CHROME_BROWSER_WEBUI_OPTIONS_PERSONAL_OPTIONS_HANDLER_H_ diff --git a/chrome/browser/dom_ui/options/search_engine_manager_handler.cc b/chrome/browser/webui/options/search_engine_manager_handler.cc index 607ce46..607ce46 100644 --- a/chrome/browser/dom_ui/options/search_engine_manager_handler.cc +++ b/chrome/browser/webui/options/search_engine_manager_handler.cc diff --git a/chrome/browser/webui/options/search_engine_manager_handler.h b/chrome/browser/webui/options/search_engine_manager_handler.h new file mode 100644 index 0000000..abbf364 --- /dev/null +++ b/chrome/browser/webui/options/search_engine_manager_handler.h @@ -0,0 +1,73 @@ +// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CHROME_BROWSER_WEBUI_OPTIONS_SEARCH_ENGINE_MANAGER_HANDLER_H_ +#define CHROME_BROWSER_WEBUI_OPTIONS_SEARCH_ENGINE_MANAGER_HANDLER_H_ + +#include "chrome/browser/dom_ui/options/options_ui.h" +#include "chrome/browser/search_engines/edit_search_engine_controller.h" +#include "ui/base/models/table_model_observer.h" + +class KeywordEditorController; + +class SearchEngineManagerHandler : public OptionsPageUIHandler, + public ui::TableModelObserver, + public EditSearchEngineControllerDelegate { + public: + SearchEngineManagerHandler(); + virtual ~SearchEngineManagerHandler(); + + virtual void Initialize(); + + // OptionsUIHandler implementation. + virtual void GetLocalizedValues(DictionaryValue* localized_strings); + + // ui::TableModelObserver implementation. + virtual void OnModelChanged(); + virtual void OnItemsChanged(int start, int length); + virtual void OnItemsAdded(int start, int length); + virtual void OnItemsRemoved(int start, int length); + + // EditSearchEngineControllerDelegate implementation. + virtual void OnEditedKeyword(const TemplateURL* template_url, + const string16& title, + const string16& keyword, + const std::string& url); + + virtual void RegisterMessages(); + + private: + scoped_ptr<KeywordEditorController> list_controller_; + scoped_ptr<EditSearchEngineController> edit_controller_; + + // Removes the search engine at the given index. Called from WebUI. + void RemoveSearchEngine(const ListValue* args); + + // Sets the search engine at the given index to be default. Called from WebUI. + void SetDefaultSearchEngine(const ListValue* args); + + // Starts an edit session for the search engine at the given index. If the + // index is -1, starts editing a new search engine instead of an existing one. + // Called from WebUI. + void EditSearchEngine(const ListValue* args); + + // Validates the given search engine values, and reports the results back + // to WebUI. Called from WebUI. + void CheckSearchEngineInfoValidity(const ListValue* args); + + // Called when an edit is cancelled. + // Called from WebUI. + void EditCancelled(const ListValue* args); + + // Called when an edit is finished and should be saved. + // Called from WebUI. + void EditCompleted(const ListValue* args); + + // Returns a dictionary to pass to WebUI representing the given search engine. + DictionaryValue* CreateDictionaryForEngine(int index, bool is_default); + + DISALLOW_COPY_AND_ASSIGN(SearchEngineManagerHandler); +}; + +#endif // CHROME_BROWSER_WEBUI_OPTIONS_SEARCH_ENGINE_MANAGER_HANDLER_H_ diff --git a/chrome/browser/dom_ui/options/stop_syncing_handler.cc b/chrome/browser/webui/options/stop_syncing_handler.cc index 9c0c579..9c0c579 100644 --- a/chrome/browser/dom_ui/options/stop_syncing_handler.cc +++ b/chrome/browser/webui/options/stop_syncing_handler.cc diff --git a/chrome/browser/webui/options/stop_syncing_handler.h b/chrome/browser/webui/options/stop_syncing_handler.h new file mode 100644 index 0000000..fe8590a4 --- /dev/null +++ b/chrome/browser/webui/options/stop_syncing_handler.h @@ -0,0 +1,28 @@ +// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CHROME_BROWSER_WEBUI_OPTIONS_STOP_SYNCING_HANDLER_H_ +#define CHROME_BROWSER_WEBUI_OPTIONS_STOP_SYNCING_HANDLER_H_ + +#include "chrome/browser/dom_ui/options/options_ui.h" + +// Chrome personal stuff stop syncing overlay UI handler. +class StopSyncingHandler : public OptionsPageUIHandler { + public: + StopSyncingHandler(); + virtual ~StopSyncingHandler(); + + // OptionsUIHandler implementation. + virtual void GetLocalizedValues(DictionaryValue* localized_strings); + + // WebUIMessageHandler implementation. + virtual void RegisterMessages(); + + private: + void StopSyncing(const ListValue* args); + + DISALLOW_COPY_AND_ASSIGN(StopSyncingHandler); +}; + +#endif // CHROME_BROWSER_WEBUI_OPTIONS_STOP_SYNCING_HANDLER_H_ |