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

Side by Side Diff: chrome/browser/chromeos/net/onc_utils.cc

Issue 826743003: Update {virtual,override,final} to follow C++11 style chrome/browser/chromeos/net. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 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
« no previous file with comments | « chrome/browser/chromeos/net/network_portal_web_dialog.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/chromeos/net/onc_utils.h" 5 #include "chrome/browser/chromeos/net/onc_utils.h"
6 6
7 #include "base/bind_helpers.h" 7 #include "base/bind_helpers.h"
8 #include "base/json/json_writer.h" 8 #include "base/json/json_writer.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/prefs/pref_service.h" 10 #include "base/prefs/pref_service.h"
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 } 147 }
148 148
149 namespace { 149 namespace {
150 150
151 // This class defines which string placeholders of ONC are replaced by which 151 // This class defines which string placeholders of ONC are replaced by which
152 // user attribute. 152 // user attribute.
153 class UserStringSubstitution : public chromeos::onc::StringSubstitution { 153 class UserStringSubstitution : public chromeos::onc::StringSubstitution {
154 public: 154 public:
155 explicit UserStringSubstitution(const user_manager::User* user) 155 explicit UserStringSubstitution(const user_manager::User* user)
156 : user_(user) {} 156 : user_(user) {}
157 virtual ~UserStringSubstitution() {} 157 ~UserStringSubstitution() override {}
158 158
159 virtual bool GetSubstitute(const std::string& placeholder, 159 bool GetSubstitute(const std::string& placeholder,
160 std::string* substitute) const override { 160 std::string* substitute) const override {
161 if (placeholder == ::onc::substitutes::kLoginIDField) 161 if (placeholder == ::onc::substitutes::kLoginIDField)
162 *substitute = user_->GetAccountName(false); 162 *substitute = user_->GetAccountName(false);
163 else if (placeholder == ::onc::substitutes::kEmailField) 163 else if (placeholder == ::onc::substitutes::kEmailField)
164 *substitute = user_->email(); 164 *substitute = user_->email();
165 else 165 else
166 return false; 166 return false;
167 return true; 167 return true;
168 } 168 }
169 169
170 private: 170 private:
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after
451 const PrefService* local_state_prefs, 451 const PrefService* local_state_prefs,
452 const NetworkState& network) { 452 const NetworkState& network) {
453 ::onc::ONCSource ignored_onc_source; 453 ::onc::ONCSource ignored_onc_source;
454 const base::DictionaryValue* policy = onc::GetPolicyForNetwork( 454 const base::DictionaryValue* policy = onc::GetPolicyForNetwork(
455 profile_prefs, local_state_prefs, network, &ignored_onc_source); 455 profile_prefs, local_state_prefs, network, &ignored_onc_source);
456 return policy != NULL; 456 return policy != NULL;
457 } 457 }
458 458
459 } // namespace onc 459 } // namespace onc
460 } // namespace chromeos 460 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/net/network_portal_web_dialog.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698