diff options
Diffstat (limited to 'chrome/browser/apps')
-rw-r--r-- | chrome/browser/apps/chrome_apps_client.cc | 27 | ||||
-rw-r--r-- | chrome/browser/apps/chrome_apps_client.h | 33 | ||||
-rw-r--r-- | chrome/browser/apps/web_view_interactive_browsertest.cc | 1 |
3 files changed, 61 insertions, 0 deletions
diff --git a/chrome/browser/apps/chrome_apps_client.cc b/chrome/browser/apps/chrome_apps_client.cc new file mode 100644 index 0000000..4a9f4ca --- /dev/null +++ b/chrome/browser/apps/chrome_apps_client.cc @@ -0,0 +1,27 @@ +// Copyright 2013 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "chrome/browser/apps/chrome_apps_client.h" + +#include "base/memory/singleton.h" +#include "chrome/browser/browser_process.h" +#include "chrome/browser/profiles/profile_manager.h" + +ChromeAppsClient::ChromeAppsClient() {} + +ChromeAppsClient::~ChromeAppsClient() {} + +// static +ChromeAppsClient* ChromeAppsClient::GetInstance() { + return Singleton<ChromeAppsClient, + LeakySingletonTraits<ChromeAppsClient> >::get(); +} + +std::vector<content::BrowserContext*> + ChromeAppsClient::GetLoadedBrowserContexts() { + std::vector<Profile*> profiles = + g_browser_process->profile_manager()->GetLoadedProfiles(); + return std::vector<content::BrowserContext*>(profiles.begin(), + profiles.end()); +} diff --git a/chrome/browser/apps/chrome_apps_client.h b/chrome/browser/apps/chrome_apps_client.h new file mode 100644 index 0000000..7788961 --- /dev/null +++ b/chrome/browser/apps/chrome_apps_client.h @@ -0,0 +1,33 @@ +// Copyright 2013 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CHROME_BROWSER_APPS_CHROME_APPS_CLIENT_H_ +#define CHROME_BROWSER_APPS_CHROME_APPS_CLIENT_H_ + +#include "apps/apps_client.h" +#include "base/basictypes.h" +#include "base/compiler_specific.h" + +template<typename T> struct DefaultSingletonTraits; + +// The implementation of AppsClient for Chrome. +class ChromeAppsClient : public apps::AppsClient { + public: + ChromeAppsClient(); + virtual ~ChromeAppsClient(); + + // Get the LazyInstance for ChromeAppsClient. + static ChromeAppsClient* GetInstance(); + + private: + friend struct DefaultSingletonTraits<ChromeAppsClient>; + + // apps::AppsClient + virtual std::vector<content::BrowserContext*> GetLoadedBrowserContexts() + OVERRIDE; + + DISALLOW_COPY_AND_ASSIGN(ChromeAppsClient); +}; + +#endif // CHROME_BROWSER_APPS_CHROME_APPS_CLIENT_H_ diff --git a/chrome/browser/apps/web_view_interactive_browsertest.cc b/chrome/browser/apps/web_view_interactive_browsertest.cc index 5444150..40d8a06 100644 --- a/chrome/browser/apps/web_view_interactive_browsertest.cc +++ b/chrome/browser/apps/web_view_interactive_browsertest.cc @@ -8,6 +8,7 @@ #include "base/strings/utf_string_conversions.h" #include "chrome/browser/apps/app_browsertest_util.h" #include "chrome/browser/extensions/extension_test_message_listener.h" +#include "chrome/browser/profiles/profile.h" #include "chrome/test/base/interactive_test_utils.h" #include "chrome/test/base/test_launcher_utils.h" #include "chrome/test/base/ui_test_utils.h" |