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

Side by Side Diff: chrome/browser/ui/webui/options/browser_options_handler.cc

Issue 9693032: [uber page] Split up initialization of handlers from initialization of webui pages (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 8 years, 9 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/ui/webui/options/browser_options_handler.h" 5 #include "chrome/browser/ui/webui/options/browser_options_handler.h"
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/bind_helpers.h" 9 #include "base/bind_helpers.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 base::Bind(&BrowserOptionsHandler::EnableInstant, 140 base::Bind(&BrowserOptionsHandler::EnableInstant,
141 base::Unretained(this))); 141 base::Unretained(this)));
142 web_ui()->RegisterMessageCallback("disableInstant", 142 web_ui()->RegisterMessageCallback("disableInstant",
143 base::Bind(&BrowserOptionsHandler::DisableInstant, 143 base::Bind(&BrowserOptionsHandler::DisableInstant,
144 base::Unretained(this))); 144 base::Unretained(this)));
145 web_ui()->RegisterMessageCallback("getInstantFieldTrialStatus", 145 web_ui()->RegisterMessageCallback("getInstantFieldTrialStatus",
146 base::Bind(&BrowserOptionsHandler::GetInstantFieldTrialStatus, 146 base::Bind(&BrowserOptionsHandler::GetInstantFieldTrialStatus,
147 base::Unretained(this))); 147 base::Unretained(this)));
148 } 148 }
149 149
150 void BrowserOptionsHandler::Initialize() { 150 void BrowserOptionsHandler::InitializeHandler() {
151 Profile* profile = Profile::FromWebUI(web_ui()); 151 Profile* profile = Profile::FromWebUI(web_ui());
152 152
153 // Create our favicon data source. 153 // Create our favicon data source.
154 profile->GetChromeURLDataManager()->AddDataSource( 154 profile->GetChromeURLDataManager()->AddDataSource(
155 new FaviconSource(profile, FaviconSource::FAVICON)); 155 new FaviconSource(profile, FaviconSource::FAVICON));
156 156
157 homepage_.Init(prefs::kHomePage, profile->GetPrefs(), NULL); 157 homepage_.Init(prefs::kHomePage, profile->GetPrefs(), NULL);
158 default_browser_policy_.Init(prefs::kDefaultBrowserSettingEnabled, 158 default_browser_policy_.Init(prefs::kDefaultBrowserSettingEnabled,
159 g_browser_process->local_state(), 159 g_browser_process->local_state(),
160 this); 160 this);
(...skipping 416 matching lines...) Expand 10 before | Expand all | Expand 10 after
577 DictionaryValue* entry = new DictionaryValue(); 577 DictionaryValue* entry = new DictionaryValue();
578 entry->SetString("title", match.description); 578 entry->SetString("title", match.description);
579 entry->SetString("displayURL", match.contents); 579 entry->SetString("displayURL", match.contents);
580 entry->SetString("url", match.destination_url.spec()); 580 entry->SetString("url", match.destination_url.spec());
581 suggestions.Append(entry); 581 suggestions.Append(entry);
582 } 582 }
583 583
584 web_ui()->CallJavascriptFunction( 584 web_ui()->CallJavascriptFunction(
585 "BrowserOptions.updateAutocompleteSuggestions", suggestions); 585 "BrowserOptions.updateAutocompleteSuggestions", suggestions);
586 } 586 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698