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

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

Issue 11189088: Add controlled setting indicator for default search engine configuration (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Comment addressed. Created 8 years, 2 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 <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 763 matching lines...) Expand 10 before | Expand all | Expand 10 after
774 *status_string, *is_default, *can_be_default); 774 *status_string, *is_default, *can_be_default);
775 } 775 }
776 776
777 void BrowserOptionsHandler::OnTemplateURLServiceChanged() { 777 void BrowserOptionsHandler::OnTemplateURLServiceChanged() {
778 if (!template_url_service_ || !template_url_service_->loaded()) 778 if (!template_url_service_ || !template_url_service_->loaded())
779 return; 779 return;
780 780
781 const TemplateURL* default_url = 781 const TemplateURL* default_url =
782 template_url_service_->GetDefaultSearchProvider(); 782 template_url_service_->GetDefaultSearchProvider();
783 783
784 int default_index = 0; 784 int default_index = -1;
785 ListValue search_engines; 785 ListValue search_engines;
786 TemplateURLService::TemplateURLVector model_urls( 786 TemplateURLService::TemplateURLVector model_urls(
787 template_url_service_->GetTemplateURLs()); 787 template_url_service_->GetTemplateURLs());
788 for (size_t i = 0; i < model_urls.size(); ++i) { 788 for (size_t i = 0; i < model_urls.size(); ++i) {
789 if (!model_urls[i]->ShowInDefaultList()) 789 if (!model_urls[i]->ShowInDefaultList())
790 continue; 790 continue;
791 791
792 DictionaryValue* entry = new DictionaryValue(); 792 DictionaryValue* entry = new DictionaryValue();
793 entry->SetString("name", model_urls[i]->short_name()); 793 entry->SetString("name", model_urls[i]->short_name());
794 entry->SetInteger("index", i); 794 entry->SetInteger("index", i);
(...skipping 606 matching lines...) Expand 10 before | Expand all | Expand 10 after
1401 l10n_util::GetStringUTF16(IDS_PRODUCT_NAME)); 1401 l10n_util::GetStringUTF16(IDS_PRODUCT_NAME));
1402 } 1402 }
1403 StringValue label(label_str); 1403 StringValue label(label_str);
1404 1404
1405 web_ui()->CallJavascriptFunction( 1405 web_ui()->CallJavascriptFunction(
1406 "BrowserOptions.setupProxySettingsSection", disabled, label); 1406 "BrowserOptions.setupProxySettingsSection", disabled, label);
1407 #endif // !defined(OS_CHROMEOS) 1407 #endif // !defined(OS_CHROMEOS)
1408 } 1408 }
1409 1409
1410 } // namespace options 1410 } // namespace options
OLDNEW
« no previous file with comments | « chrome/browser/resources/options/search_engine_manager_engine_list.js ('k') | chrome/test/data/policy/policy_test_cases.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698