Index: athena/extensions/chrome/athena_apps_client.cc |
diff --git a/chrome/browser/ui/apps/chrome_apps_client.cc b/athena/extensions/chrome/athena_apps_client.cc |
similarity index 53% |
copy from chrome/browser/ui/apps/chrome_apps_client.cc |
copy to athena/extensions/chrome/athena_apps_client.cc |
index 80ffedcd2b666fd7977b2fd0ea952f2178530061..5339ff43df564539d9d12012a2ef4d8af59ab18f 100644 |
--- a/chrome/browser/ui/apps/chrome_apps_client.cc |
+++ b/athena/extensions/chrome/athena_apps_client.cc |
@@ -2,82 +2,71 @@ |
// Use of this source code is governed by a BSD-style license that can be |
// found in the LICENSE file. |
-#include "chrome/browser/ui/apps/chrome_apps_client.h" |
+#include "athena/extensions/chrome/athena_apps_client.h" |
+#include "athena/activity/public/activity_factory.h" |
+#include "athena/activity/public/activity_manager.h" |
#include "base/memory/singleton.h" |
#include "chrome/browser/browser_process.h" |
#include "chrome/browser/devtools/devtools_window.h" |
#include "chrome/browser/profiles/profile_manager.h" |
+#include "chrome/browser/ui/apps/chrome_app_delegate.h" |
+#include "chrome/browser/ui/views/apps/chrome_native_app_window_views.h" |
#include "chrome/common/extensions/features/feature_channel.h" |
#include "extensions/browser/app_window/app_window.h" |
#include "extensions/common/extension.h" |
-// TODO(jamescook): We probably shouldn't compile this class at all on Android. |
-// See http://crbug.com/343612 |
-#if !defined(OS_ANDROID) |
-#include "chrome/browser/lifetime/application_lifetime.h" |
-#include "chrome/browser/ui/apps/chrome_app_delegate.h" |
-#endif |
+namespace athena { |
-ChromeAppsClient::ChromeAppsClient() { |
+AthenaAppsClient::AthenaAppsClient() { |
} |
-ChromeAppsClient::~ChromeAppsClient() { |
-} |
- |
-// static |
-ChromeAppsClient* ChromeAppsClient::GetInstance() { |
- return Singleton<ChromeAppsClient, |
- LeakySingletonTraits<ChromeAppsClient> >::get(); |
+AthenaAppsClient::~AthenaAppsClient() { |
} |
std::vector<content::BrowserContext*> |
-ChromeAppsClient::GetLoadedBrowserContexts() { |
+AthenaAppsClient::GetLoadedBrowserContexts() { |
std::vector<Profile*> profiles = |
g_browser_process->profile_manager()->GetLoadedProfiles(); |
return std::vector<content::BrowserContext*>(profiles.begin(), |
profiles.end()); |
} |
-extensions::AppWindow* ChromeAppsClient::CreateAppWindow( |
+extensions::AppWindow* AthenaAppsClient::CreateAppWindow( |
content::BrowserContext* context, |
const extensions::Extension* extension) { |
-#if defined(OS_ANDROID) |
- return NULL; |
-#else |
return new extensions::AppWindow(context, new ChromeAppDelegate, extension); |
-#endif |
} |
-extensions::NativeAppWindow* ChromeAppsClient::CreateNativeAppWindow( |
- extensions::AppWindow* window, |
+extensions::NativeAppWindow* AthenaAppsClient::CreateNativeAppWindow( |
+ extensions::AppWindow* app_window, |
const extensions::AppWindow::CreateParams& params) { |
-#if defined(OS_ANDROID) |
- return NULL; |
-#else |
- return CreateNativeAppWindowImpl(window, params); |
-#endif |
+ // TODO(oshima): Implement athena's native appwindow. |
+ ChromeNativeAppWindowViews* window = new ChromeNativeAppWindowViews; |
+ window->Init(app_window, params); |
+ athena::ActivityManager::Get()->AddActivity( |
+ athena::ActivityFactory::Get()->CreateAppActivity(app_window)); |
+ return window; |
} |
-void ChromeAppsClient::IncrementKeepAliveCount() { |
-#if !defined(OS_ANDROID) |
- chrome::IncrementKeepAliveCount(); |
-#endif |
+void AthenaAppsClient::IncrementKeepAliveCount() { |
+ // No need to keep track of KeepAlive count on ChromeOS. |
} |
-void ChromeAppsClient::DecrementKeepAliveCount() { |
-#if !defined(OS_ANDROID) |
- chrome::DecrementKeepAliveCount(); |
-#endif |
+void AthenaAppsClient::DecrementKeepAliveCount() { |
+ // No need to keep track of KeepAlive count on ChromeOS. |
} |
-void ChromeAppsClient::OpenDevToolsWindow(content::WebContents* web_contents, |
+void AthenaAppsClient::OpenDevToolsWindow(content::WebContents* web_contents, |
const base::Closure& callback) { |
+ // TODO(oshima): Figure out what to do. |
DevToolsWindow* devtools_window = DevToolsWindow::OpenDevToolsWindow( |
web_contents, DevToolsToggleAction::ShowConsole()); |
devtools_window->SetLoadCompletedCallback(callback); |
} |
-bool ChromeAppsClient::IsCurrentChannelOlderThanDev() { |
+bool AthenaAppsClient::IsCurrentChannelOlderThanDev() { |
return extensions::GetCurrentChannel() > chrome::VersionInfo::CHANNEL_DEV; |
} |
+ |
+} // namespace athena |