| OLD | NEW |
| (Empty) |
| 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/chrome/athena_chrome_apps_client.h" | |
| 6 | |
| 7 #include "athena/extensions/chrome/athena_chrome_app_delegate.h" | |
| 8 #include "base/memory/singleton.h" | |
| 9 #include "chrome/browser/browser_process.h" | |
| 10 #include "chrome/browser/devtools/devtools_window.h" | |
| 11 #include "chrome/browser/profiles/profile_manager.h" | |
| 12 #include "chrome/common/extensions/features/feature_channel.h" | |
| 13 #include "extensions/browser/app_window/app_window.h" | |
| 14 | |
| 15 namespace athena { | |
| 16 | |
| 17 AthenaChromeAppsClient::AthenaChromeAppsClient() { | |
| 18 } | |
| 19 | |
| 20 AthenaChromeAppsClient::~AthenaChromeAppsClient() { | |
| 21 } | |
| 22 | |
| 23 std::vector<content::BrowserContext*> | |
| 24 AthenaChromeAppsClient::GetLoadedBrowserContexts() { | |
| 25 std::vector<Profile*> profiles = | |
| 26 g_browser_process->profile_manager()->GetLoadedProfiles(); | |
| 27 return std::vector<content::BrowserContext*>(profiles.begin(), | |
| 28 profiles.end()); | |
| 29 } | |
| 30 | |
| 31 extensions::AppWindow* AthenaChromeAppsClient::CreateAppWindow( | |
| 32 content::BrowserContext* context, | |
| 33 const extensions::Extension* extension) { | |
| 34 return new extensions::AppWindow( | |
| 35 context, new AthenaChromeAppDelegate, extension); | |
| 36 } | |
| 37 | |
| 38 void AthenaChromeAppsClient::OpenDevToolsWindow( | |
| 39 content::WebContents* web_contents, | |
| 40 const base::Closure& callback) { | |
| 41 // TODO(oshima): Figure out what to do. | |
| 42 DevToolsWindow* devtools_window = DevToolsWindow::OpenDevToolsWindow( | |
| 43 web_contents, DevToolsToggleAction::ShowConsole()); | |
| 44 devtools_window->SetLoadCompletedCallback(callback); | |
| 45 } | |
| 46 | |
| 47 bool AthenaChromeAppsClient::IsCurrentChannelOlderThanDev() { | |
| 48 return extensions::GetCurrentChannel() > chrome::VersionInfo::CHANNEL_DEV; | |
| 49 } | |
| 50 | |
| 51 } // namespace athena | |
| OLD | NEW |