Skip to content

Commit

Permalink
[Live Caption] Move into dedicated subfolders.
Browse files Browse the repository at this point in the history
There is now a significant amount of live-caption-specific code that
lives in //c/b/a11y and //c/b/a/a11y. This CL introduces live_caption
subfolders to these folders, more clearly demarcating the live caption
feature.

Bug: b/262455350
Change-Id: I66d4133820250e572819eadf64be7f9162a2c52f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4190429
Reviewed-by: Abigail Klein <abigailbklein@google.com>
Reviewed-by: Katie Dektar <katie@chromium.org>
Commit-Queue: Michael Martis <martis@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1099513}
  • Loading branch information
martis-chromium authored and Chromium LUCI CQ committed Jan 31, 2023
1 parent 17fcedb commit 5d9cd56
Show file tree
Hide file tree
Showing 35 changed files with 90 additions and 78 deletions.
16 changes: 8 additions & 8 deletions chrome/browser/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -4548,17 +4548,17 @@ static_library("browser") {

if (!is_chromeos_lacros) {
sources += [
"accessibility/live_caption_controller_factory.cc",
"accessibility/live_caption_controller_factory.h",
"accessibility/live_caption_speech_recognition_host.cc",
"accessibility/live_caption_speech_recognition_host.h",
"accessibility/live_caption/live_caption_controller_factory.cc",
"accessibility/live_caption/live_caption_controller_factory.h",
"accessibility/live_caption/live_caption_speech_recognition_host.cc",
"accessibility/live_caption/live_caption_speech_recognition_host.h",
]
}

if (is_win) {
sources += [
"accessibility/live_caption_unavailability_notifier.cc",
"accessibility/live_caption_unavailability_notifier.h",
"accessibility/live_caption/live_caption_unavailability_notifier.cc",
"accessibility/live_caption/live_caption_unavailability_notifier.h",
]
}

Expand Down Expand Up @@ -5259,8 +5259,8 @@ static_library("browser") {
if (is_chromeos_lacros) {
assert(enable_system_notifications)
sources += [
"accessibility/live_caption_surface.cc",
"accessibility/live_caption_surface.h",
"accessibility/live_caption/live_caption_surface.cc",
"accessibility/live_caption/live_caption_surface.h",
"apps/digital_goods/digital_goods_factory_stub.cc",
"apps/digital_goods/digital_goods_factory_stub.h",
"apps/digital_goods/digital_goods_lacros.cc",
Expand Down
4 changes: 2 additions & 2 deletions chrome/browser/accessibility/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import("//build/config/chromeos/ui_mode.gni")
source_set("test_support") {
testonly = true
sources = [
"live_caption_test_util.cc",
"live_caption_test_util.h",
"live_caption/live_caption_test_util.cc",
"live_caption/live_caption_test_util.h",
]

deps = [
Expand Down
5 changes: 5 additions & 0 deletions chrome/browser/accessibility/live_caption/DIR_METADATA
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
monorail { component: "Internals>Media>LiveCaption" }
buganizer {
# ChromeOS>Software>Fundamentals>Machine Intelligence>SODA & Live Caption
component_id: 1116342
}
1 change: 1 addition & 0 deletions chrome/browser/accessibility/live_caption/OWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
file://components/live_caption/OWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
#include "build/build_config.h"
#include "build/chromeos_buildflags.h"
#include "chrome/browser/accessibility/caption_bubble_context_browser.h"
#include "chrome/browser/accessibility/live_caption_controller_factory.h"
#include "chrome/browser/accessibility/live_caption_test_util.h"
#include "chrome/browser/accessibility/live_caption/live_caption_controller_factory.h"
#include "chrome/browser/accessibility/live_caption/live_caption_test_util.h"
#include "chrome/browser/browser_features.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/lifetime/application_lifetime.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 "chrome/browser/accessibility/live_caption_controller_factory.h"
#include "chrome/browser/accessibility/live_caption/live_caption_controller_factory.h"

#include "base/no_destructor.h"
#include "build/chromeos_buildflags.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 CHROME_BROWSER_ACCESSIBILITY_LIVE_CAPTION_CONTROLLER_FACTORY_H_
#define CHROME_BROWSER_ACCESSIBILITY_LIVE_CAPTION_CONTROLLER_FACTORY_H_
#ifndef CHROME_BROWSER_ACCESSIBILITY_LIVE_CAPTION_LIVE_CAPTION_CONTROLLER_FACTORY_H_
#define CHROME_BROWSER_ACCESSIBILITY_LIVE_CAPTION_LIVE_CAPTION_CONTROLLER_FACTORY_H_

#include "base/no_destructor.h"
#include "chrome/browser/profiles/profile_keyed_service_factory.h"
Expand Down Expand Up @@ -37,4 +37,4 @@ class LiveCaptionControllerFactory : public ProfileKeyedServiceFactory {

} // namespace captions

#endif // CHROME_BROWSER_ACCESSIBILITY_LIVE_CAPTION_CONTROLLER_FACTORY_H_
#endif // CHROME_BROWSER_ACCESSIBILITY_LIVE_CAPTION_LIVE_CAPTION_CONTROLLER_FACTORY_H_
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "chrome/browser/accessibility/live_caption_speech_recognition_host.h"
#include "chrome/browser/accessibility/live_caption/live_caption_speech_recognition_host.h"

#include <memory>
#include <utility>

#include "base/functional/callback_forward.h"
#include "build/build_config.h"
#include "chrome/browser/accessibility/caption_bubble_context_browser.h"
#include "chrome/browser/accessibility/live_caption_controller_factory.h"
#include "chrome/browser/accessibility/live_caption/live_caption_controller_factory.h"
#include "chrome/browser/profiles/profile.h"
#include "components/live_caption/live_caption_controller.h"
#include "components/live_caption/views/caption_bubble_model.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 CHROME_BROWSER_ACCESSIBILITY_LIVE_CAPTION_SPEECH_RECOGNITION_HOST_H_
#define CHROME_BROWSER_ACCESSIBILITY_LIVE_CAPTION_SPEECH_RECOGNITION_HOST_H_
#ifndef CHROME_BROWSER_ACCESSIBILITY_LIVE_CAPTION_LIVE_CAPTION_SPEECH_RECOGNITION_HOST_H_
#define CHROME_BROWSER_ACCESSIBILITY_LIVE_CAPTION_LIVE_CAPTION_SPEECH_RECOGNITION_HOST_H_

#include <memory>

Expand Down Expand Up @@ -82,4 +82,4 @@ class LiveCaptionSpeechRecognitionHost

} // namespace captions

#endif // CHROME_BROWSER_ACCESSIBILITY_LIVE_CAPTION_SPEECH_RECOGNITION_HOST_H_
#endif // CHROME_BROWSER_ACCESSIBILITY_LIVE_CAPTION_LIVE_CAPTION_SPEECH_RECOGNITION_HOST_H_
Original file line number Diff line number Diff line change
Expand Up @@ -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 "chrome/browser/accessibility/live_caption_speech_recognition_host.h"
#include "chrome/browser/accessibility/live_caption/live_caption_speech_recognition_host.h"

#include "build/build_config.h"
#include "build/chromeos_buildflags.h"
#include "chrome/browser/accessibility/live_caption_controller_factory.h"
#include "chrome/browser/accessibility/live_caption_test_util.h"
#include "chrome/browser/accessibility/live_caption/live_caption_controller_factory.h"
#include "chrome/browser/accessibility/live_caption/live_caption_test_util.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/test/base/in_process_browser_test.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "chrome/browser/accessibility/live_caption_surface.h"
#include "chrome/browser/accessibility/live_caption/live_caption_surface.h"

#include "base/functional/callback_forward.h"
#include "base/unguessable_token.h"
#include "build/build_config.h"
#include "chrome/browser/accessibility/caption_bubble_context_browser.h"
#include "chrome/browser/accessibility/live_caption_controller_factory.h"
#include "chrome/browser/accessibility/live_caption/live_caption_controller_factory.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_finder.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 CHROME_BROWSER_ACCESSIBILITY_LIVE_CAPTION_SURFACE_H_
#define CHROME_BROWSER_ACCESSIBILITY_LIVE_CAPTION_SURFACE_H_
#ifndef CHROME_BROWSER_ACCESSIBILITY_LIVE_CAPTION_LIVE_CAPTION_SURFACE_H_
#define CHROME_BROWSER_ACCESSIBILITY_LIVE_CAPTION_LIVE_CAPTION_SURFACE_H_

#include "base/unguessable_token.h"
#include "build/build_config.h"
Expand Down Expand Up @@ -72,4 +72,4 @@ class LiveCaptionSurface

} // namespace captions

#endif // CHROME_BROWSER_ACCESSIBILITY_LIVE_CAPTION_SURFACE_H_
#endif // CHROME_BROWSER_ACCESSIBILITY_LIVE_CAPTION_LIVE_CAPTION_SURFACE_H_
Original file line number Diff line number Diff line change
Expand Up @@ -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 "chrome/browser/accessibility/live_caption_surface.h"
#include "chrome/browser/accessibility/live_caption/live_caption_surface.h"

#include "base/path_service.h"
#include "base/test/bind.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 "chrome/browser/accessibility/live_caption_test_util.h"
#include "chrome/browser/accessibility/live_caption/live_caption_test_util.h"

#include <vector>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 CHROME_BROWSER_ACCESSIBILITY_LIVE_CAPTION_TEST_UTIL_H_
#define CHROME_BROWSER_ACCESSIBILITY_LIVE_CAPTION_TEST_UTIL_H_
#ifndef CHROME_BROWSER_ACCESSIBILITY_LIVE_CAPTION_LIVE_CAPTION_TEST_UTIL_H_
#define CHROME_BROWSER_ACCESSIBILITY_LIVE_CAPTION_LIVE_CAPTION_TEST_UTIL_H_

#include "base/feature_list.h"
#include "base/test/scoped_feature_list.h"
Expand Down Expand Up @@ -37,4 +37,4 @@ class LiveCaptionBrowserTest : public InProcessBrowserTest {

} // namespace captions

#endif // CHROME_BROWSER_ACCESSIBILITY_LIVE_CAPTION_TEST_UTIL_H_
#endif // CHROME_BROWSER_ACCESSIBILITY_LIVE_CAPTION_LIVE_CAPTION_TEST_UTIL_H_
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "chrome/browser/accessibility/live_caption_unavailability_notifier.h"
#include "chrome/browser/accessibility/live_caption/live_caption_unavailability_notifier.h"

#include <memory>
#include <utility>

#include "base/containers/contains.h"
#include "base/memory/weak_ptr.h"
#include "chrome/browser/accessibility/caption_bubble_context_browser.h"
#include "chrome/browser/accessibility/live_caption_controller_factory.h"
#include "chrome/browser/accessibility/live_caption/live_caption_controller_factory.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/chrome_pages.h"
#include "components/live_caption/live_caption_controller.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 CHROME_BROWSER_ACCESSIBILITY_LIVE_CAPTION_UNAVAILABILITY_NOTIFIER_H_
#define CHROME_BROWSER_ACCESSIBILITY_LIVE_CAPTION_UNAVAILABILITY_NOTIFIER_H_
#ifndef CHROME_BROWSER_ACCESSIBILITY_LIVE_CAPTION_LIVE_CAPTION_UNAVAILABILITY_NOTIFIER_H_
#define CHROME_BROWSER_ACCESSIBILITY_LIVE_CAPTION_LIVE_CAPTION_UNAVAILABILITY_NOTIFIER_H_

#include <memory>

Expand Down Expand Up @@ -82,4 +82,4 @@ class LiveCaptionUnavailabilityNotifier

} // namespace captions

#endif // CHROME_BROWSER_ACCESSIBILITY_LIVE_CAPTION_UNAVAILABILITY_NOTIFIER_H_
#endif // CHROME_BROWSER_ACCESSIBILITY_LIVE_CAPTION_LIVE_CAPTION_UNAVAILABILITY_NOTIFIER_H_
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
// Copyright 2022 The Chromium Authors. All rights reserved.
// Copyright 2023 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "chrome/browser/accessibility/live_caption_unavailability_notifier.h"
#include "chrome/browser/accessibility/live_caption/live_caption_unavailability_notifier.h"

#include "base/run_loop.h"
#include "build/build_config.h"
#include "chrome/browser/accessibility/live_caption_controller_factory.h"
#include "chrome/browser/accessibility/live_caption_test_util.h"
#include "chrome/browser/accessibility/live_caption/live_caption_controller_factory.h"
#include "chrome/browser/accessibility/live_caption/live_caption_test_util.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/test/base/in_process_browser_test.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 "chrome/browser/accessibility/live_caption_unavailability_notifier.h"
#include "chrome/browser/accessibility/live_caption/live_caption_unavailability_notifier.h"

#include "base/memory/raw_ptr.h"
#include "chrome/test/base/chrome_render_view_host_test_harness.h"
Expand Down
8 changes: 4 additions & 4 deletions chrome/browser/ash/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ source_set("ash") {
"accessibility/dictation.h",
"accessibility/event_handler_common.cc",
"accessibility/event_handler_common.h",
"accessibility/live_caption/system_live_caption_service.cc",
"accessibility/live_caption/system_live_caption_service.h",
"accessibility/live_caption/system_live_caption_service_factory.cc",
"accessibility/live_caption/system_live_caption_service_factory.h",
"accessibility/magnification_manager.cc",
"accessibility/magnification_manager.h",
"accessibility/magnifier_type.h",
Expand All @@ -55,10 +59,6 @@ source_set("ash") {
"accessibility/service/accessibility_service_client.h",
"accessibility/service/automation_client_impl.cc",
"accessibility/service/automation_client_impl.h",
"accessibility/system_live_caption_service.cc",
"accessibility/system_live_caption_service.h",
"accessibility/system_live_caption_service_factory.cc",
"accessibility/system_live_caption_service_factory.h",
"account_manager/account_apps_availability.cc",
"account_manager/account_apps_availability.h",
"account_manager/account_apps_availability_factory.cc",
Expand Down
5 changes: 5 additions & 0 deletions chrome/browser/ash/accessibility/live_caption/DIR_METADATA
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
monorail { component: "Internals>Media>LiveCaption" }
buganizer {
# ChromeOS>Software>Fundamentals>Machine Intelligence>SODA & Live Caption
component_id: 1116342
}
1 change: 1 addition & 0 deletions chrome/browser/ash/accessibility/live_caption/OWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
file://components/live_caption/OWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#include "base/run_loop.h"
#include "base/test/bind.h"
#include "base/test/scoped_feature_list.h"
#include "chrome/browser/accessibility/live_caption_controller_factory.h"
#include "chrome/browser/accessibility/live_caption/live_caption_controller_factory.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_window.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "chrome/browser/ash/accessibility/system_live_caption_service.h"
#include "chrome/browser/ash/accessibility/live_caption/system_live_caption_service.h"

#include "ash/accessibility/caption_bubble_context_ash.h"
#include "base/functional/callback_forward.h"
#include "chrome/browser/accessibility/live_caption_controller_factory.h"
#include "chrome/browser/accessibility/live_caption/live_caption_controller_factory.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/profiles/profile_manager.h"
#include "chrome/browser/speech/speech_recognition_client_browser_interface.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 CHROME_BROWSER_ASH_ACCESSIBILITY_SYSTEM_LIVE_CAPTION_SERVICE_H_
#define CHROME_BROWSER_ASH_ACCESSIBILITY_SYSTEM_LIVE_CAPTION_SERVICE_H_
#ifndef CHROME_BROWSER_ASH_ACCESSIBILITY_LIVE_CAPTION_SYSTEM_LIVE_CAPTION_SERVICE_H_
#define CHROME_BROWSER_ASH_ACCESSIBILITY_LIVE_CAPTION_SYSTEM_LIVE_CAPTION_SERVICE_H_

#include <memory>

Expand Down Expand Up @@ -105,4 +105,4 @@ class SystemLiveCaptionService

} // namespace ash

#endif // CHROME_BROWSER_ASH_ACCESSIBILITY_SYSTEM_LIVE_CAPTION_SERVICE_H_
#endif // CHROME_BROWSER_ASH_ACCESSIBILITY_LIVE_CAPTION_SYSTEM_LIVE_CAPTION_SERVICE_H_
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "chrome/browser/ash/accessibility/system_live_caption_service.h"
#include "chrome/browser/ash/accessibility/live_caption/system_live_caption_service.h"

#include <memory>

#include "ash/constants/ash_features.h"
#include "ash/constants/ash_switches.h"
#include "chrome/browser/accessibility/live_caption_controller_factory.h"
#include "chrome/browser/ash/accessibility/system_live_caption_service_factory.h"
#include "chrome/browser/accessibility/live_caption/live_caption_controller_factory.h"
#include "chrome/browser/ash/accessibility/live_caption/system_live_caption_service_factory.h"
#include "chrome/browser/ash/login/session/user_session_initializer.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/profiles/profile.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "chrome/browser/ash/accessibility/system_live_caption_service_factory.h"
#include "chrome/browser/ash/accessibility/live_caption/system_live_caption_service_factory.h"

#include "base/no_destructor.h"
#include "chrome/browser/accessibility/live_caption_controller_factory.h"
#include "chrome/browser/ash/accessibility/system_live_caption_service.h"
#include "chrome/browser/accessibility/live_caption/live_caption_controller_factory.h"
#include "chrome/browser/ash/accessibility/live_caption/system_live_caption_service.h"
#include "chrome/browser/profiles/profile.h"

namespace ash {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 CHROME_BROWSER_ASH_ACCESSIBILITY_SYSTEM_LIVE_CAPTION_SERVICE_FACTORY_H_
#define CHROME_BROWSER_ASH_ACCESSIBILITY_SYSTEM_LIVE_CAPTION_SERVICE_FACTORY_H_
#ifndef CHROME_BROWSER_ASH_ACCESSIBILITY_LIVE_CAPTION_SYSTEM_LIVE_CAPTION_SERVICE_FACTORY_H_
#define CHROME_BROWSER_ASH_ACCESSIBILITY_LIVE_CAPTION_SYSTEM_LIVE_CAPTION_SERVICE_FACTORY_H_

#include "base/no_destructor.h"
#include "chrome/browser/profiles/profile_keyed_service_factory.h"
Expand Down Expand Up @@ -39,4 +39,4 @@ class SystemLiveCaptionServiceFactory : public ProfileKeyedServiceFactory {

} // namespace ash

#endif // CHROME_BROWSER_ASH_ACCESSIBILITY_SYSTEM_LIVE_CAPTION_SERVICE_FACTORY_H_
#endif // CHROME_BROWSER_ASH_ACCESSIBILITY_LIVE_CAPTION_SYSTEM_LIVE_CAPTION_SERVICE_FACTORY_H_

0 comments on commit 5d9cd56

Please sign in to comment.