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.
5 #include "chrome/browser/extensions/chrome_extensions_browser_client.h"
7 #include "chrome/browser/browser_process.h"
8 #include "chrome/browser/profiles/profile.h"
10 namespace extensions {
14 static base::LazyInstance<ChromeExtensionsBrowserClient> g_client =
15 LAZY_INSTANCE_INITIALIZER;
19 ChromeExtensionsBrowserClient::ChromeExtensionsBrowserClient() {}
21 ChromeExtensionsBrowserClient::~ChromeExtensionsBrowserClient() {}
23 bool ChromeExtensionsBrowserClient::IsShuttingDown() {
24 return g_browser_process->IsShuttingDown();
27 bool ChromeExtensionsBrowserClient::IsSameContext(
28 content::BrowserContext* first,
29 content::BrowserContext* second) {
30 return static_cast<Profile*>(first)->IsSameProfile(
31 static_cast<Profile*>(second));
34 bool ChromeExtensionsBrowserClient::HasOffTheRecordContext(
35 content::BrowserContext* context) {
36 return static_cast<Profile*>(context)->HasOffTheRecordProfile();
39 content::BrowserContext* ChromeExtensionsBrowserClient::GetOffTheRecordContext(
40 content::BrowserContext* context) {
41 return static_cast<Profile*>(context)->GetOffTheRecordProfile();
45 ChromeExtensionsBrowserClient* ChromeExtensionsBrowserClient::GetInstance() {
46 return g_client.Pointer();
49 } // namespace extensions