Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2943)

Unified Diff: chrome/browser/dom_ui/browser_options_handler.h

Issue 3046025: Implement most of the startup page controls in DOMUI prefs (Closed)
Patch Set: Addresses review comments Created 10 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/dom_ui/browser_options_handler.h
diff --git a/chrome/browser/dom_ui/browser_options_handler.h b/chrome/browser/dom_ui/browser_options_handler.h
index 6c37bd5253a8d20fcafcc83a2dff7ba74cba8f2d..794b5253b7ea091476a2a29dd1bd48a5ce0bbf26 100644
--- a/chrome/browser/dom_ui/browser_options_handler.h
+++ b/chrome/browser/dom_ui/browser_options_handler.h
@@ -6,14 +6,18 @@
#define CHROME_BROWSER_DOM_UI_BROWSER_OPTIONS_HANDLER_H_
#pragma once
arv (Not doing code reviews) 2010/07/27 19:02:31 Can you do this in a separate patch?
stuartmorgan 2010/07/27 20:07:23 I'm not doing that; you're looking at the diff bet
+#include "app/table_model_observer.h"
#include "chrome/browser/dom_ui/options_ui.h"
#include "chrome/browser/search_engines/template_url_model.h"
#include "chrome/browser/shell_integration.h"
+class CustomHomePagesTableModel;
+
// Chrome browser options page UI handler.
class BrowserOptionsHandler : public OptionsPageUIHandler,
public ShellIntegration::DefaultBrowserObserver,
- public TemplateURLModelObserver {
+ public TemplateURLModelObserver,
+ public TableModelObserver {
public:
BrowserOptionsHandler();
virtual ~BrowserOptionsHandler();
@@ -31,6 +35,12 @@ class BrowserOptionsHandler : public OptionsPageUIHandler,
// TemplateURLModelObserver implementation.
virtual void OnTemplateURLModelChanged();
+ // 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:
// Makes this the default browser. Called from DOMUI.
void BecomeDefaultBrowser(const Value* value);
@@ -38,6 +48,12 @@ class BrowserOptionsHandler : public OptionsPageUIHandler,
// Sets the search engine at the given index to be default. Called from DOMUI.
void SetDefaultSearchEngine(const Value* value);
+ // Removes the startup page at the given indexes. Called from DOMUI.
+ void RemoveStartupPages(const Value* value);
+
+ // Sets the startup page set to the current pages. Called from DOMUI.
+ void SetStartupPagesToCurrentPages(const Value* value);
+
// Returns the string ID for the given default browser state.
int StatusStringIdForState(ShellIntegration::DefaultBrowserState state);
@@ -48,10 +64,24 @@ class BrowserOptionsHandler : public OptionsPageUIHandler,
// 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 DOMUI.
+ void UpdateStartupPages();
+
+ // Loads the possible default search engine list and reports it to the DOMUI.
+ void UpdateSearchEngines();
+
+ // Writes the current set of startup pages to prefs.
+ void SaveStartupPagesPref();
+
scoped_refptr<ShellIntegration::DefaultBrowserWorker> default_browser_worker_;
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_;
+
DISALLOW_COPY_AND_ASSIGN(BrowserOptionsHandler);
};

Powered by Google App Engine
This is Rietveld 408576698