Commit 655a8e62 authored by David Jacobo's avatar David Jacobo Committed by Commit Bot

Regroup HandleCameraResult and add include

This CL regroups HandleCameraResult out of the override block.
Also including map due to IWYU.

Bug: None
Test: Build.
Change-Id: I60f3e4b7b9c5e802c41edd221b1b0e6675bf8e43
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1910769
Commit-Queue: David Jacobo <djacobo@chromium.org>
Auto-Submit: David Jacobo <djacobo@chromium.org>
Reviewed-by: default avatarWei Lee <wtlee@chromium.org>
Reviewed-by: default avatarYusuke Sato <yusukes@chromium.org>
Cr-Commit-Position: refs/heads/master@{#714575}
parent 7482ae16
......@@ -248,27 +248,6 @@ void ArcIntentHelperBridge::CloseCameraApp() {
ash::NewWindowDelegate::GetInstance()->CloseCameraApp();
}
void ArcIntentHelperBridge::HandleCameraResult(
uint32_t intent_id,
arc::mojom::CameraIntentAction action,
const std::vector<uint8_t>& data,
arc::mojom::IntentHelperInstance::HandleCameraResultCallback callback) {
auto* arc_service_manager = arc::ArcServiceManager::Get();
arc::mojom::IntentHelperInstance* instance = nullptr;
if (arc_service_manager) {
instance = ARC_GET_INSTANCE_FOR_METHOD(
arc_service_manager->arc_bridge_service()->intent_helper(),
HandleCameraResult);
}
if (!instance) {
LOG(ERROR) << "Failed to get instance for HandleCameraResult().";
std::move(callback).Run(false);
return;
}
instance->HandleCameraResult(intent_id, action, data, std::move(callback));
}
ArcIntentHelperBridge::GetResult ArcIntentHelperBridge::GetActivityIcons(
const std::vector<ActivityName>& activities,
OnIconsReadyCallback callback) {
......@@ -310,6 +289,27 @@ bool ArcIntentHelperBridge::HasObserver(
return observer_list_.HasObserver(observer);
}
void ArcIntentHelperBridge::HandleCameraResult(
uint32_t intent_id,
arc::mojom::CameraIntentAction action,
const std::vector<uint8_t>& data,
arc::mojom::IntentHelperInstance::HandleCameraResultCallback callback) {
auto* arc_service_manager = arc::ArcServiceManager::Get();
arc::mojom::IntentHelperInstance* instance = nullptr;
if (arc_service_manager) {
instance = ARC_GET_INSTANCE_FOR_METHOD(
arc_service_manager->arc_bridge_service()->intent_helper(),
HandleCameraResult);
}
if (!instance) {
LOG(ERROR) << "Failed to get instance for HandleCameraResult().";
std::move(callback).Run(false);
return;
}
instance->HandleCameraResult(intent_id, action, data, std::move(callback));
}
// static
bool ArcIntentHelperBridge::IsIntentHelperPackage(
const std::string& package_name) {
......
......@@ -5,6 +5,7 @@
#ifndef COMPONENTS_ARC_INTENT_HELPER_ARC_INTENT_HELPER_BRIDGE_H_
#define COMPONENTS_ARC_INTENT_HELPER_ARC_INTENT_HELPER_BRIDGE_H_
#include <map>
#include <memory>
#include <set>
#include <string>
......@@ -60,6 +61,11 @@ class ArcIntentHelperBridge : public KeyedService,
void AddObserver(ArcIntentHelperObserver* observer);
void RemoveObserver(ArcIntentHelperObserver* observer);
bool HasObserver(ArcIntentHelperObserver* observer) const;
void HandleCameraResult(
uint32_t intent_id,
arc::mojom::CameraIntentAction action,
const std::vector<uint8_t>& data,
arc::mojom::IntentHelperInstance::HandleCameraResultCallback callback);
// mojom::IntentHelperHost
void OnIconInvalidated(const std::string& package_name) override;
......@@ -85,11 +91,6 @@ class ArcIntentHelperBridge : public KeyedService,
bool should_down_scale,
bool is_secure) override;
void CloseCameraApp() override;
void HandleCameraResult(
uint32_t intent_id,
arc::mojom::CameraIntentAction action,
const std::vector<uint8_t>& data,
arc::mojom::IntentHelperInstance::HandleCameraResultCallback callback);
void OnIntentFiltersUpdatedForPackage(
const std::string& package_name,
std::vector<IntentFilter> intent_filters) override;
......
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