OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "athena/extensions/chrome/athena_chrome_apps_client.h" | 5 #include "athena/extensions/chrome/athena_chrome_app_window_client.h" |
6 | 6 |
7 #include "athena/extensions/chrome/athena_chrome_app_delegate.h" | 7 #include "athena/extensions/chrome/athena_chrome_app_delegate.h" |
8 #include "base/memory/singleton.h" | 8 #include "base/memory/singleton.h" |
9 #include "chrome/browser/browser_process.h" | 9 #include "chrome/browser/browser_process.h" |
10 #include "chrome/browser/devtools/devtools_window.h" | 10 #include "chrome/browser/devtools/devtools_window.h" |
11 #include "chrome/browser/profiles/profile_manager.h" | 11 #include "chrome/browser/profiles/profile_manager.h" |
12 #include "chrome/common/extensions/features/feature_channel.h" | 12 #include "chrome/common/extensions/features/feature_channel.h" |
13 #include "extensions/browser/app_window/app_window.h" | 13 #include "extensions/browser/app_window/app_window.h" |
14 | 14 |
15 namespace athena { | 15 namespace athena { |
16 | 16 |
17 AthenaChromeAppsClient::AthenaChromeAppsClient() { | 17 AthenaChromeAppWindowClient::AthenaChromeAppWindowClient() { |
18 } | 18 } |
19 | 19 |
20 AthenaChromeAppsClient::~AthenaChromeAppsClient() { | 20 AthenaChromeAppWindowClient::~AthenaChromeAppWindowClient() { |
21 } | 21 } |
22 | 22 |
23 std::vector<content::BrowserContext*> | 23 std::vector<content::BrowserContext*> |
24 AthenaChromeAppsClient::GetLoadedBrowserContexts() { | 24 AthenaChromeAppWindowClient::GetLoadedBrowserContexts() { |
25 std::vector<Profile*> profiles = | 25 std::vector<Profile*> profiles = |
26 g_browser_process->profile_manager()->GetLoadedProfiles(); | 26 g_browser_process->profile_manager()->GetLoadedProfiles(); |
27 return std::vector<content::BrowserContext*>(profiles.begin(), | 27 return std::vector<content::BrowserContext*>(profiles.begin(), |
28 profiles.end()); | 28 profiles.end()); |
29 } | 29 } |
30 | 30 |
31 extensions::AppWindow* AthenaChromeAppsClient::CreateAppWindow( | 31 extensions::AppWindow* AthenaChromeAppWindowClient::CreateAppWindow( |
32 content::BrowserContext* context, | 32 content::BrowserContext* context, |
33 const extensions::Extension* extension) { | 33 const extensions::Extension* extension) { |
34 return new extensions::AppWindow( | 34 return new extensions::AppWindow( |
35 context, new AthenaChromeAppDelegate, extension); | 35 context, new AthenaChromeAppDelegate, extension); |
36 } | 36 } |
37 | 37 |
38 void AthenaChromeAppsClient::OpenDevToolsWindow( | 38 void AthenaChromeAppWindowClient::OpenDevToolsWindow( |
39 content::WebContents* web_contents, | 39 content::WebContents* web_contents, |
40 const base::Closure& callback) { | 40 const base::Closure& callback) { |
41 // TODO(oshima): Figure out what to do. | 41 // TODO(oshima): Figure out what to do. |
42 DevToolsWindow* devtools_window = DevToolsWindow::OpenDevToolsWindow( | 42 DevToolsWindow* devtools_window = DevToolsWindow::OpenDevToolsWindow( |
43 web_contents, DevToolsToggleAction::ShowConsole()); | 43 web_contents, DevToolsToggleAction::ShowConsole()); |
44 devtools_window->SetLoadCompletedCallback(callback); | 44 devtools_window->SetLoadCompletedCallback(callback); |
45 } | 45 } |
46 | 46 |
47 bool AthenaChromeAppsClient::IsCurrentChannelOlderThanDev() { | 47 bool AthenaChromeAppWindowClient::IsCurrentChannelOlderThanDev() { |
48 return extensions::GetCurrentChannel() > chrome::VersionInfo::CHANNEL_DEV; | 48 return extensions::GetCurrentChannel() > chrome::VersionInfo::CHANNEL_DEV; |
49 } | 49 } |
50 | 50 |
51 } // namespace athena | 51 } // namespace athena |
OLD | NEW |