Index: chrome/browser/apps/chrome_apps_client.cc |
diff --git a/chrome/browser/apps/chrome_apps_client.cc b/chrome/browser/apps/chrome_apps_client.cc |
new file mode 100644 |
index 0000000000000000000000000000000000000000..766a4dbfb25c6120304bfe9e6521f8fd110c6b31 |
--- /dev/null |
+++ b/chrome/browser/apps/chrome_apps_client.cc |
@@ -0,0 +1,28 @@ |
+// Copyright 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. |
+ |
+#include "chrome/browser/apps/chrome_apps_client.h" |
+ |
+#include "chrome/browser/browser_process.h" |
+#include "chrome/browser/profiles/profile_manager.h" |
+ |
+static base::LazyInstance<ChromeAppsClient> g_client = |
tapted
2013/09/04 01:17:53
BTW, I think you can use leaky traits (singleton o
benwells
2013/09/10 16:48:50
Done.
|
+ LAZY_INSTANCE_INITIALIZER; |
+ |
+ChromeAppsClient::ChromeAppsClient() {} |
+ |
+ChromeAppsClient::~ChromeAppsClient() {} |
+ |
+std::vector<content::BrowserContext*> |
+ ChromeAppsClient::GetLoadedBrowserContexts() { |
+ std::vector<Profile*> profiles = |
+ g_browser_process->profile_manager()->GetLoadedProfiles(); |
+ return std::vector<content::BrowserContext*>(profiles.begin(), |
+ profiles.end()); |
+} |
+ |
+// static |
+ChromeAppsClient* ChromeAppsClient::GetInstance() { |
+ return g_client.Pointer(); |
+} |