OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/dom_ui/options/browser_options_handler.h" | 5 #include "chrome/browser/dom_ui/options/browser_options_handler.h" |
6 | 6 |
7 #include "app/l10n_util.h" | 7 #include "app/l10n_util.h" |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/scoped_ptr.h" | 9 #include "base/scoped_ptr.h" |
10 #include "base/singleton.h" | 10 #include "base/singleton.h" |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 dom_ui_->RegisterMessageCallback( | 108 dom_ui_->RegisterMessageCallback( |
109 "setStartupPagesToCurrentPages", | 109 "setStartupPagesToCurrentPages", |
110 NewCallback(this, &BrowserOptionsHandler::SetStartupPagesToCurrentPages)); | 110 NewCallback(this, &BrowserOptionsHandler::SetStartupPagesToCurrentPages)); |
111 } | 111 } |
112 | 112 |
113 void BrowserOptionsHandler::Initialize() { | 113 void BrowserOptionsHandler::Initialize() { |
114 // Create our favicon data source. | 114 // Create our favicon data source. |
115 BrowserThread::PostTask( | 115 BrowserThread::PostTask( |
116 BrowserThread::IO, FROM_HERE, | 116 BrowserThread::IO, FROM_HERE, |
117 NewRunnableMethod( | 117 NewRunnableMethod( |
118 Singleton<ChromeURLDataManager>::get(), | 118 ChromeURLDataManager::GetInstance(), |
119 &ChromeURLDataManager::AddDataSource, | 119 &ChromeURLDataManager::AddDataSource, |
120 make_scoped_refptr(new DOMUIFavIconSource(dom_ui_->GetProfile())))); | 120 make_scoped_refptr(new DOMUIFavIconSource(dom_ui_->GetProfile())))); |
121 | 121 |
122 UpdateDefaultBrowserState(); | 122 UpdateDefaultBrowserState(); |
123 UpdateStartupPages(); | 123 UpdateStartupPages(); |
124 UpdateSearchEngines(); | 124 UpdateSearchEngines(); |
125 banner_handler_.reset( | 125 banner_handler_.reset( |
126 new OptionsManagedBannerHandler(dom_ui_, | 126 new OptionsManagedBannerHandler(dom_ui_, |
127 ASCIIToUTF16("BrowserOptions"), | 127 ASCIIToUTF16("BrowserOptions"), |
128 OPTIONS_PAGE_GENERAL)); | 128 OPTIONS_PAGE_GENERAL)); |
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
351 } | 351 } |
352 | 352 |
353 void BrowserOptionsHandler::SaveStartupPagesPref() { | 353 void BrowserOptionsHandler::SaveStartupPagesPref() { |
354 PrefService* prefs = dom_ui_->GetProfile()->GetPrefs(); | 354 PrefService* prefs = dom_ui_->GetProfile()->GetPrefs(); |
355 | 355 |
356 SessionStartupPref pref = SessionStartupPref::GetStartupPref(prefs); | 356 SessionStartupPref pref = SessionStartupPref::GetStartupPref(prefs); |
357 pref.urls = startup_custom_pages_table_model_->GetURLs(); | 357 pref.urls = startup_custom_pages_table_model_->GetURLs(); |
358 | 358 |
359 SessionStartupPref::SetStartupPref(prefs, pref); | 359 SessionStartupPref::SetStartupPref(prefs, pref); |
360 } | 360 } |
OLD | NEW |