Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2546)

Unified Diff: athena/extensions/chrome/athena_chrome_apps_client.cc

Issue 563083003: V2 app support step3: Athena's NativeAppWindow (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: athena/extensions/chrome/athena_chrome_apps_client.cc
diff --git a/athena/extensions/chrome/athena_apps_client.cc b/athena/extensions/chrome/athena_chrome_apps_client.cc
similarity index 37%
rename from athena/extensions/chrome/athena_apps_client.cc
rename to athena/extensions/chrome/athena_chrome_apps_client.cc
index cc0f67aa0e1d5226e2cd54e4b2fb43a3f8b979e9..ded71ccbecfdb99ef79743fe4f95d92b211ad692 100644
--- a/athena/extensions/chrome/athena_apps_client.cc
+++ b/athena/extensions/chrome/athena_chrome_apps_client.cc
@@ -2,88 +2,50 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "athena/extensions/chrome/athena_apps_client.h"
+#include "athena/extensions/chrome/athena_chrome_apps_client.h"
-#include "athena/activity/public/activity_factory.h"
-#include "athena/activity/public/activity_manager.h"
-#include "athena/extensions/chrome/athena_app_delegate.h"
+#include "athena/extensions/chrome/athena_chrome_app_delegate.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/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"
+//#include "extensions/common/extension.h"
Jun Mukai 2014/09/18 17:38:05 remove commented-out includes
oshima 2014/09/18 18:16:28 Done.
namespace athena {
-namespace {
-// A short term hack to get WebView from ChromeNativeAppWindowViews.
-// TODO(oshima): Implement athena's NativeAppWindow.
-class AthenaNativeAppWindowViews : public ChromeNativeAppWindowViews {
- public:
- AthenaNativeAppWindowViews() {}
- virtual ~AthenaNativeAppWindowViews() {}
-
- views::WebView* GetWebView() {
- return web_view();
- }
-
- private:
- DISALLOW_COPY_AND_ASSIGN(AthenaNativeAppWindowViews);
-};
-
-} // namespace
-
-AthenaAppsClient::AthenaAppsClient() {
+AthenaChromeAppsClient::AthenaChromeAppsClient() {
}
-AthenaAppsClient::~AthenaAppsClient() {
+AthenaChromeAppsClient::~AthenaChromeAppsClient() {
}
std::vector<content::BrowserContext*>
-AthenaAppsClient::GetLoadedBrowserContexts() {
+AthenaChromeAppsClient::GetLoadedBrowserContexts() {
std::vector<Profile*> profiles =
g_browser_process->profile_manager()->GetLoadedProfiles();
return std::vector<content::BrowserContext*>(profiles.begin(),
profiles.end());
}
-extensions::AppWindow* AthenaAppsClient::CreateAppWindow(
+extensions::AppWindow* AthenaChromeAppsClient::CreateAppWindow(
content::BrowserContext* context,
const extensions::Extension* extension) {
- return new extensions::AppWindow(context, new AthenaAppDelegate, extension);
-}
-
-extensions::NativeAppWindow* AthenaAppsClient::CreateNativeAppWindow(
- extensions::AppWindow* app_window,
- const extensions::AppWindow::CreateParams& params) {
- AthenaNativeAppWindowViews* native_window = new AthenaNativeAppWindowViews;
- native_window->Init(app_window, params);
- Activity* app_activity = ActivityFactory::Get()->CreateAppActivity(
- app_window, native_window->GetWebView());
- ActivityManager::Get()->AddActivity(app_activity);
- return native_window;
-}
-
-void AthenaAppsClient::IncrementKeepAliveCount() {
- // No need to keep track of KeepAlive count on ChromeOS.
-}
-
-void AthenaAppsClient::DecrementKeepAliveCount() {
- // No need to keep track of KeepAlive count on ChromeOS.
+ return new extensions::AppWindow(
+ context, new AthenaChromeAppDelegate, extension);
}
-void AthenaAppsClient::OpenDevToolsWindow(content::WebContents* web_contents,
- const base::Closure& callback) {
+void AthenaChromeAppsClient::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 AthenaAppsClient::IsCurrentChannelOlderThanDev() {
+bool AthenaChromeAppsClient::IsCurrentChannelOlderThanDev() {
return extensions::GetCurrentChannel() > chrome::VersionInfo::CHANNEL_DEV;
}

Powered by Google App Engine
This is Rietveld 408576698