Index: content/public/browser/graph/browser_context_dependency_visitor_impl.h |
diff --git a/content/public/browser/graph/browser_context_dependency_visitor_impl.h b/content/public/browser/graph/browser_context_dependency_visitor_impl.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..8fab1cb6e4fa28ba805271136ca92fe2acce53c7 |
--- /dev/null |
+++ b/content/public/browser/graph/browser_context_dependency_visitor_impl.h |
@@ -0,0 +1,37 @@ |
+// Copyright (c) 2013 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef CONTENT_PUBLIC_BROWSER_GRAPH_BROWSER_CONTEXT_DEPENDENCY_VISITOR_IMPL_H_ |
+#define CONTENT_PUBLIC_BROWSER_GRAPH_BROWSER_CONTEXT_DEPENDENCY_VISITOR_IMPL_H_ |
+ |
+#include "base/callback.h" |
+#include "base/compiler_specific.h" |
+#include "base/graph/dependency_manager_instance.h" |
+#include "content/public/browser/graph/browser_context_dependency_visitor.h" |
+ |
+namespace content { |
+ |
+template <typename Component> |
+class BrowserContextDependencyVisitorImpl |
+ : public BrowserContextDependencyVisitor { |
+ public: |
+ explicit BrowserContextDependencyVisitorImpl( |
+ const base::Callback<void(Component*)>& completion_callback) |
+ : completion_callback_(completion_callback) {} |
+ |
+ virtual void Visit( |
+ graph::DependencyManagerInstance* dependency_manager) OVERRIDE { |
+ if (dependency_manager) |
+ dependency_manager->Get<Component>(completion_callback_); |
+ else |
+ completion_callback_.Run(NULL); |
+ } |
+ |
+ private: |
+ base::Callback<void(Component*)> completion_callback_; |
+}; |
+ |
+} // namespace content |
+ |
+#endif // CONTENT_PUBLIC_BROWSER_GRAPH_BROWSER_CONTEXT_DEPENDENCY_VISITOR_IMPL_H_ |