- add sources.
[platform/framework/web/crosswalk.git] / src / chrome / browser / extensions / chrome_extensions_browser_client.cc
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/extensions/chrome_extensions_browser_client.h"
6
7 #include "chrome/browser/browser_process.h"
8 #include "chrome/browser/profiles/profile.h"
9
10 namespace extensions {
11
12 namespace {
13
14 static base::LazyInstance<ChromeExtensionsBrowserClient> g_client =
15     LAZY_INSTANCE_INITIALIZER;
16
17 }  // namespace
18
19 ChromeExtensionsBrowserClient::ChromeExtensionsBrowserClient() {}
20
21 ChromeExtensionsBrowserClient::~ChromeExtensionsBrowserClient() {}
22
23 bool ChromeExtensionsBrowserClient::IsShuttingDown() {
24   return g_browser_process->IsShuttingDown();
25 }
26
27 bool ChromeExtensionsBrowserClient::IsSameContext(
28     content::BrowserContext* first,
29     content::BrowserContext* second) {
30   return static_cast<Profile*>(first)->IsSameProfile(
31       static_cast<Profile*>(second));
32 }
33
34 bool ChromeExtensionsBrowserClient::HasOffTheRecordContext(
35     content::BrowserContext* context) {
36   return static_cast<Profile*>(context)->HasOffTheRecordProfile();
37 }
38
39 content::BrowserContext* ChromeExtensionsBrowserClient::GetOffTheRecordContext(
40     content::BrowserContext* context) {
41   return static_cast<Profile*>(context)->GetOffTheRecordProfile();
42 }
43
44 // static
45 ChromeExtensionsBrowserClient* ChromeExtensionsBrowserClient::GetInstance() {
46   return g_client.Pointer();
47 }
48
49 }  // namespace extensions