Commit 6ddc4247 authored by Himanshu Jaju's avatar Himanshu Jaju Committed by Commit Bot

Fix build for ShareTarget

- Move Type to a new mojo file to avoid cyclic dependendency
- Add dependency from ShareTarget to mojom and vice versa

Bug: 1085068
Change-Id: I0e358270afda02758c303967ee6b6f5b4fbce8c0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2330025
Commit-Queue: Himanshu Jaju <himanshujaju@chromium.org>
Reviewed-by: default avatarAlex Gough <ajgo@chromium.org>
Reviewed-by: default avatarRichard Knoll <knollr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#793568}
parent 1c6d058e
......@@ -3310,11 +3310,8 @@ static_library("browser") {
"metrics/tab_stats_tracker.cc",
"metrics/tab_stats_tracker.h",
"metrics/tab_stats_tracker_delegate.h",
"nearby_sharing/attachment.h",
"nearby_sharing/fast_initiation_manager.cc",
"nearby_sharing/fast_initiation_manager.h",
"nearby_sharing/file_attachment.cc",
"nearby_sharing/file_attachment.h",
"nearby_sharing/incoming_frames_reader.cc",
"nearby_sharing/incoming_frames_reader.h",
"nearby_sharing/incoming_share_target_info.cc",
......@@ -3354,8 +3351,6 @@ static_library("browser") {
"nearby_sharing/share_target.cc",
"nearby_sharing/share_target.h",
"nearby_sharing/share_target_discovered_callback.h",
"nearby_sharing/text_attachment.cc",
"nearby_sharing/text_attachment.h",
"nearby_sharing/transfer_metadata.cc",
"nearby_sharing/transfer_metadata.h",
"nearby_sharing/transfer_update_callback.h",
......@@ -3770,6 +3765,7 @@ static_library("browser") {
"//base/util/timer",
"//chrome/app/vector_icons",
"//chrome/browser/media/kaleidoscope/mojom",
"//chrome/browser/nearby_sharing:share_target",
"//chrome/browser/nearby_sharing/certificates",
"//chrome/browser/nearby_sharing/client",
"//chrome/browser/nearby_sharing/common",
......
# Copyright 2020 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.
source_set("share_target") {
sources = [
"attachment.h",
"file_attachment.cc",
"file_attachment.h",
"share_target.cc",
"share_target.h",
"text_attachment.cc",
"text_attachment.h",
]
deps = [
"//base",
"//chrome/browser/ui/webui/nearby_share:nearby_share_target_types",
"//url",
]
}
......@@ -12,7 +12,7 @@
#include "base/unguessable_token.h"
#include "chrome/browser/nearby_sharing/file_attachment.h"
#include "chrome/browser/nearby_sharing/text_attachment.h"
#include "chrome/browser/ui/webui/nearby_share/nearby_share.mojom-shared.h"
#include "chrome/browser/ui/webui/nearby_share/nearby_share_target_types.mojom.h"
#include "url/gurl.h"
// A remote device.
......
......@@ -9,6 +9,7 @@
import 'chrome://resources/mojo/mojo/public/js/mojo_bindings_lite.js';
import 'chrome://resources/mojo/mojo/public/mojom/base/unguessable_token.mojom-lite.js';
import './nearby_share_target_types.mojom-lite.js';
import './nearby_share.mojom-lite.js';
/** @type {?nearbyShare.mojom.DiscoveryManagerInterface} */
......
......@@ -14,6 +14,7 @@ import 'chrome://resources/mojo/mojo/public/js/mojo_bindings_lite.js';
import 'chrome://resources/mojo/mojo/public/mojom/base/unguessable_token.mojom-lite.js';
import './nearby_preview.js';
import './nearby_progress.js';
import './nearby_share_target_types.mojom-lite.js';
import './nearby_share.mojom-lite.js';
import {html, Polymer} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js';
......
......@@ -9,6 +9,7 @@
import 'chrome://resources/mojo/mojo/public/js/mojo_bindings_lite.js';
import 'chrome://resources/mojo/mojo/public/mojom/base/unguessable_token.mojom-lite.js';
import './nearby_device_icon.js';
import './nearby_share_target_types.mojom-lite.js';
import './nearby_share.mojom-lite.js';
import {html, Polymer} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js';
......
......@@ -12,6 +12,7 @@ import 'chrome://resources/mojo/mojo/public/js/mojo_bindings_lite.js';
import 'chrome://resources/mojo/mojo/public/mojom/base/unguessable_token.mojom-lite.js';
import 'chrome://resources/polymer/v3_0/iron-icon/iron-icon.js';
import './icons.js';
import './nearby_share_target_types.mojom-lite.js';
import './nearby_share.mojom-lite.js';
import {html, Polymer} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js';
......
......@@ -12,6 +12,7 @@ import 'chrome://resources/mojo/mojo/public/js/mojo_bindings_lite.js';
import 'chrome://resources/mojo/mojo/public/mojom/base/unguessable_token.mojom-lite.js';
import './nearby_device.js';
import './nearby_preview.js';
import './nearby_share_target_types.mojom-lite.js';
import './nearby_share.mojom-lite.js';
import {assert} from 'chrome://resources/js/assert.m.js';
......
......@@ -12,6 +12,7 @@
import 'chrome://resources/mojo/mojo/public/js/mojo_bindings_lite.js';
import 'chrome://resources/mojo/mojo/public/mojom/base/unguessable_token.mojom-lite.js';
import './nearby_device_icon.js';
import './nearby_share_target_types.mojom-lite.js';
import './nearby_share.mojom-lite.js';
import {html, Polymer} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js';
......
......@@ -19,6 +19,9 @@
<include name="IDR_NEARBY_SHARE_MOJO_JS"
file="${root_gen_dir}/chrome/browser/ui/webui/nearby_share/nearby_share.mojom-lite.js"
use_base_dir="false" type="BINDATA"/>
<include name="IDR_NEARBY_SHARE_TARGET_TYPES_MOJO_JS"
file="${root_gen_dir}/chrome/browser/ui/webui/nearby_share/nearby_share_target_types.mojom-lite.js"
use_base_dir="false" type="BINDATA"/>
<include name="IDR_NEARBY_SHARE_SETTINGS_MOJOM_LITE_JS"
file="${root_gen_dir}/chrome/browser/ui/webui/nearby_share/public/mojom/nearby_share_settings.mojom-lite.js"
use_base_dir="false" type="BINDATA"/>
......
......@@ -4,10 +4,17 @@
import("//mojo/public/tools/bindings/mojom.gni")
mojom("nearby_share_target_types") {
sources = [ "nearby_share_target_types.mojom" ]
}
mojom("mojom") {
sources = [ "nearby_share.mojom" ]
public_deps = [ "//mojo/public/mojom/base" ]
public_deps = [
":nearby_share_target_types",
"//mojo/public/mojom/base",
]
cpp_typemaps = [
{
......@@ -19,6 +26,7 @@ mojom("mojom") {
]
traits_headers = [ "nearby_share_mojom_traits.h" ]
traits_sources = [ "nearby_share_mojom_traits.cc" ]
traits_deps = [ "//chrome/browser/nearby_sharing:share_target" ]
},
]
}
......@@ -4,20 +4,9 @@
module nearby_share.mojom;
import "chrome/browser/ui/webui/nearby_share/nearby_share_target_types.mojom";
import "mojo/public/mojom/base/unguessable_token.mojom";
// Describes the type of device for a share target.
enum ShareTargetType {
// Unknown device type.
kUnknown,
// A phone.
kPhone,
// A tablet.
kTablet,
// A laptop.
kLaptop,
};
// Describes a nearby device that is able to receive data via Nearby Share.
struct ShareTarget {
// Unique identifier during the current discovery session. The same physical
......
......@@ -47,6 +47,8 @@ NearbyShareDialogUI::NearbyShareDialogUI(content::WebUI* web_ui)
html_source->AddResourcePath("nearby_share.mojom-lite.js",
IDR_NEARBY_SHARE_MOJO_JS);
html_source->AddResourcePath("nearby_share_target_types.mojom-lite.js",
IDR_NEARBY_SHARE_TARGET_TYPES_MOJO_JS);
RegisterNearbySharedMojoResources(html_source);
......
// Copyright 2020 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.
module nearby_share.mojom;
// Describes the type of device for a share target.
enum ShareTargetType {
// Unknown device type.
kUnknown,
// A phone.
kPhone,
// A tablet.
kTablet,
// A laptop.
kLaptop,
};
\ No newline at end of file
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