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

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

Issue 78763002: Move PolicyMap and its dependencies to components/policy/. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: export nested struct Created 7 years, 1 month 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
(Empty)
1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "chrome/browser/policy/external_data_fetcher.h"
6
7 #include "base/callback.h"
8 #include "chrome/browser/policy/external_data_manager.h"
9
10 namespace policy {
11
12 ExternalDataFetcher::ExternalDataFetcher(
13 base::WeakPtr<ExternalDataManager> manager,
14 const std::string& policy)
15 : manager_(manager),
16 policy_(policy) {
17 }
18
19 ExternalDataFetcher::ExternalDataFetcher(const ExternalDataFetcher& other)
20 : manager_(other.manager_),
21 policy_(other.policy_) {
22 }
23
24 ExternalDataFetcher::~ExternalDataFetcher() {
25 }
26
27 // static
28 bool ExternalDataFetcher::Equals(const ExternalDataFetcher* first,
29 const ExternalDataFetcher* second) {
30 if (!first && !second)
31 return true;
32 if (!first || !second)
33 return false;
34 return first->manager_.get() == second->manager_.get() &&
35 first->policy_ == second->policy_;
36 }
37
38 void ExternalDataFetcher::Fetch(const FetchCallback& callback) const {
39 if (manager_)
40 manager_->Fetch(policy_, callback);
41 else
42 callback.Run(scoped_ptr<std::string>());
43 }
44
45 } // namespace policy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698