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

Side by Side Diff: chrome/browser/policy/configuration_policy_handler.cc

Issue 10173001: Add a Profile* member to TemplateURL. This makes some invocations of ReplaceSearchTerms() a bit le… (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 8 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/policy/configuration_policy_handler.h" 5 #include "chrome/browser/policy/configuration_policy_handler.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/file_path.h" 9 #include "base/file_path.h"
10 #include "base/json/json_writer.h" 10 #include "base/json/json_writer.h"
(...skipping 588 matching lines...) Expand 10 before | Expand all | Expand 10 after
599 const PolicyMap& policies, 599 const PolicyMap& policies,
600 const Value** url_value, 600 const Value** url_value,
601 std::string* url_string) { 601 std::string* url_string) {
602 *url_value = policies.GetValue(key::kDefaultSearchProviderSearchURL); 602 *url_value = policies.GetValue(key::kDefaultSearchProviderSearchURL);
603 if (!*url_value || !(*url_value)->GetAsString(url_string) || 603 if (!*url_value || !(*url_value)->GetAsString(url_string) ||
604 url_string->empty()) 604 url_string->empty())
605 return false; 605 return false;
606 TemplateURLData data; 606 TemplateURLData data;
607 data.SetURL(*url_string); 607 data.SetURL(*url_string);
608 SearchTermsData search_terms_data; 608 SearchTermsData search_terms_data;
609 return TemplateURL(data).SupportsReplacementUsingTermsData(search_terms_data); 609 return TemplateURL(NULL, data).SupportsReplacementUsingTermsData(
610 search_terms_data);
610 } 611 }
611 612
612 void DefaultSearchPolicyHandler::EnsureStringPrefExists( 613 void DefaultSearchPolicyHandler::EnsureStringPrefExists(
613 PrefValueMap* prefs, 614 PrefValueMap* prefs,
614 const std::string& path) { 615 const std::string& path) {
615 std::string value; 616 std::string value;
616 if (!prefs->GetString(path, &value)) 617 if (!prefs->GetString(path, &value))
617 prefs->SetString(path, value); 618 prefs->SetString(path, value);
618 } 619 }
619 620
(...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after
1006 errors->AddError(key::kClearSiteDataOnExit, 1007 errors->AddError(key::kClearSiteDataOnExit,
1007 IDS_POLICY_OVERRIDDEN, 1008 IDS_POLICY_OVERRIDDEN,
1008 key::kRestoreOnStartup); 1009 key::kRestoreOnStartup);
1009 } 1010 }
1010 } 1011 }
1011 } 1012 }
1012 return true; 1013 return true;
1013 } 1014 }
1014 1015
1015 } // namespace policy 1016 } // namespace policy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698