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

Side by Side Diff: chrome/browser/extensions/api/copresence/copresence_util.cc

Issue 444513005: Add the Copresence API. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 4 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 2014 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/extensions/api/copresence/copresence_util.h"
6
7 #include "chrome/browser/extensions/api/copresence/copresence_api.h"
8 #include "components/copresence/public/whispernet_client.h"
9 #include "content/public/browser/browser_context.h"
10
11 namespace extensions {
12
13 CopresenceService* GetCopresenceService(
14 content::BrowserContext* browser_context) {
15 return CopresenceService::GetFactoryInstance()->Get(browser_context);
16 }
17
18 copresence::CopresenceClient* GetCopresenceClient(
19 content::BrowserContext* browser_context) {
20 CopresenceService* service_ptr = GetCopresenceService(browser_context);
21 return service_ptr ? service_ptr->client() : NULL;
22 }
23
24 copresence::WhispernetClient* GetWhispernetClient(
25 content::BrowserContext* browser_context) {
26 CopresenceService* service_ptr = GetCopresenceService(browser_context);
27 return service_ptr ? service_ptr->whispernet_client() : NULL;
28 }
29
30 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698