[safe-browsing] Database full hash matches like prefix match.
[chromium-blink-merge.git] / chrome / browser / apps / chrome_apps_client.cc
blob91032091825d7dfaca80ed561792be3904312687
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/apps/chrome_apps_client.h"
7 #include "apps/app_window.h"
8 #include "base/memory/singleton.h"
9 #include "chrome/browser/browser_process.h"
10 #include "chrome/browser/profiles/profile_manager.h"
11 #include "extensions/common/extension.h"
13 // TODO(jamescook): We probably shouldn't compile this class at all on Android.
14 // See http://crbug.com/343612
15 #if !defined(OS_ANDROID)
16 #include "chrome/browser/lifetime/application_lifetime.h"
17 #include "chrome/browser/ui/apps/chrome_app_window_delegate.h"
18 #endif
20 ChromeAppsClient::ChromeAppsClient() {}
22 ChromeAppsClient::~ChromeAppsClient() {}
24 // static
25 ChromeAppsClient* ChromeAppsClient::GetInstance() {
26 return Singleton<ChromeAppsClient,
27 LeakySingletonTraits<ChromeAppsClient> >::get();
30 std::vector<content::BrowserContext*>
31 ChromeAppsClient::GetLoadedBrowserContexts() {
32 std::vector<Profile*> profiles =
33 g_browser_process->profile_manager()->GetLoadedProfiles();
34 return std::vector<content::BrowserContext*>(profiles.begin(),
35 profiles.end());
38 apps::AppWindow* ChromeAppsClient::CreateAppWindow(
39 content::BrowserContext* context,
40 const extensions::Extension* extension) {
41 #if defined(OS_ANDROID)
42 return NULL;
43 #else
44 return new apps::AppWindow(context, new ChromeAppWindowDelegate, extension);
45 #endif
48 void ChromeAppsClient::IncrementKeepAliveCount() {
49 #if !defined(OS_ANDROID)
50 chrome::IncrementKeepAliveCount();
51 #endif
54 void ChromeAppsClient::DecrementKeepAliveCount() {
55 #if !defined(OS_ANDROID)
56 chrome::DecrementKeepAliveCount();
57 #endif