extensions_delegate.cc revision 1320f92c476a1ad9d19dba2a48c72b75566198e9
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 "athena/extensions/public/extensions_delegate.h"
6
7#include "base/logging.h"
8
9namespace athena {
10namespace {
11
12ExtensionsDelegate* instance = NULL;
13
14}  // namespace
15
16ExtensionsDelegate::ExtensionsDelegate() {
17  DCHECK(!instance);
18  instance = this;
19}
20
21ExtensionsDelegate::~ExtensionsDelegate() {
22  DCHECK(instance);
23  instance = NULL;
24}
25
26// static
27ExtensionsDelegate* ExtensionsDelegate::Get(content::BrowserContext* context) {
28  DCHECK(instance);
29  DCHECK_EQ(context, instance->GetBrowserContext());
30  return instance;
31}
32
33// static
34void ExtensionsDelegate::Shutdown() {
35  DCHECK(instance);
36  delete instance;
37}
38
39}  // namespace athena
40