Commit 853ffa85 authored by Donn Denman's avatar Donn Denman Committed by Commit Bot

[TTS] Refactor the Component to use layered dirs.

Refactors the Contextual Search Component to use the layered directory
layout recommended for iOS support.  This CL splits the top-level
directories into /core and /content.  A few files that are clearly
not dependent on any content have been moved to /core/, and everything
else is moved to /content/.  There will be some additional /core/ files
landing soon.

This CL doesn't change any logic or functionality, it just moves source
files.

BUG=646019,825428

Change-Id: Ia4bf5cdecaabf7d9515b2d4fca855db29b1c4b1c
Reviewed-on: https://chromium-review.googlesource.com/1173019Reviewed-by: default avatarScott Violet <sky@chromium.org>
Reviewed-by: default avatarTheresa <twellington@chromium.org>
Reviewed-by: default avatarDominick Ng <dominickn@chromium.org>
Commit-Queue: Donn Denman <donnd@chromium.org>
Cr-Commit-Position: refs/heads/master@{#584566}
parent 9bd4e7a6
......@@ -227,7 +227,7 @@ android_library("chrome_java") {
"//components/autofill/android:autofill_java",
"//components/background_task_scheduler:background_task_scheduler_java",
"//components/bookmarks/common/android:bookmarks_java",
"//components/contextual_search:mojo_bindings_java",
"//components/contextual_search/content:mojo_bindings_java",
"//components/crash/android:java",
"//components/dom_distiller/content/browser/android:dom_distiller_content_java",
"//components/dom_distiller/core/android:dom_distiller_core_java",
......
......@@ -1719,7 +1719,8 @@ jumbo_split_static_library("browser") {
"//components/consent_auditor",
"//components/content_settings/core/browser",
"//components/content_settings/core/common",
"//components/contextual_search:browser",
"//components/contextual_search/content:browser",
"//components/contextual_search/core:browser",
"//components/cookie_config",
"//components/crx_file",
"//components/data_reduction_proxy/content/browser",
......
include_rules = [
"+components/contextual_search/common",
"+components/contextual_search/content/common",
]
......@@ -16,7 +16,7 @@
#include "chrome/browser/android/contextualsearch/resolved_search_term.h"
#include "chrome/browser/profiles/profile_manager.h"
#include "chrome/browser/search_engines/template_url_service_factory.h"
#include "components/contextual_search/browser/contextual_search_js_api_service_impl.h"
#include "components/contextual_search/content/browser/contextual_search_js_api_service_impl.h"
#include "components/navigation_interception/intercept_navigation_delegate.h"
#include "components/variations/variations_associated_data.h"
#include "content/public/browser/render_frame_host.h"
......
......@@ -11,8 +11,8 @@
#include "base/task/cancelable_task_tracker.h"
#include "chrome/browser/android/contextualsearch/contextual_search_context.h"
#include "chrome/browser/android/contextualsearch/contextual_search_delegate.h"
#include "components/contextual_search/browser/contextual_search_js_api_handler.h"
#include "components/contextual_search/common/contextual_search_js_api_service.mojom.h"
#include "components/contextual_search/content/browser/contextual_search_js_api_handler.h"
#include "components/contextual_search/content/common/contextual_search_js_api_service.mojom.h"
// Manages the native extraction and request logic for Contextual Search,
// and interacts with the Java ContextualSearchManager for UX.
......
......@@ -8,8 +8,8 @@
#include <stddef.h>
#include "base/android/jni_android.h"
#include "components/contextual_search/browser/ctr_aggregator.h"
#include "components/contextual_search/browser/weekly_activity_storage.h"
#include "components/contextual_search/core/browser/ctr_aggregator.h"
#include "components/contextual_search/core/browser/weekly_activity_storage.h"
// Provides access to aggregated click-through-rate recording for tap
// suppression. Implements a Java conduit to the CtrAggregator in the
......
......@@ -124,7 +124,7 @@ jumbo_static_library("renderer") {
"//chrome/common/net",
"//components/autofill/content/renderer",
"//components/cdm/renderer",
"//components/contextual_search:renderer",
"//components/contextual_search/content:renderer",
"//components/data_reduction_proxy/content/renderer",
"//components/data_reduction_proxy/core/common",
"//components/dom_distiller/content/renderer",
......
......@@ -5,7 +5,7 @@ include_rules = [
"+components/autofill/core/common",
"+components/cdm/renderer",
"+components/content_settings/core/common",
"+components/contextual_search/renderer",
"+components/contextual_search/content/renderer",
"+components/crash/core/common/crash_key.h",
"+components/crx_file",
"+components/data_reduction_proxy/content/renderer",
......
......@@ -68,7 +68,7 @@
#include "components/autofill/content/renderer/password_autofill_agent.h"
#include "components/autofill/content/renderer/password_generation_agent.h"
#include "components/content_settings/core/common/content_settings_pattern.h"
#include "components/contextual_search/renderer/overlay_js_render_frame_observer.h"
#include "components/contextual_search/content/renderer/overlay_js_render_frame_observer.h"
#include "components/data_reduction_proxy/content/renderer/content_previews_render_frame_observer.h"
#include "components/data_reduction_proxy/core/common/data_reduction_proxy_headers.h"
#include "components/dom_distiller/content/renderer/distillability_agent.h"
......
......@@ -203,7 +203,7 @@ test("components_unittests") {
"//components/cast_certificate:unit_tests",
"//components/cast_channel:unit_tests",
"//components/certificate_transparency:unit_tests",
"//components/contextual_search:unit_tests",
"//components/contextual_search/core:unit_tests",
"//components/crash/content/app:unit_tests",
"//components/crash/content/browser:unit_tests",
"//components/crash/core/common:unit_tests",
......
......@@ -17,10 +17,6 @@ static_library("browser") {
sources = [
"browser/contextual_search_js_api_service_impl.cc",
"browser/contextual_search_js_api_service_impl.h",
"browser/ctr_aggregator.cc",
"browser/ctr_aggregator.h",
"browser/weekly_activity_storage.cc",
"browser/weekly_activity_storage.h",
]
deps = [
":mojo_bindings",
......@@ -28,19 +24,6 @@ static_library("browser") {
]
}
source_set("unit_tests") {
testonly = true
sources = [
"browser/ctr_aggregator_unittest.cc",
]
deps = [
":browser",
"//base",
"//testing/gtest",
]
}
static_library("renderer") {
sources = [
"renderer/contextual_search_wrapper.cc",
......
......@@ -2,13 +2,13 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef COMPONENTS_CONTEXTUAL_SEARCH_BROWSER_CONTEXTUAL_SEARCH_JS_API_HANDLER_H_
#define COMPONENTS_CONTEXTUAL_SEARCH_BROWSER_CONTEXTUAL_SEARCH_JS_API_HANDLER_H_
#ifndef COMPONENTS_CONTEXTUAL_SEARCH_CONTENT_BROWSER_CONTEXTUAL_SEARCH_JS_API_HANDLER_H_
#define COMPONENTS_CONTEXTUAL_SEARCH_CONTENT_BROWSER_CONTEXTUAL_SEARCH_JS_API_HANDLER_H_
#include <string>
#include "base/macros.h"
#include "components/contextual_search/common/contextual_search_js_api_service.mojom.h"
#include "components/contextual_search/content/common/contextual_search_js_api_service.mojom.h"
namespace contextual_search {
......@@ -45,4 +45,4 @@ class ContextualSearchJsApiHandler {
} // namespace contextual_search
#endif // COMPONENTS_CONTEXTUAL_SEARCH_BROWSER_CONTEXTUAL_SEARCH_JS_API_HANDLER_H_
#endif // COMPONENTS_CONTEXTUAL_SEARCH_CONTENT_BROWSER_CONTEXTUAL_SEARCH_JS_API_HANDLER_H_
......@@ -2,12 +2,12 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "components/contextual_search/browser/contextual_search_js_api_service_impl.h"
#include "components/contextual_search/content/browser/contextual_search_js_api_service_impl.h"
#include <memory>
#include <utility>
#include "components/contextual_search/browser/contextual_search_js_api_handler.h"
#include "components/contextual_search/content/browser/contextual_search_js_api_handler.h"
#include "mojo/public/cpp/bindings/strong_binding.h"
namespace contextual_search {
......
......@@ -2,12 +2,12 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef COMPONENTS_CONTEXTUAL_SEARCH_BROWSER_CONTEXTUAL_SEARCH_JS_API_SERVICE_IMPL_H_
#define COMPONENTS_CONTEXTUAL_SEARCH_BROWSER_CONTEXTUAL_SEARCH_JS_API_SERVICE_IMPL_H_
#ifndef COMPONENTS_CONTEXTUAL_SEARCH_CONTENT_BROWSER_CONTEXTUAL_SEARCH_JS_API_SERVICE_IMPL_H_
#define COMPONENTS_CONTEXTUAL_SEARCH_CONTENT_BROWSER_CONTEXTUAL_SEARCH_JS_API_SERVICE_IMPL_H_
#include "base/macros.h"
#include "components/contextual_search/browser/contextual_search_js_api_handler.h"
#include "components/contextual_search/common/contextual_search_js_api_service.mojom.h"
#include "components/contextual_search/content/browser/contextual_search_js_api_handler.h"
#include "components/contextual_search/content/common/contextual_search_js_api_service.mojom.h"
namespace contextual_search {
......@@ -52,4 +52,4 @@ void CreateContextualSearchJsApiService(
} // namespace contextual_search
#endif // COMPONENTS_CONTEXTUAL_SEARCH_BROWSER_CONTEXTUAL_SEARCH_JS_API_SERVICE_IMPL_H_
#endif // COMPONENTS_CONTEXTUAL_SEARCH_CONTENT_BROWSER_CONTEXTUAL_SEARCH_JS_API_SERVICE_IMPL_H_
......@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "components/contextual_search/renderer/contextual_search_wrapper.h"
#include "components/contextual_search/content/renderer/contextual_search_wrapper.h"
#include "base/strings/string_util.h"
#include "content/public/renderer/chrome_object_extensions_utils.h"
......@@ -35,7 +35,7 @@ void ContextualSearchWrapper::Install(content::RenderFrame* render_frame) {
// way to implement a communication channel between the page and Chrome,
// but found nothing better.
// TODO(donnd): use a better communication channel once that becomes
// available, e.g. navigator.connect API. See crbug.com/541683.
// available, e.g. navigator.connect API. See https://crbug.com/541683.
// TODO(donnd): refactor some of this boilerplate into a reusable
// method. This was cribbed from MemoryBenchmarkingExtension.
v8::Isolate* isolate = blink::MainThreadIsolate();
......
......@@ -2,11 +2,11 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef COMPONENTS_CONTEXTUAL_SEARCH_RENDERER_CONTEXTUAL_SEARCH_WRAPPER_H_
#define COMPONENTS_CONTEXTUAL_SEARCH_RENDERER_CONTEXTUAL_SEARCH_WRAPPER_H_
#ifndef COMPONENTS_CONTEXTUAL_SEARCH_CONTENT_RENDERER_CONTEXTUAL_SEARCH_WRAPPER_H_
#define COMPONENTS_CONTEXTUAL_SEARCH_CONTENT_RENDERER_CONTEXTUAL_SEARCH_WRAPPER_H_
#include "base/macros.h"
#include "components/contextual_search/common/contextual_search_js_api_service.mojom.h"
#include "components/contextual_search/content/common/contextual_search_js_api_service.mojom.h"
#include "content/public/renderer/render_frame.h"
#include "content/public/renderer/render_frame_observer.h"
#include "gin/handle.h"
......@@ -63,4 +63,4 @@ class ContextualSearchWrapper : public gin::Wrappable<ContextualSearchWrapper>,
} // namespace contextual_search
#endif // COMPONENTS_CONTEXTUAL_SEARCH_RENDERER_CONTEXTUAL_SEARCH_WRAPPER_H_
#endif // COMPONENTS_CONTEXTUAL_SEARCH_CONTENT_RENDERER_CONTEXTUAL_SEARCH_WRAPPER_H_
......@@ -2,12 +2,12 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "components/contextual_search/renderer/overlay_js_render_frame_observer.h"
#include "components/contextual_search/content/renderer/overlay_js_render_frame_observer.h"
#include <utility>
#include "base/bind.h"
#include "components/contextual_search/renderer/contextual_search_wrapper.h"
#include "components/contextual_search/content/renderer/contextual_search_wrapper.h"
#include "content/public/renderer/render_frame.h"
#include "mojo/public/cpp/bindings/strong_binding.h"
#include "services/service_manager/public/cpp/binder_registry.h"
......
......@@ -2,12 +2,12 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef COMPONENTS_CONTEXTUAL_SEARCH_RENDERER_OVERLAY_JS_RENDER_FRAME_OBSERVER_H_
#define COMPONENTS_CONTEXTUAL_SEARCH_RENDERER_OVERLAY_JS_RENDER_FRAME_OBSERVER_H_
#ifndef COMPONENTS_CONTEXTUAL_SEARCH_CONTENT_RENDERER_OVERLAY_JS_RENDER_FRAME_OBSERVER_H_
#define COMPONENTS_CONTEXTUAL_SEARCH_CONTENT_RENDERER_OVERLAY_JS_RENDER_FRAME_OBSERVER_H_
#include "base/macros.h"
#include "base/memory/weak_ptr.h"
#include "components/contextual_search/common/contextual_search_js_api_service.mojom.h"
#include "components/contextual_search/content/common/contextual_search_js_api_service.mojom.h"
#include "content/public/renderer/render_frame.h"
#include "content/public/renderer/render_frame_observer.h"
#include "services/service_manager/public/cpp/binder_registry.h"
......@@ -56,4 +56,4 @@ class OverlayJsRenderFrameObserver : public content::RenderFrameObserver {
} // namespace contextual_search
#endif // COMPONENTS_CONTEXTUAL_SEARCH_RENDERER_OVERLAY_JS_RENDER_FRAME_OBSERVER_H_
#endif // COMPONENTS_CONTEXTUAL_SEARCH_CONTENT_RENDERER_OVERLAY_JS_RENDER_FRAME_OBSERVER_H_
# Copyright 2018 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.
static_library("browser") {
sources = [
"browser/ctr_aggregator.cc",
"browser/ctr_aggregator.h",
"browser/weekly_activity_storage.cc",
"browser/weekly_activity_storage.h",
]
deps = [
"//base",
]
}
source_set("unit_tests") {
testonly = true
sources = [
"browser/ctr_aggregator_unittest.cc",
]
deps = [
":browser",
"//base",
"//testing/gtest",
]
}
include_rules = [
"-content",
]
......@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "components/contextual_search/browser/ctr_aggregator.h"
#include "components/contextual_search/core/browser/ctr_aggregator.h"
#include "base/numerics/safe_conversions.h"
#include "base/time/time.h"
......
......@@ -9,14 +9,14 @@
// Used by Contextual Search to record impressions of the Bar and CTR of
// panel opens to use as signals for Tap triggering.
#ifndef COMPONENTS_CONTEXTUAL_SEARCH_BROWSER_CTR_AGGREGATOR_H_
#define COMPONENTS_CONTEXTUAL_SEARCH_BROWSER_CTR_AGGREGATOR_H_
#ifndef COMPONENTS_CONTEXTUAL_SEARCH_CORE_BROWSER_CTR_AGGREGATOR_H_
#define COMPONENTS_CONTEXTUAL_SEARCH_CORE_BROWSER_CTR_AGGREGATOR_H_
#include <string>
#include "base/gtest_prod_util.h"
#include "base/macros.h"
#include "components/contextual_search/browser/weekly_activity_storage.h"
#include "components/contextual_search/core/browser/weekly_activity_storage.h"
namespace contextual_search {
......@@ -115,4 +115,4 @@ class CtrAggregator {
} // namespace contextual_search
#endif // COMPONENTS_CONTEXTUAL_SEARCH_BROWSER_CTR_AGGREGATOR_H_
#endif // COMPONENTS_CONTEXTUAL_SEARCH_CORE_BROWSER_CTR_AGGREGATOR_H_
......@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "components/contextual_search/browser/ctr_aggregator.h"
#include "components/contextual_search/core/browser/ctr_aggregator.h"
#include <unordered_map>
......
......@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "components/contextual_search/browser/weekly_activity_storage.h"
#include "components/contextual_search/core/browser/weekly_activity_storage.h"
#include <algorithm> // std::min
......
......@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef COMPONENTS_CONTEXTUAL_SEARCH_BROWSER_WEEKLY_ACTIVITY_STORAGE_H_
#define COMPONENTS_CONTEXTUAL_SEARCH_BROWSER_WEEKLY_ACTIVITY_STORAGE_H_
#ifndef COMPONENTS_CONTEXTUAL_SEARCH_CORE_BROWSER_WEEKLY_ACTIVITY_STORAGE_H_
#define COMPONENTS_CONTEXTUAL_SEARCH_CORE_BROWSER_WEEKLY_ACTIVITY_STORAGE_H_
#include <string>
#include <unordered_map>
......@@ -85,4 +85,4 @@ class WeeklyActivityStorage {
} // namespace contextual_search
#endif // COMPONENTS_CONTEXTUAL_SEARCH_BROWSER_WEEKLY_ACTIVITY_STORAGE_H_
#endif // COMPONENTS_CONTEXTUAL_SEARCH_CORE_BROWSER_WEEKLY_ACTIVITY_STORAGE_H_
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