OLD | NEW |
(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 |
OLD | NEW |