Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
|
csilv
2011/01/19 18:42:25
bump to 2011, here and other files
| |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_BROWSER_DOM_UI_OPTIONS_BROWSER_OPTIONS_HANDLER_H_ | 5 #ifndef CHROME_BROWSER_DOM_UI_OPTIONS_BROWSER_OPTIONS_HANDLER_H_ |
| 6 #define CHROME_BROWSER_DOM_UI_OPTIONS_BROWSER_OPTIONS_HANDLER_H_ | 6 #define CHROME_BROWSER_DOM_UI_OPTIONS_BROWSER_OPTIONS_HANDLER_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "chrome/browser/dom_ui/options/options_ui.h" | 9 #include "chrome/browser/dom_ui/options/options_ui.h" |
| 10 #include "chrome/browser/prefs/pref_member.h" | |
| 10 #include "chrome/browser/search_engines/template_url_model_observer.h" | 11 #include "chrome/browser/search_engines/template_url_model_observer.h" |
| 11 #include "chrome/browser/shell_integration.h" | 12 #include "chrome/browser/shell_integration.h" |
| 12 #include "ui/base/models/table_model_observer.h" | 13 #include "ui/base/models/table_model_observer.h" |
| 13 | 14 |
| 14 class CustomHomePagesTableModel; | 15 class CustomHomePagesTableModel; |
| 15 class OptionsManagedBannerHandler; | 16 class OptionsManagedBannerHandler; |
| 17 class StringPrefMember; | |
| 16 class TemplateURLModel; | 18 class TemplateURLModel; |
| 17 | 19 |
| 18 // Chrome browser options page UI handler. | 20 // Chrome browser options page UI handler. |
| 19 class BrowserOptionsHandler : public OptionsPageUIHandler, | 21 class BrowserOptionsHandler : public OptionsPageUIHandler, |
| 20 public ShellIntegration::DefaultBrowserObserver, | 22 public ShellIntegration::DefaultBrowserObserver, |
| 21 public TemplateURLModelObserver, | 23 public TemplateURLModelObserver, |
| 22 public ui::TableModelObserver { | 24 public ui::TableModelObserver { |
| 23 public: | 25 public: |
| 24 BrowserOptionsHandler(); | 26 BrowserOptionsHandler(); |
| 25 virtual ~BrowserOptionsHandler(); | 27 virtual ~BrowserOptionsHandler(); |
| (...skipping 11 matching lines...) Expand all Loading... | |
| 37 // TemplateURLModelObserver implementation. | 39 // TemplateURLModelObserver implementation. |
| 38 virtual void OnTemplateURLModelChanged(); | 40 virtual void OnTemplateURLModelChanged(); |
| 39 | 41 |
| 40 // ui::TableModelObserver implementation. | 42 // ui::TableModelObserver implementation. |
| 41 virtual void OnModelChanged(); | 43 virtual void OnModelChanged(); |
| 42 virtual void OnItemsChanged(int start, int length); | 44 virtual void OnItemsChanged(int start, int length); |
| 43 virtual void OnItemsAdded(int start, int length); | 45 virtual void OnItemsAdded(int start, int length); |
| 44 virtual void OnItemsRemoved(int start, int length); | 46 virtual void OnItemsRemoved(int start, int length); |
| 45 | 47 |
| 46 private: | 48 private: |
| 49 // Sets the home page to the given string. Called from DOMUI. | |
| 50 void SetHomePage(const ListValue* args); | |
| 51 | |
| 47 // Makes this the default browser. Called from DOMUI. | 52 // Makes this the default browser. Called from DOMUI. |
| 48 void BecomeDefaultBrowser(const ListValue* args); | 53 void BecomeDefaultBrowser(const ListValue* args); |
| 49 | 54 |
| 50 // Sets the search engine at the given index to be default. Called from DOMUI. | 55 // Sets the search engine at the given index to be default. Called from DOMUI. |
| 51 void SetDefaultSearchEngine(const ListValue* args); | 56 void SetDefaultSearchEngine(const ListValue* args); |
| 52 | 57 |
| 53 // Removes the startup page at the given indexes. Called from DOMUI. | 58 // Removes the startup page at the given indexes. Called from DOMUI. |
| 54 void RemoveStartupPages(const ListValue* args); | 59 void RemoveStartupPages(const ListValue* args); |
| 55 | 60 |
| 56 // Adds a startup page with the given URL after the given index. | 61 // Adds a startup page with the given URL after the given index. |
| (...skipping 21 matching lines...) Expand all Loading... | |
| 78 void UpdateStartupPages(); | 83 void UpdateStartupPages(); |
| 79 | 84 |
| 80 // Loads the possible default search engine list and reports it to the DOMUI. | 85 // Loads the possible default search engine list and reports it to the DOMUI. |
| 81 void UpdateSearchEngines(); | 86 void UpdateSearchEngines(); |
| 82 | 87 |
| 83 // Writes the current set of startup pages to prefs. | 88 // Writes the current set of startup pages to prefs. |
| 84 void SaveStartupPagesPref(); | 89 void SaveStartupPagesPref(); |
| 85 | 90 |
| 86 scoped_refptr<ShellIntegration::DefaultBrowserWorker> default_browser_worker_; | 91 scoped_refptr<ShellIntegration::DefaultBrowserWorker> default_browser_worker_; |
| 87 | 92 |
| 93 StringPrefMember homepage_; | |
| 94 | |
| 88 TemplateURLModel* template_url_model_; // Weak. | 95 TemplateURLModel* template_url_model_; // Weak. |
| 89 | 96 |
| 90 // TODO(stuartmorgan): Once there are no other clients of | 97 // TODO(stuartmorgan): Once there are no other clients of |
| 91 // CustomHomePagesTableModel, consider changing it to something more like | 98 // CustomHomePagesTableModel, consider changing it to something more like |
| 92 // TemplateURLModel. | 99 // TemplateURLModel. |
| 93 scoped_ptr<CustomHomePagesTableModel> startup_custom_pages_table_model_; | 100 scoped_ptr<CustomHomePagesTableModel> startup_custom_pages_table_model_; |
| 94 scoped_ptr<OptionsManagedBannerHandler> banner_handler_; | 101 scoped_ptr<OptionsManagedBannerHandler> banner_handler_; |
| 95 | 102 |
| 96 DISALLOW_COPY_AND_ASSIGN(BrowserOptionsHandler); | 103 DISALLOW_COPY_AND_ASSIGN(BrowserOptionsHandler); |
| 97 }; | 104 }; |
| 98 | 105 |
| 99 #endif // CHROME_BROWSER_DOM_UI_OPTIONS_BROWSER_OPTIONS_HANDLER_H_ | 106 #endif // CHROME_BROWSER_DOM_UI_OPTIONS_BROWSER_OPTIONS_HANDLER_H_ |
| OLD | NEW |