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

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

Issue 7096013: Allow device policy code to be optionally included. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Make changes requested by torne. Created 9 years, 6 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "base/memory/singleton.h" 9 #include "base/memory/singleton.h"
10 #include "base/string_number_conversions.h" 10 #include "base/string_number_conversions.h"
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 new FaviconSource(profile, FaviconSource::FAVICON)); 129 new FaviconSource(profile, FaviconSource::FAVICON));
130 130
131 homepage_.Init(prefs::kHomePage, profile->GetPrefs(), NULL); 131 homepage_.Init(prefs::kHomePage, profile->GetPrefs(), NULL);
132 default_browser_policy_.Init(prefs::kDefaultBrowserSettingEnabled, 132 default_browser_policy_.Init(prefs::kDefaultBrowserSettingEnabled,
133 g_browser_process->local_state(), 133 g_browser_process->local_state(),
134 this); 134 this);
135 UpdateDefaultBrowserState(); 135 UpdateDefaultBrowserState();
136 UpdateStartupPages(); 136 UpdateStartupPages();
137 UpdateSearchEngines(); 137 UpdateSearchEngines();
138 banner_handler_.reset( 138 banner_handler_.reset(
139 new OptionsManagedBannerHandler(web_ui_, 139 OptionsManagedBannerHandler::Create(web_ui_,
140 ASCIIToUTF16("BrowserOptions"), 140 ASCIIToUTF16("BrowserOptions"),
141 OPTIONS_PAGE_GENERAL)); 141 OPTIONS_PAGE_GENERAL));
142 142
143 autocomplete_controller_.reset(new AutocompleteController(profile, this)); 143 autocomplete_controller_.reset(new AutocompleteController(profile, this));
144 } 144 }
145 145
146 void BrowserOptionsHandler::SetHomePage(const ListValue* args) { 146 void BrowserOptionsHandler::SetHomePage(const ListValue* args) {
147 std::string url_string; 147 std::string url_string;
148 std::string do_fixup_string; 148 std::string do_fixup_string;
149 int do_fixup; 149 int do_fixup;
150 CHECK_EQ(args->GetSize(), 2U); 150 CHECK_EQ(args->GetSize(), 2U);
151 CHECK(args->GetString(0, &url_string)); 151 CHECK(args->GetString(0, &url_string));
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after
445 DictionaryValue* entry = new DictionaryValue(); 445 DictionaryValue* entry = new DictionaryValue();
446 entry->SetString("title", match.description); 446 entry->SetString("title", match.description);
447 entry->SetString("displayURL", match.contents); 447 entry->SetString("displayURL", match.contents);
448 entry->SetString("url", match.destination_url.spec()); 448 entry->SetString("url", match.destination_url.spec());
449 suggestions.Append(entry); 449 suggestions.Append(entry);
450 } 450 }
451 451
452 web_ui_->CallJavascriptFunction( 452 web_ui_->CallJavascriptFunction(
453 "BrowserOptions.updateAutocompleteSuggestions", suggestions); 453 "BrowserOptions.updateAutocompleteSuggestions", suggestions);
454 } 454 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698