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

Unified Diff: sky/services/intents/src/org/domokit/intents/ActivityManagerImpl.java

Issue 1223053002: mv //sky/services/intents //sky/services/activity (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 5 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 | « sky/services/intents/intents.mojom ('k') | sky/shell/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/services/intents/src/org/domokit/intents/ActivityManagerImpl.java
diff --git a/sky/services/intents/src/org/domokit/intents/ActivityManagerImpl.java b/sky/services/intents/src/org/domokit/intents/ActivityManagerImpl.java
deleted file mode 100644
index 70b4ca9e68a08c54b73c59d51c7c50254df8b828..0000000000000000000000000000000000000000
--- a/sky/services/intents/src/org/domokit/intents/ActivityManagerImpl.java
+++ /dev/null
@@ -1,95 +0,0 @@
-// Copyright 2015 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-package org.domokit.intents;
-
-import android.app.Activity;
-import android.content.ActivityNotFoundException;
-import android.net.Uri;
-import android.util.Log;
-
-import org.chromium.mojo.system.MojoException;
-import org.chromium.mojom.intents.ActivityManager;
-import org.chromium.mojom.intents.ComponentName;
-import org.chromium.mojom.intents.Intent;
-import org.chromium.mojom.intents.StringExtra;
-
-/**
- * Android implementation of ActivityManager.
- */
-public class ActivityManagerImpl implements ActivityManager {
- private static final String TAG = "ActivityManagerImpl";
- private static Activity sCurrentActivity;
-
- public ActivityManagerImpl() {
- }
-
- public static void setCurrentActivity(Activity activity) {
- sCurrentActivity = activity;
- }
-
- @Override
- public void close() {}
-
- @Override
- public void onConnectionError(MojoException e) {}
-
- @Override
- public void startActivity(Intent intent) {
- if (sCurrentActivity == null) {
- Log.e(TAG, "Unable to startActivity");
- return;
- }
-
- final android.content.Intent androidIntent = new android.content.Intent(
- intent.action, Uri.parse(intent.url));
-
- if (intent.component != null) {
- ComponentName component = intent.component;
- android.content.ComponentName androidComponent =
- new android.content.ComponentName(component.packageName, component.className);
- androidIntent.setComponent(androidComponent);
- }
-
- if (intent.stringExtras != null) {
- for (StringExtra extra : intent.stringExtras) {
- androidIntent.putExtra(extra.name, extra.value);
- }
- }
-
- if (intent.flags != 0) {
- androidIntent.setFlags(intent.flags);
- }
-
- try {
- sCurrentActivity.startActivity(androidIntent);
- } catch (ActivityNotFoundException e) {
- Log.e(TAG, "Unable to startActivity", e);
- }
- }
-
- @Override
- public void finishCurrentActivity() {
- if (sCurrentActivity != null) {
- sCurrentActivity.finish();
- } else {
- Log.e(TAG, "Unable to finishCurrentActivity");
- }
- }
-
- @Override
- public void setTaskDescription(
- org.chromium.mojom.intents.TaskDescription description) {
- if (sCurrentActivity == null) {
- return;
- }
- sCurrentActivity.setTaskDescription(
- new android.app.ActivityManager.TaskDescription(
- description.label,
- null,
- description.primaryColor
- )
- );
- }
-}
« no previous file with comments | « sky/services/intents/intents.mojom ('k') | sky/shell/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698