Commit 2f7e1168 authored by Kristi Park's avatar Kristi Park Committed by Commit Bot

[Screenshotz] Restructure the ImageEditor boilerplate

ImageEditorCoordinator will be renamed to ImageEditorDialogCoordinator
and will be used to create the editor DialogFragment
(ImageEditorCoordinator is used internally by the DialogFragment).

Bug: 1024586
Change-Id: I29822893395022bdb661f535d87dbac35757b4d1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1975110Reviewed-by: default avatarJeffrey Cohen <jeffreycohen@chromium.org>
Commit-Queue: Kristi Park <kristipark@chromium.org>
Cr-Commit-Position: refs/heads/master@{#726623}
parent 6f5a5c20
...@@ -4,11 +4,9 @@ ...@@ -4,11 +4,9 @@
package org.chromium.chrome.modules.image_editor; package org.chromium.chrome.modules.image_editor;
import android.app.Activity;
import org.chromium.base.annotations.UsedByReflection; import org.chromium.base.annotations.UsedByReflection;
import org.chromium.chrome.browser.image_editor.ImageEditorCoordinator; import org.chromium.chrome.browser.image_editor.ImageEditorDialogCoordinator;
import org.chromium.chrome.browser.image_editor.ImageEditorCoordinatorImpl; import org.chromium.chrome.browser.image_editor.ImageEditorDialogCoordinatorImpl;
/** /**
* Upstream implementation for DFM module hook. Does nothing. Actual implementation lives * Upstream implementation for DFM module hook. Does nothing. Actual implementation lives
...@@ -17,7 +15,7 @@ import org.chromium.chrome.browser.image_editor.ImageEditorCoordinatorImpl; ...@@ -17,7 +15,7 @@ import org.chromium.chrome.browser.image_editor.ImageEditorCoordinatorImpl;
@UsedByReflection("ImageEditorModule") @UsedByReflection("ImageEditorModule")
public class ImageEditorProviderImpl implements ImageEditorProvider { public class ImageEditorProviderImpl implements ImageEditorProvider {
@Override @Override
public ImageEditorCoordinator getImageEditorCoordinator(Activity activity) { public ImageEditorDialogCoordinator getImageEditorDialogCoordinator() {
return new ImageEditorCoordinatorImpl(activity); return new ImageEditorDialogCoordinatorImpl();
} }
} }
...@@ -4,19 +4,17 @@ ...@@ -4,19 +4,17 @@
package org.chromium.chrome.modules.image_editor; package org.chromium.chrome.modules.image_editor;
import android.app.Activity; import org.chromium.chrome.browser.image_editor.ImageEditorDialogCoordinator;
import org.chromium.chrome.browser.image_editor.ImageEditorCoordinator;
import org.chromium.components.module_installer.builder.ModuleInterface; import org.chromium.components.module_installer.builder.ModuleInterface;
/** /**
* Interface to get access to the image editor activity. * Interface to get access to the image editor dialog.
*/ */
@ModuleInterface(module = "image_editor", @ModuleInterface(module = "image_editor",
impl = "org.chromium.chrome.modules.image_editor.ImageEditorProviderImpl") impl = "org.chromium.chrome.modules.image_editor.ImageEditorProviderImpl")
public interface ImageEditorProvider { public interface ImageEditorProvider {
/** /**
* Creates and returns the instance tied to the image editor activity. * Creates and returns the instance tied to the image editor dialog.
*/ */
ImageEditorCoordinator getImageEditorCoordinator(Activity activity); ImageEditorDialogCoordinator getImageEditorDialogCoordinator();
} }
...@@ -7,7 +7,7 @@ import("//build/config/android/rules.gni") ...@@ -7,7 +7,7 @@ import("//build/config/android/rules.gni")
# Upstream ImageEditor implementation which does nothing. Actual implementation # Upstream ImageEditor implementation which does nothing. Actual implementation
# lives downstream. # lives downstream.
android_library("java") { android_library("java") {
java_files = [ "android/java/src/org/chromium/chrome/browser/image_editor/ImageEditorCoordinatorImpl.java" ] java_files = [ "android/java/src/org/chromium/chrome/browser/image_editor/ImageEditorDialogCoordinatorImpl.java" ]
deps = [ deps = [
"//chrome/browser/image_editor/public:java", "//chrome/browser/image_editor/public:java",
......
// Copyright 2019 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.chromium.chrome.browser.image_editor;
import android.support.v7.app.AppCompatActivity;
/**
* Upstream implementation for ImageEditorDialogCoordinator. Does nothing. Actual implementation
* lives downstream.
*/
public class ImageEditorDialogCoordinatorImpl implements ImageEditorDialogCoordinator {
@Override
public void launchEditor(AppCompatActivity activity) {}
}
...@@ -5,5 +5,12 @@ ...@@ -5,5 +5,12 @@
import("//build/config/android/rules.gni") import("//build/config/android/rules.gni")
android_library("java") { android_library("java") {
java_files = [ "android/java/src/org/chromium/chrome/browser/image_editor/ImageEditorCoordinator.java" ] java_files = [
"android/java/src/org/chromium/chrome/browser/image_editor/ImageEditorCoordinator.java",
"android/java/src/org/chromium/chrome/browser/image_editor/ImageEditorDialogCoordinator.java",
]
deps = [
"//third_party/android_deps:android_support_v7_appcompat_java",
]
} }
...@@ -4,12 +4,11 @@ ...@@ -4,12 +4,11 @@
package org.chromium.chrome.browser.image_editor; package org.chromium.chrome.browser.image_editor;
import android.app.Activity; import android.support.v7.app.AppCompatActivity;
/** /**
* Upstream implementation for ImageEditorCoordinator. Does nothing. Actual implementation lives * Interface to interact with the image editor dialog.
* downstream.
*/ */
public class ImageEditorCoordinatorImpl implements ImageEditorCoordinator { public interface ImageEditorDialogCoordinator {
public ImageEditorCoordinatorImpl(Activity activity) {} public void launchEditor(AppCompatActivity activity);
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment