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

Side by Side Diff: chrome/browser/dom_ui/options/browser_options_handler.cc

Issue 5519016: Add a new GetInstance() method for singleton classes used in chrome/browser files. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 10 years 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/dom_ui/new_tab_ui.cc ('k') | chrome/browser/dom_ui/options/options_ui.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « chrome/browser/dom_ui/new_tab_ui.cc ('k') | chrome/browser/dom_ui/options/options_ui.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698