Chromium Code Reviews| OLD | NEW |
|---|---|
| (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/apps/chrome_apps_client.h" | |
| 6 | |
| 7 #include "chrome/browser/browser_process.h" | |
| 8 #include "chrome/browser/profiles/profile_manager.h" | |
| 9 | |
| 10 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.
| |
| 11 LAZY_INSTANCE_INITIALIZER; | |
| 12 | |
| 13 ChromeAppsClient::ChromeAppsClient() {} | |
| 14 | |
| 15 ChromeAppsClient::~ChromeAppsClient() {} | |
| 16 | |
| 17 std::vector<content::BrowserContext*> | |
| 18 ChromeAppsClient::GetLoadedBrowserContexts() { | |
| 19 std::vector<Profile*> profiles = | |
| 20 g_browser_process->profile_manager()->GetLoadedProfiles(); | |
| 21 return std::vector<content::BrowserContext*>(profiles.begin(), | |
| 22 profiles.end()); | |
| 23 } | |
| 24 | |
| 25 // static | |
| 26 ChromeAppsClient* ChromeAppsClient::GetInstance() { | |
| 27 return g_client.Pointer(); | |
| 28 } | |
| OLD | NEW |