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

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

Issue 9982018: Move most TemplateURL data members to a new struct, TemplateURLData. This allows us to eliminate t… (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 579 matching lines...) Expand 10 before | Expand all | Expand 10 after
590 !enabled; 590 !enabled;
591 } 591 }
592 592
593 bool DefaultSearchPolicyHandler::DefaultSearchURLIsValid( 593 bool DefaultSearchPolicyHandler::DefaultSearchURLIsValid(
594 const PolicyMap& policies, 594 const PolicyMap& policies,
595 const Value** url_value, 595 const Value** url_value,
596 std::string* url_string) { 596 std::string* url_string) {
597 *url_value = policies.GetValue(key::kDefaultSearchProviderSearchURL); 597 *url_value = policies.GetValue(key::kDefaultSearchProviderSearchURL);
598 if (!*url_value || !(*url_value)->GetAsString(url_string)) 598 if (!*url_value || !(*url_value)->GetAsString(url_string))
599 return false; 599 return false;
600 TemplateURL t_url; 600 TemplateURLData data;
601 t_url.SetURL(*url_string); 601 data.SetURL(*url_string);
602 SearchTermsData search_terms_data; 602 SearchTermsData search_terms_data;
603 return t_url.url_ref().SupportsReplacementUsingTermsData(search_terms_data); 603 return TemplateURL(data).SupportsReplacementUsingTermsData(search_terms_data);
604 } 604 }
605 605
606 void DefaultSearchPolicyHandler::EnsureStringPrefExists( 606 void DefaultSearchPolicyHandler::EnsureStringPrefExists(
607 PrefValueMap* prefs, 607 PrefValueMap* prefs,
608 const std::string& path) { 608 const std::string& path) {
609 std::string value; 609 std::string value;
610 if (!prefs->GetString(path, &value)) 610 if (!prefs->GetString(path, &value))
611 prefs->SetString(path, value); 611 prefs->SetString(path, value);
612 } 612 }
613 613
(...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after
1000 errors->AddError(key::kClearSiteDataOnExit, 1000 errors->AddError(key::kClearSiteDataOnExit,
1001 IDS_POLICY_OVERRIDDEN, 1001 IDS_POLICY_OVERRIDDEN,
1002 key::kRestoreOnStartup); 1002 key::kRestoreOnStartup);
1003 } 1003 }
1004 } 1004 }
1005 } 1005 }
1006 return true; 1006 return true;
1007 } 1007 }
1008 1008
1009 } // namespace policy 1009 } // namespace policy
OLDNEW
« no previous file with comments | « chrome/browser/instant/instant_browsertest.cc ('k') | chrome/browser/protector/default_search_provider_change_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698