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

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

Issue 544813002: Support V1 app (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: addressed comment 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
« no previous file with comments | « athena/extensions/chrome/DEPS ('k') | athena/main/placeholder.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: athena/extensions/chrome/extensions_delegate_impl.cc
diff --git a/athena/extensions/chrome/extensions_delegate_impl.cc b/athena/extensions/chrome/extensions_delegate_impl.cc
index de97c306f299a8ad3d548346d7f78b7cf53abea8..7867458eb6cbab2a83ed48b2a3bd667cb4e76534 100644
--- a/athena/extensions/chrome/extensions_delegate_impl.cc
+++ b/athena/extensions/chrome/extensions_delegate_impl.cc
@@ -4,12 +4,16 @@
#include "athena/extensions/public/extensions_delegate.h"
+#include "athena/activity/public/activity_factory.h"
+#include "athena/activity/public/activity_manager.h"
#include "athena/extensions/chrome/athena_apps_client.h"
#include "base/macros.h"
+#include "base/strings/utf_string_conversions.h"
#include "chrome/browser/extensions/extension_service.h"
#include "chrome/browser/extensions/extension_util.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/extensions/application_launch.h"
+#include "chrome/browser/web_applications/web_app.h"
Jun Mukai 2014/09/04 22:20:53 You don't have to include this anymore.
oshima 2014/09/04 22:25:29 thanks, done.
#include "chrome/common/extensions/manifest_handlers/app_launch_info.h"
#include "extensions/browser/extension_registry.h"
#include "extensions/browser/extension_system.h"
@@ -71,14 +75,32 @@ class ChromeExtensionsDelegate : public ExtensionsDelegate {
}
params.container = extensions::LAUNCH_CONTAINER_WINDOW;
- OpenApplication(params);
+ // V2 apps
+ if (CanLaunchViaEvent(extension)) {
+ OpenApplication(params);
+ return true;
+ }
+ LaunchV1App(params, extension);
return true;
}
+
virtual bool UnloadApp(const std::string& app_id) OVERRIDE {
// TODO(skuhne): Implement using extension service.
return false;
}
+ void LaunchV1App(const AppLaunchParams& params,
+ const extensions::Extension* extension) {
+ // TODO(oshima): Just activate if the app is already running.
+ const GURL url_input = params.override_url;
+
+ DCHECK(!url_input.is_empty() || extension);
+ GURL url = UrlForExtension(extension, url_input);
+ athena::ActivityManager::Get()->AddActivity(
+ athena::ActivityFactory::Get()->CreateWebActivity(
+ GetBrowserContext(), base::UTF8ToUTF16(extension->name()), url));
+ }
+
// ExtensionService for the browser context this is created for.
ExtensionService* extension_service_;
« no previous file with comments | « athena/extensions/chrome/DEPS ('k') | athena/main/placeholder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698