Skip to content

Commit

Permalink
Move //chromeos/audio to //ash/components/audio
Browse files Browse the repository at this point in the history
This CL is part of the Chrome OS source code directory migration:
https://docs.google.com/document/d/15plIji-k6nMB19KJdNHLsK9jqBer_x-5O6MfTFZ8Fdo.

Bug: 1164001
Change-Id: Ieb0b8c916cea49672559f789469c479029669c6e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2620803
Commit-Queue: Henrique Ferreiro <hferreiro@igalia.com>
Owners-Override: Henrique Ferreiro <hferreiro@igalia.com>
Reviewed-by: James Cook <jamescook@chromium.org>
Cr-Commit-Position: refs/heads/master@{#855493}
  • Loading branch information
hferreiro authored and Chromium LUCI CQ committed Feb 18, 2021
1 parent 4e74168 commit 7b69376
Show file tree
Hide file tree
Showing 123 changed files with 209 additions and 168 deletions.
6 changes: 3 additions & 3 deletions ash/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -1808,6 +1808,7 @@ component("ash") {
"//ash/assistant/ui",
"//ash/assistant/ui:constants",
"//ash/assistant/util",
"//ash/components/audio",
"//ash/constants",
"//ash/keyboard/ui",
"//ash/login/resources:resources_grit",
Expand All @@ -1823,7 +1824,6 @@ component("ash") {
"//cc/debug",
"//cc/paint:paint",
"//chromeos/assistant:buildflags",
"//chromeos/audio",
"//chromeos/components/multidevice/logging",
"//chromeos/components/phonehub",
"//chromeos/components/quick_answers",
Expand Down Expand Up @@ -2436,6 +2436,7 @@ test("ash_unittests") {
"//ash/assistant/ui/test_support",
"//ash/assistant/util",
"//ash/components:unit_tests",
"//ash/components/audio",
"//ash/constants",
"//ash/keyboard/ui",
"//ash/keyboard/ui:test_support",
Expand All @@ -2453,7 +2454,6 @@ test("ash_unittests") {
"//base/util/values:values_util",
"//build:branding_buildflags",
"//chromeos:test_support",
"//chromeos/audio",
"//chromeos/components/phonehub:test_support",
"//chromeos/components/quick_answers:quick_answers",
"//chromeos/dbus:test_support",
Expand Down Expand Up @@ -2788,6 +2788,7 @@ static_library("test_support") {
"//ash/app_menu",
"//ash/assistant/model:model",
"//ash/assistant/ui:ui",
"//ash/components/audio",
"//ash/constants",
"//ash/keyboard/ui",
"//ash/keyboard/ui:test_support",
Expand All @@ -2798,7 +2799,6 @@ static_library("test_support") {
"//base:i18n",
"//base/test:test_support",
"//cc:test_support",
"//chromeos/audio",
"//chromeos/dbus:test_support",
"//chromeos/dbus/audio",
"//chromeos/dbus/power",
Expand Down
1 change: 0 additions & 1 deletion ash/DEPS
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ include_rules = [
# Only allow Chrome OS services and D-Bus clients accessible to the mustash
# ash process.
"-chromeos",
"+chromeos/audio",
"+chromeos/components/multidevice/logging/logging.h",
"+chromeos/components/phonehub",
"+chromeos/components/proximity_auth/public/mojom",
Expand Down
2 changes: 1 addition & 1 deletion ash/accelerators/accelerator_controller_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#include "ash/capture_mode/capture_mode_controller.h"
#include "ash/capture_mode/capture_mode_metrics.h"
#include "ash/clipboard/clipboard_history_controller_impl.h"
#include "ash/components/audio/cras_audio_handler.h"
#include "ash/constants/ash_features.h"
#include "ash/constants/devicetype.h"
#include "ash/debug.h"
Expand Down Expand Up @@ -95,7 +96,6 @@
#include "base/strings/string_split.h"
#include "base/strings/utf_string_conversions.h"
#include "base/system/sys_info.h"
#include "chromeos/audio/cras_audio_handler.h"
#include "chromeos/dbus/power/power_manager_client.h"
#include "chromeos/ui/vector_icons/vector_icons.h"
#include "components/user_manager/user_type.h"
Expand Down
4 changes: 2 additions & 2 deletions ash/accessibility/accessibility_controller_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
#include "ash/accessibility/accessibility_panel_layout_manager.h"
#include "ash/accessibility/point_scan_controller.h"
#include "ash/autoclick/autoclick_controller.h"
#include "ash/components/audio/cras_audio_handler.h"
#include "ash/components/audio/sounds.h"
#include "ash/events/accessibility_event_rewriter.h"
#include "ash/events/select_to_speak_event_handler.h"
#include "ash/high_contrast/high_contrast_controller.h"
Expand Down Expand Up @@ -47,8 +49,6 @@
#include "base/metrics/user_metrics.h"
#include "base/strings/string16.h"
#include "base/strings/string_number_conversions.h"
#include "chromeos/audio/chromeos_sounds.h"
#include "chromeos/audio/cras_audio_handler.h"
#include "components/pref_registry/pref_registry_syncable.h"
#include "components/prefs/pref_change_registrar.h"
#include "components/prefs/pref_registry_simple.h"
Expand Down
2 changes: 1 addition & 1 deletion ash/accessibility/accessibility_controller_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ class ASH_EXPORT AccessibilityControllerImpl : public AccessibilityController,

// Plays an earcon. Earcons are brief and distinctive sounds that indicate
// that their mapped event has occurred. The |sound_key| enums can be found in
// chromeos/audio/chromeos_sounds.h.
// ash/components/audio/sounds.h.
void PlayEarcon(chromeos::Sound sound_key);

// Initiates play of shutdown sound. Returns the TimeDelta duration.
Expand Down
2 changes: 1 addition & 1 deletion ash/accessibility/test_accessibility_controller_client.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
#ifndef ASH_ACCESSIBILITY_TEST_ACCESSIBILITY_CONTROLLER_CLEINT_H_
#define ASH_ACCESSIBILITY_TEST_ACCESSIBILITY_CONTROLLER_CLEINT_H_

#include "ash/components/audio/sounds.h"
#include "ash/public/cpp/accessibility_controller_client.h"
#include "ash/public/cpp/accessibility_controller_enums.h"
#include "base/macros.h"
#include "base/optional.h"
#include "chromeos/audio/chromeos_sounds.h"
#include "ui/accessibility/ax_enums.mojom.h"

namespace ash {
Expand Down
4 changes: 2 additions & 2 deletions ash/accessibility/touch_exploration_manager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
#include "ash/accessibility/accessibility_controller_impl.h"
#include "ash/accessibility/accessibility_focus_ring_controller_impl.h"
#include "ash/accessibility/touch_exploration_controller.h"
#include "ash/components/audio/cras_audio_handler.h"
#include "ash/components/audio/sounds.h"
#include "ash/constants/ash_switches.h"
#include "ash/keyboard/ui/keyboard_ui_controller.h"
#include "ash/public/cpp/accessibility_focus_ring_info.h"
Expand All @@ -19,8 +21,6 @@
#include "ash/wm/window_util.h"
#include "base/command_line.h"
#include "base/metrics/histogram_functions.h"
#include "chromeos/audio/chromeos_sounds.h"
#include "chromeos/audio/cras_audio_handler.h"
#include "extensions/common/constants.h"
#include "ui/accessibility/ax_enums.mojom.h"
#include "ui/aura/client/aura_constants.h"
Expand Down
2 changes: 1 addition & 1 deletion ash/accessibility/touch_exploration_manager_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
#include "ash/accessibility/touch_exploration_manager.h"

#include "ash/accessibility/test_accessibility_controller_client.h"
#include "ash/components/audio/cras_audio_handler.h"
#include "ash/root_window_controller.h"
#include "ash/shell.h"
#include "ash/test/ash_test_base.h"
#include "chromeos/audio/cras_audio_handler.h"
#include "ui/accessibility/ax_enums.mojom.h"

namespace ash {
Expand Down
2 changes: 1 addition & 1 deletion ash/assistant/assistant_controller_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include "ash/assistant/assistant_view_delegate_impl.h"
#include "ash/assistant/assistant_web_ui_controller.h"
#include "ash/assistant/ui/assistant_view_delegate.h"
#include "ash/components/audio/cras_audio_handler.h"
#include "ash/public/cpp/assistant/assistant_interface_binder.h"
#include "ash/public/cpp/assistant/controller/assistant_controller.h"
#include "ash/public/cpp/assistant/controller/assistant_controller_observer.h"
Expand All @@ -31,7 +32,6 @@
#include "base/macros.h"
#include "base/memory/weak_ptr.h"
#include "base/observer_list.h"
#include "chromeos/audio/cras_audio_handler.h"
#include "chromeos/services/assistant/public/cpp/assistant_service.h"
#include "components/prefs/pref_service.h"
#include "mojo/public/cpp/bindings/pending_receiver.h"
Expand Down
5 changes: 4 additions & 1 deletion ash/components/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@ assert(is_chromeos_ash, "Non-ChromeOS builds cannot depend on //ash")
# component and add a reference here.
source_set("unit_tests") {
testonly = true
deps = [ "//ash/components/account_manager:unit_tests" ]
deps = [
"//ash/components/account_manager:unit_tests",
"//ash/components/audio:unit_tests",
]

data_deps = [
"//chromeos/strings:chromeos_test_strings",
Expand Down
7 changes: 4 additions & 3 deletions chromeos/audio/BUILD.gn → ash/components/audio/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

import("//build/config/chromeos/ui_mode.gni")
import("//testing/test.gni")

assert(is_chromeos, "Non-Chrome-OS builds must not depend on //chromeos")
assert(is_chromeos_ash, "Non-Chrome-OS builds must not depend on //ash")

component("audio") {
defines = [ "IS_CHROMEOS_AUDIO_IMPL" ]
defines = [ "IS_ASH_COMPONENTS_AUDIO_IMPL" ]
deps = [
"//ash/constants",
"//base",
Expand All @@ -25,9 +26,9 @@ component("audio") {
"audio_devices_pref_handler_stub.cc",
"audio_devices_pref_handler_stub.h",
"audio_pref_observer.h",
"chromeos_sounds.h",
"cras_audio_handler.cc",
"cras_audio_handler.h",
"sounds.h",
]
}

Expand Down
2 changes: 1 addition & 1 deletion chromeos/audio/DEPS → ash/components/audio/DEPS
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ include_rules = [
"+components/prefs",
"+media",
"+mojo/public/cpp/bindings",
"+testing",
"+services/media_session/public",
"+testing",
]
File renamed without changes.
File renamed without changes.
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 "chromeos/audio/audio_device.h"
#include "ash/components/audio/audio_device.h"

#include <stdint.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 CHROMEOS_AUDIO_AUDIO_DEVICE_H_
#define CHROMEOS_AUDIO_AUDIO_DEVICE_H_
#ifndef ASH_COMPONENTS_AUDIO_AUDIO_DEVICE_H_
#define ASH_COMPONENTS_AUDIO_AUDIO_DEVICE_H_

#include <stdint.h>

Expand Down Expand Up @@ -37,7 +37,7 @@ enum class AudioDeviceType {
kOther,
};

struct COMPONENT_EXPORT(CHROMEOS_AUDIO) AudioDevice {
struct COMPONENT_EXPORT(ASH_COMPONENTS_AUDIO) AudioDevice {
AudioDevice();
explicit AudioDevice(const AudioNode& node);
AudioDevice(const AudioDevice& other);
Expand Down Expand Up @@ -136,4 +136,4 @@ using ::chromeos::AudioDevice;
using ::chromeos::AudioDeviceType;
} // namespace ash

#endif // CHROMEOS_AUDIO_AUDIO_DEVICE_H_
#endif // ASH_COMPONENTS_AUDIO_AUDIO_DEVICE_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.

#ifndef CHROMEOS_AUDIO_AUDIO_DEVICES_PREF_HANDLER_H_
#define CHROMEOS_AUDIO_AUDIO_DEVICES_PREF_HANDLER_H_
#ifndef ASH_COMPONENTS_AUDIO_AUDIO_DEVICES_PREF_HANDLER_H_
#define ASH_COMPONENTS_AUDIO_AUDIO_DEVICES_PREF_HANDLER_H_

#include "ash/components/audio/audio_pref_observer.h"
#include "base/component_export.h"
#include "base/memory/ref_counted.h"
#include "chromeos/audio/audio_pref_observer.h"

namespace chromeos {

Expand All @@ -16,7 +16,7 @@ struct AudioDevice;
// Interface that handles audio preference related work, reads and writes
// audio preferences, and notifies AudioPrefObserver for audio preference
// changes.
class COMPONENT_EXPORT(CHROMEOS_AUDIO) AudioDevicesPrefHandler
class COMPONENT_EXPORT(ASH_COMPONENTS_AUDIO) AudioDevicesPrefHandler
: public base::RefCountedThreadSafe<AudioDevicesPrefHandler> {
public:
// Integer because C++ does not allow static const double in header files.
Expand Down Expand Up @@ -68,4 +68,4 @@ class COMPONENT_EXPORT(CHROMEOS_AUDIO) AudioDevicesPrefHandler

} // namespace chromeos

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

#include "chromeos/audio/audio_devices_pref_handler_impl.h"
#include "ash/components/audio/audio_devices_pref_handler_impl.h"

#include <stdint.h>

#include <algorithm>

#include "ash/components/audio/audio_device.h"
#include "ash/constants/ash_pref_names.h"
#include "base/bind.h"
#include "base/callback_helpers.h"
#include "base/logging.h"
#include "base/strings/string_number_conversions.h"
#include "chromeos/audio/audio_device.h"
#include "components/prefs/pref_registry_simple.h"
#include "components/prefs/pref_service.h"
#include "components/prefs/scoped_user_pref_update.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef CHROMEOS_AUDIO_AUDIO_DEVICES_PREF_HANDLER_IMPL_H_
#define CHROMEOS_AUDIO_AUDIO_DEVICES_PREF_HANDLER_IMPL_H_
#ifndef ASH_COMPONENTS_AUDIO_AUDIO_DEVICES_PREF_HANDLER_IMPL_H_
#define ASH_COMPONENTS_AUDIO_AUDIO_DEVICES_PREF_HANDLER_IMPL_H_

#include <memory>
#include <string>

#include "ash/components/audio/audio_devices_pref_handler.h"
#include "base/component_export.h"
#include "base/macros.h"
#include "base/observer_list.h"
#include "base/values.h"
#include "chromeos/audio/audio_devices_pref_handler.h"
#include "components/prefs/pref_change_registrar.h"

class PrefRegistrySimple;
Expand All @@ -22,7 +22,7 @@ namespace chromeos {

// Class which implements AudioDevicesPrefHandler interface and register audio
// preferences as well.
class COMPONENT_EXPORT(CHROMEOS_AUDIO) AudioDevicesPrefHandlerImpl
class COMPONENT_EXPORT(ASH_COMPONENTS_AUDIO) AudioDevicesPrefHandlerImpl
: public AudioDevicesPrefHandler {
public:
// |local_state| is the device-wide preference service.
Expand Down Expand Up @@ -123,4 +123,4 @@ class COMPONENT_EXPORT(CHROMEOS_AUDIO) AudioDevicesPrefHandlerImpl

} // namespace chromeos

#endif // CHROMEOS_AUDIO_AUDIO_DEVICES_PREF_HANDLER_IMPL_H_
#endif // ASH_COMPONENTS_AUDIO_AUDIO_DEVICES_PREF_HANDLER_IMPL_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 "chromeos/audio/audio_devices_pref_handler_impl.h"
#include "ash/components/audio/audio_devices_pref_handler_impl.h"

#include <stdint.h>

#include "ash/components/audio/audio_device.h"
#include "ash/components/audio/audio_devices_pref_handler.h"
#include "ash/constants/ash_pref_names.h"
#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "chromeos/audio/audio_device.h"
#include "chromeos/audio/audio_devices_pref_handler.h"
#include "chromeos/dbus/audio/audio_node.h"
#include "components/prefs/scoped_user_pref_update.h"
#include "components/prefs/testing_pref_service.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "chromeos/audio/audio_devices_pref_handler_stub.h"
#include "ash/components/audio/audio_devices_pref_handler_stub.h"

#include "ash/components/audio/audio_device.h"
#include "base/containers/contains.h"
#include "chromeos/audio/audio_device.h"

namespace chromeos {

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

#ifndef CHROMEOS_AUDIO_AUDIO_DEVICES_PREF_HANDLER_STUB_H_
#define CHROMEOS_AUDIO_AUDIO_DEVICES_PREF_HANDLER_STUB_H_
#ifndef ASH_COMPONENTS_AUDIO_AUDIO_DEVICES_PREF_HANDLER_STUB_H_
#define ASH_COMPONENTS_AUDIO_AUDIO_DEVICES_PREF_HANDLER_STUB_H_

#include <stdint.h>

#include <map>

#include "ash/components/audio/audio_devices_pref_handler.h"
#include "base/component_export.h"
#include "base/macros.h"
#include "chromeos/audio/audio_devices_pref_handler.h"

namespace chromeos {

// Stub class for AudioDevicesPrefHandler, used for testing.
class COMPONENT_EXPORT(CHROMEOS_AUDIO) AudioDevicesPrefHandlerStub
class COMPONENT_EXPORT(ASH_COMPONENTS_AUDIO) AudioDevicesPrefHandlerStub
: public AudioDevicesPrefHandler {
public:
struct DeviceState {
Expand Down Expand Up @@ -59,4 +59,4 @@ class COMPONENT_EXPORT(CHROMEOS_AUDIO) AudioDevicesPrefHandlerStub

} // namespace chromeos

#endif // CHROMEOS_AUDIO_AUDIO_DEVICES_PREF_HANDLER_STUB_H_
#endif // ASH_COMPONENTS_AUDIO_AUDIO_DEVICES_PREF_HANDLER_STUB_H_
Loading

0 comments on commit 7b69376

Please sign in to comment.