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

Side by Side Diff: chrome/browser/apps/chrome_apps_client.cc

Issue 23524005: Introduce AppsClient and use it in apps to get the loaded profiles list. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Compile, self nits Created 7 years, 3 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 | 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/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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698