Commit fb20eed1 authored by Tom Anderson's avatar Tom Anderson Committed by Commit Bot

Move DbusMenu (and dependencies) to //components/dbus

This is needed in preparation for using DbusMenu in
global_menu_bar_x11.cc

BUG=981201
R=thestig

Change-Id: I84b4ef13fe32eb342e702bedf9309b4e955cebb2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1688132Reviewed-by: default avatarLei Zhang <thestig@chromium.org>
Reviewed-by: default avatarRyo Hashimoto <hashimoto@chromium.org>
Reviewed-by: default avatarNico Weber <thakis@chromium.org>
Commit-Queue: Thomas Anderson <thomasanderson@chromium.org>
Cr-Commit-Position: refs/heads/master@{#676160}
parent bb657e53
...@@ -3793,7 +3793,7 @@ jumbo_split_static_library("browser") { ...@@ -3793,7 +3793,7 @@ jumbo_split_static_library("browser") {
] ]
if (use_dbus) { if (use_dbus) {
deps += [ "//components/dbus:dbus_thread_linux" ] deps += [ "//components/dbus/thread_linux" ]
} }
if (enable_native_notifications) { if (enable_native_notifications) {
......
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
#include "chrome/grit/chrome_unscaled_resources.h" #include "chrome/grit/chrome_unscaled_resources.h"
#include "chrome/grit/chromium_strings.h" #include "chrome/grit/chromium_strings.h"
#include "chrome/grit/generated_resources.h" #include "chrome/grit/generated_resources.h"
#include "components/dbus/dbus_thread_linux.h" #include "components/dbus/thread_linux/dbus_thread_linux.h"
#include "components/url_formatter/elide_url.h" #include "components/url_formatter/elide_url.h"
#include "content/public/browser/browser_task_traits.h" #include "content/public/browser/browser_task_traits.h"
#include "content/public/browser/browser_thread.h" #include "content/public/browser/browser_thread.h"
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
#include "chrome/browser/notifications/notification_display_service_tester.h" #include "chrome/browser/notifications/notification_display_service_tester.h"
#include "chrome/browser/notifications/notification_test_util.h" #include "chrome/browser/notifications/notification_test_util.h"
#include "chrome/test/base/browser_with_test_window_test.h" #include "chrome/test/base/browser_with_test_window_test.h"
#include "components/dbus/dbus_thread_linux.h" #include "components/dbus/thread_linux/dbus_thread_linux.h"
#include "content/public/test/test_utils.h" #include "content/public/test/test_utils.h"
#include "dbus/mock_bus.h" #include "dbus/mock_bus.h"
#include "dbus/mock_object_proxy.h" #include "dbus/mock_object_proxy.h"
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
#include "base/threading/thread_restrictions.h" #include "base/threading/thread_restrictions.h"
#include "chrome/grit/chromium_strings.h" #include "chrome/grit/chromium_strings.h"
#include "components/autofill/core/common/password_form.h" #include "components/autofill/core/common/password_form.h"
#include "components/dbus/dbus_thread_linux.h" #include "components/dbus/thread_linux/dbus_thread_linux.h"
#include "components/password_manager/core/browser/password_manager_util.h" #include "components/password_manager/core/browser/password_manager_util.h"
#include "dbus/bus.h" #include "dbus/bus.h"
#include "dbus/message.h" #include "dbus/message.h"
......
...@@ -2407,19 +2407,15 @@ jumbo_split_static_library("ui") { ...@@ -2407,19 +2407,15 @@ jumbo_split_static_library("ui") {
sources += [ sources += [
"views/status_icons/concat_menu_model.cc", "views/status_icons/concat_menu_model.cc",
"views/status_icons/concat_menu_model.h", "views/status_icons/concat_menu_model.h",
"views/status_icons/dbus_menu.cc",
"views/status_icons/dbus_menu.h",
"views/status_icons/dbus_properties_interface.cc",
"views/status_icons/dbus_properties_interface.h",
"views/status_icons/dbus_types.cc",
"views/status_icons/dbus_types.h",
"views/status_icons/status_icon_linux_dbus.cc", "views/status_icons/status_icon_linux_dbus.cc",
"views/status_icons/status_icon_linux_dbus.h", "views/status_icons/status_icon_linux_dbus.h",
"views/status_icons/success_barrier_callback.cc",
"views/status_icons/success_barrier_callback.h",
] ]
defines += [ "USE_DBUS" ] defines += [ "USE_DBUS" ]
deps += [ "//components/dbus:dbus_thread_linux" ] deps += [
"//components/dbus/menu",
"//components/dbus/menu:success_barrier_callback",
"//components/dbus/thread_linux",
]
} }
if (use_x11) { if (use_x11) {
......
...@@ -16,11 +16,11 @@ ...@@ -16,11 +16,11 @@
#include "base/process/process.h" #include "base/process/process.h"
#include "base/strings/string_number_conversions.h" #include "base/strings/string_number_conversions.h"
#include "base/strings/utf_string_conversions.h" #include "base/strings/utf_string_conversions.h"
#include "chrome/browser/ui/views/status_icons/dbus_menu.h" #include "components/dbus/menu/menu.h"
#include "chrome/browser/ui/views/status_icons/dbus_properties_interface.h" #include "components/dbus/menu/properties_interface.h"
#include "chrome/browser/ui/views/status_icons/dbus_types.h" #include "components/dbus/menu/success_barrier_callback.h"
#include "chrome/browser/ui/views/status_icons/success_barrier_callback.h" #include "components/dbus/menu/types.h"
#include "components/dbus/dbus_thread_linux.h" #include "components/dbus/thread_linux/dbus_thread_linux.h"
#include "dbus/bus.h" #include "dbus/bus.h"
#include "dbus/exported_object.h" #include "dbus/exported_object.h"
#include "dbus/message.h" #include "dbus/message.h"
......
...@@ -4431,12 +4431,6 @@ test("unit_tests") { ...@@ -4431,12 +4431,6 @@ test("unit_tests") {
deps += [ "//chrome/browser/ui/libgtkui" ] deps += [ "//chrome/browser/ui/libgtkui" ]
} }
if (is_desktop_linux && use_dbus) {
sources += [
"../browser/ui/views/status_icons/success_barrier_callback_unittest.cc",
]
}
if (enable_service_discovery) { if (enable_service_discovery) {
sources += [ sources += [
"../browser/devtools/device/cast_device_provider_unittest.cc", "../browser/devtools/device/cast_device_provider_unittest.cc",
......
...@@ -377,6 +377,10 @@ test("components_unittests") { ...@@ -377,6 +377,10 @@ test("components_unittests") {
] ]
} }
if (use_dbus) {
deps += [ "//components/dbus/menu:unit_tests" ]
}
# No components should depend on Chrome. # No components should depend on Chrome.
assert_no_deps = [ "//chrome/*" ] assert_no_deps = [ "//chrome/*" ]
......
# Copyright 2019 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.
component("menu") {
sources = [
"menu.cc",
"menu.h",
"properties_interface.cc",
"properties_interface.h",
"types.cc",
"types.h",
]
defines = [ "IS_DBUS_IMPL" ]
deps = [
"//base:i18n",
"//dbus",
"//skia",
"//ui/base",
"//ui/gfx",
]
public_deps = [
":success_barrier_callback",
]
}
source_set("success_barrier_callback") {
sources = [
"success_barrier_callback.cc",
"success_barrier_callback.h",
]
defines = [ "IS_DBUS_IMPL" ]
deps = [
"//base",
]
}
source_set("unit_tests") {
testonly = true
sources = [
"success_barrier_callback_unittest.cc",
]
deps = [
":success_barrier_callback",
"//base",
"//testing/gtest",
]
}
include_rules = [
"+dbus",
"+ui/base",
]
thestig@chromium.org
thomasanderson@chromium.org
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#include "chrome/browser/ui/views/status_icons/dbus_menu.h" #include "components/dbus/menu/menu.h"
#include <limits> #include <limits>
#include <memory> #include <memory>
...@@ -14,9 +14,8 @@ ...@@ -14,9 +14,8 @@
#include "base/memory/scoped_refptr.h" #include "base/memory/scoped_refptr.h"
#include "base/stl_util.h" #include "base/stl_util.h"
#include "base/strings/utf_string_conversions.h" #include "base/strings/utf_string_conversions.h"
#include "chrome/browser/ui/views/status_icons/dbus_properties_interface.h" #include "components/dbus/menu/properties_interface.h"
#include "chrome/browser/ui/views/status_icons/dbus_types.h" #include "components/dbus/menu/success_barrier_callback.h"
#include "chrome/browser/ui/views/status_icons/success_barrier_callback.h"
#include "ui/base/accelerators/accelerator.h" #include "ui/base/accelerators/accelerator.h"
#include "ui/base/accelerators/menu_label_accelerator_util_linux.h" #include "ui/base/accelerators/menu_label_accelerator_util_linux.h"
#include "ui/base/models/menu_model.h" #include "ui/base/models/menu_model.h"
......
...@@ -2,17 +2,18 @@ ...@@ -2,17 +2,18 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#ifndef CHROME_BROWSER_UI_VIEWS_STATUS_ICONS_DBUS_MENU_H_ #ifndef COMPONENTS_DBUS_MENU_MENU_H_
#define CHROME_BROWSER_UI_VIEWS_STATUS_ICONS_DBUS_MENU_H_ #define COMPONENTS_DBUS_MENU_MENU_H_
#include <map> #include <map>
#include <memory> #include <memory>
#include <vector> #include <vector>
#include "base/callback_forward.h" #include "base/callback_forward.h"
#include "base/component_export.h"
#include "base/macros.h" #include "base/macros.h"
#include "base/memory/weak_ptr.h" #include "base/memory/weak_ptr.h"
#include "chrome/browser/ui/views/status_icons/dbus_types.h" #include "components/dbus/menu/types.h"
#include "dbus/bus.h" #include "dbus/bus.h"
#include "dbus/exported_object.h" #include "dbus/exported_object.h"
#include "dbus/message.h" #include "dbus/message.h"
...@@ -24,7 +25,7 @@ class MenuModel; ...@@ -24,7 +25,7 @@ class MenuModel;
class DbusPropertiesInterface; class DbusPropertiesInterface;
// Implements the com.canonical.dbusmenu interface. // Implements the com.canonical.dbusmenu interface.
class DbusMenu { class COMPONENT_EXPORT(DBUS) DbusMenu {
public: public:
using InitializedCallback = base::OnceCallback<void(bool success)>; using InitializedCallback = base::OnceCallback<void(bool success)>;
...@@ -135,4 +136,4 @@ class DbusMenu { ...@@ -135,4 +136,4 @@ class DbusMenu {
DISALLOW_COPY_AND_ASSIGN(DbusMenu); DISALLOW_COPY_AND_ASSIGN(DbusMenu);
}; };
#endif // CHROME_BROWSER_UI_VIEWS_STATUS_ICONS_DBUS_MENU_H_ #endif // COMPONENTS_DBUS_MENU_MENU_H_
...@@ -2,13 +2,13 @@ ...@@ -2,13 +2,13 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#include "chrome/browser/ui/views/status_icons/dbus_properties_interface.h" #include "components/dbus/menu/properties_interface.h"
#include <dbus/dbus-shared.h> #include <dbus/dbus-shared.h>
#include "base/bind.h" #include "base/bind.h"
#include "base/stl_util.h" #include "base/stl_util.h"
#include "chrome/browser/ui/views/status_icons/success_barrier_callback.h" #include "components/dbus/menu/success_barrier_callback.h"
#include "dbus/exported_object.h" #include "dbus/exported_object.h"
#include "dbus/message.h" #include "dbus/message.h"
......
...@@ -2,19 +2,20 @@ ...@@ -2,19 +2,20 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#ifndef CHROME_BROWSER_UI_VIEWS_STATUS_ICONS_DBUS_PROPERTIES_INTERFACE_H_ #ifndef COMPONENTS_DBUS_MENU_PROPERTIES_INTERFACE_H_
#define CHROME_BROWSER_UI_VIEWS_STATUS_ICONS_DBUS_PROPERTIES_INTERFACE_H_ #define COMPONENTS_DBUS_MENU_PROPERTIES_INTERFACE_H_
#include "base/callback_forward.h" #include "base/callback_forward.h"
#include "base/component_export.h"
#include "base/macros.h" #include "base/macros.h"
#include "base/memory/weak_ptr.h" #include "base/memory/weak_ptr.h"
#include "base/stl_util.h" #include "base/stl_util.h"
#include "chrome/browser/ui/views/status_icons/dbus_types.h" #include "components/dbus/menu/types.h"
#include "dbus/bus.h" #include "dbus/bus.h"
#include "dbus/exported_object.h" #include "dbus/exported_object.h"
// https://dbus.freedesktop.org/doc/dbus-specification.html#standard-interfaces-properties // https://dbus.freedesktop.org/doc/dbus-specification.html#standard-interfaces-properties
class DbusPropertiesInterface { class COMPONENT_EXPORT(DBUS) DbusPropertiesInterface {
public: public:
using InitializedCallback = base::OnceCallback<void(bool success)>; using InitializedCallback = base::OnceCallback<void(bool success)>;
...@@ -68,4 +69,4 @@ class DbusPropertiesInterface { ...@@ -68,4 +69,4 @@ class DbusPropertiesInterface {
DISALLOW_COPY_AND_ASSIGN(DbusPropertiesInterface); DISALLOW_COPY_AND_ASSIGN(DbusPropertiesInterface);
}; };
#endif // CHROME_BROWSER_UI_VIEWS_STATUS_ICONS_DBUS_PROPERTIES_INTERFACE_H_ #endif // COMPONENTS_DBUS_MENU_PROPERTIES_INTERFACE_H_
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#include "chrome/browser/ui/views/status_icons/success_barrier_callback.h" #include "components/dbus/menu/success_barrier_callback.h"
#include "base/bind.h" #include "base/bind.h"
#include "base/callback.h" #include "base/callback.h"
......
...@@ -2,20 +2,22 @@ ...@@ -2,20 +2,22 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#ifndef CHROME_BROWSER_UI_VIEWS_STATUS_ICONS_SUCCESS_BARRIER_CALLBACK_H_ #ifndef COMPONENTS_DBUS_MENU_SUCCESS_BARRIER_CALLBACK_H_
#define CHROME_BROWSER_UI_VIEWS_STATUS_ICONS_SUCCESS_BARRIER_CALLBACK_H_ #define COMPONENTS_DBUS_MENU_SUCCESS_BARRIER_CALLBACK_H_
#include <cstddef> #include <cstddef>
#include "base/callback_forward.h" #include "base/callback_forward.h"
#include "base/component_export.h"
// A callback wrapper that must be called |num_calls| times with an argument of // A callback wrapper that must be called |num_calls| times with an argument of
// true (indicates success) for |done_callback| to be called with true. If the // true (indicates success) for |done_callback| to be called with true. If the
// wrapper is called with false, |done_callback| is immediately run with an // wrapper is called with false, |done_callback| is immediately run with an
// argument of false. Further calls after |done_callback| has already been run // argument of false. Further calls after |done_callback| has already been run
// will have no effect. // will have no effect.
COMPONENT_EXPORT(DBUS)
base::RepeatingCallback<void(bool)> SuccessBarrierCallback( base::RepeatingCallback<void(bool)> SuccessBarrierCallback(
size_t num_calls, size_t num_calls,
base::OnceCallback<void(bool)> done_callback); base::OnceCallback<void(bool)> done_callback);
#endif // CHROME_BROWSER_UI_VIEWS_STATUS_ICONS_SUCCESS_BARRIER_CALLBACK_H_ #endif // COMPONENTS_DBUS_MENU_SUCCESS_BARRIER_CALLBACK_H_
...@@ -2,10 +2,10 @@ ...@@ -2,10 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#include "chrome/browser/ui/views/status_icons/success_barrier_callback.h" #include "components/dbus/menu/success_barrier_callback.h"
#include "base/bind.h" #include "base/bind.h"
#include "chrome/browser/ui/views/status_icons/status_icon_linux_dbus.h" #include "base/callback.h"
#include "testing/gtest/include/gtest/gtest.h" #include "testing/gtest/include/gtest/gtest.h"
namespace { namespace {
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#include "chrome/browser/ui/views/status_icons/dbus_types.h" #include "components/dbus/menu/types.h"
#include "dbus/message.h" #include "dbus/message.h"
#include "dbus/object_path.h" #include "dbus/object_path.h"
......
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#ifndef CHROME_BROWSER_UI_VIEWS_STATUS_ICONS_DBUS_TYPES_H_ #ifndef COMPONENTS_DBUS_MENU_TYPES_H_
#define CHROME_BROWSER_UI_VIEWS_STATUS_ICONS_DBUS_TYPES_H_ #define COMPONENTS_DBUS_MENU_TYPES_H_
#include <stdint.h> #include <stdint.h>
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
#include <type_traits> #include <type_traits>
#include <utility> #include <utility>
#include "base/component_export.h"
#include "base/memory/ref_counted_memory.h" #include "base/memory/ref_counted_memory.h"
#include "dbus/message.h" #include "dbus/message.h"
...@@ -60,7 +61,7 @@ std::string GetDbusTypeTupleSignature() { ...@@ -60,7 +61,7 @@ std::string GetDbusTypeTupleSignature() {
} // namespace detail } // namespace detail
class DbusType { class COMPONENT_EXPORT(DBUS) DbusType {
public: public:
virtual ~DbusType(); virtual ~DbusType();
...@@ -85,7 +86,7 @@ class DbusTypeImpl : public DbusType { ...@@ -85,7 +86,7 @@ class DbusTypeImpl : public DbusType {
std::string GetSignatureDynamic() const override { return T::GetSignature(); } std::string GetSignatureDynamic() const override { return T::GetSignature(); }
}; };
class DbusBoolean : public DbusTypeImpl<DbusBoolean> { class COMPONENT_EXPORT(DBUS) DbusBoolean : public DbusTypeImpl<DbusBoolean> {
public: public:
explicit DbusBoolean(bool value); explicit DbusBoolean(bool value);
DbusBoolean(DbusBoolean&& other); DbusBoolean(DbusBoolean&& other);
...@@ -100,7 +101,7 @@ class DbusBoolean : public DbusTypeImpl<DbusBoolean> { ...@@ -100,7 +101,7 @@ class DbusBoolean : public DbusTypeImpl<DbusBoolean> {
bool value_; bool value_;
}; };
class DbusInt32 : public DbusTypeImpl<DbusInt32> { class COMPONENT_EXPORT(DBUS) DbusInt32 : public DbusTypeImpl<DbusInt32> {
public: public:
explicit DbusInt32(int32_t value); explicit DbusInt32(int32_t value);
DbusInt32(DbusInt32&& other); DbusInt32(DbusInt32&& other);
...@@ -115,7 +116,7 @@ class DbusInt32 : public DbusTypeImpl<DbusInt32> { ...@@ -115,7 +116,7 @@ class DbusInt32 : public DbusTypeImpl<DbusInt32> {
int32_t value_; int32_t value_;
}; };
class DbusUint32 : public DbusTypeImpl<DbusUint32> { class COMPONENT_EXPORT(DBUS) DbusUint32 : public DbusTypeImpl<DbusUint32> {
public: public:
explicit DbusUint32(uint32_t value); explicit DbusUint32(uint32_t value);
DbusUint32(DbusUint32&& other); DbusUint32(DbusUint32&& other);
...@@ -130,7 +131,7 @@ class DbusUint32 : public DbusTypeImpl<DbusUint32> { ...@@ -130,7 +131,7 @@ class DbusUint32 : public DbusTypeImpl<DbusUint32> {
uint32_t value_; uint32_t value_;
}; };
class DbusString : public DbusTypeImpl<DbusString> { class COMPONENT_EXPORT(DBUS) DbusString : public DbusTypeImpl<DbusString> {
public: public:
explicit DbusString(const std::string& value); explicit DbusString(const std::string& value);
DbusString(DbusString&& other); DbusString(DbusString&& other);
...@@ -145,7 +146,8 @@ class DbusString : public DbusTypeImpl<DbusString> { ...@@ -145,7 +146,8 @@ class DbusString : public DbusTypeImpl<DbusString> {
std::string value_; std::string value_;
}; };
class DbusObjectPath : public DbusTypeImpl<DbusObjectPath> { class COMPONENT_EXPORT(DBUS) DbusObjectPath
: public DbusTypeImpl<DbusObjectPath> {
public: public:
explicit DbusObjectPath(const dbus::ObjectPath& value); explicit DbusObjectPath(const dbus::ObjectPath& value);
DbusObjectPath(DbusObjectPath&& other); DbusObjectPath(DbusObjectPath&& other);
...@@ -160,7 +162,7 @@ class DbusObjectPath : public DbusTypeImpl<DbusObjectPath> { ...@@ -160,7 +162,7 @@ class DbusObjectPath : public DbusTypeImpl<DbusObjectPath> {
dbus::ObjectPath value_; dbus::ObjectPath value_;
}; };
class DbusVariant : public DbusTypeImpl<DbusVariant> { class COMPONENT_EXPORT(DBUS) DbusVariant : public DbusTypeImpl<DbusVariant> {
public: public:
DbusVariant(); DbusVariant();
explicit DbusVariant(std::unique_ptr<DbusType> value); explicit DbusVariant(std::unique_ptr<DbusType> value);
...@@ -186,7 +188,7 @@ DbusVariant MakeDbusVariant(T t) { ...@@ -186,7 +188,7 @@ DbusVariant MakeDbusVariant(T t) {
} }
template <typename T> template <typename T>
class DbusArray : public DbusTypeImpl<DbusArray<T>> { class COMPONENT_EXPORT(DBUS) DbusArray : public DbusTypeImpl<DbusArray<T>> {
public: public:
explicit DbusArray(std::vector<T>&& value) : value_(std::move(value)) {} explicit DbusArray(std::vector<T>&& value) : value_(std::move(value)) {}
DbusArray(DbusArray<T>&& other) = default; DbusArray(DbusArray<T>&& other) = default;
...@@ -224,7 +226,8 @@ auto MakeDbusArray(Ts&&... ts) { ...@@ -224,7 +226,8 @@ auto MakeDbusArray(Ts&&... ts) {
// (If DbusByte was defined) this is the same as DbusArray<DbusByte>. This // (If DbusByte was defined) this is the same as DbusArray<DbusByte>. This
// class avoids having to create a bunch of heavy virtual objects just to wrap // class avoids having to create a bunch of heavy virtual objects just to wrap
// individual bytes. // individual bytes.
class DbusByteArray : public DbusTypeImpl<DbusByteArray> { class COMPONENT_EXPORT(DBUS) DbusByteArray
: public DbusTypeImpl<DbusByteArray> {
public: public:
DbusByteArray(); DbusByteArray();
explicit DbusByteArray(scoped_refptr<base::RefCountedMemory> value); explicit DbusByteArray(scoped_refptr<base::RefCountedMemory> value);
...@@ -241,7 +244,8 @@ class DbusByteArray : public DbusTypeImpl<DbusByteArray> { ...@@ -241,7 +244,8 @@ class DbusByteArray : public DbusTypeImpl<DbusByteArray> {
}; };
template <typename... Ts> template <typename... Ts>
class DbusStruct : public DbusTypeImpl<DbusStruct<Ts...>> { class COMPONENT_EXPORT(DBUS) DbusStruct
: public DbusTypeImpl<DbusStruct<Ts...>> {
public: public:
explicit DbusStruct(Ts&&... ts) : value_(std::move(ts)...) {} explicit DbusStruct(Ts&&... ts) : value_(std::move(ts)...) {}
DbusStruct(DbusStruct<Ts...>&& other) = default; DbusStruct(DbusStruct<Ts...>&& other) = default;
...@@ -269,7 +273,8 @@ auto MakeDbusStruct(Ts&&... ts) { ...@@ -269,7 +273,8 @@ auto MakeDbusStruct(Ts&&... ts) {
} }
template <typename K, typename V> template <typename K, typename V>
class DbusDictEntry : public DbusTypeImpl<DbusDictEntry<K, V>> { class COMPONENT_EXPORT(DBUS) DbusDictEntry
: public DbusTypeImpl<DbusDictEntry<K, V>> {
public: public:
DbusDictEntry(K&& k, V&& v) : k_(std::move(k)), v_(std::move(v)) {} DbusDictEntry(K&& k, V&& v) : k_(std::move(k)), v_(std::move(v)) {}
DbusDictEntry(DbusDictEntry<K, V>&& other) = default; DbusDictEntry(DbusDictEntry<K, V>&& other) = default;
...@@ -298,4 +303,4 @@ auto MakeDbusDictEntry(K&& k, V&& v) { ...@@ -298,4 +303,4 @@ auto MakeDbusDictEntry(K&& k, V&& v) {
return DbusDictEntry<K, V>(std::move(k), std::move(v)); return DbusDictEntry<K, V>(std::move(k), std::move(v));
} }
#endif // CHROME_BROWSER_UI_VIEWS_STATUS_ICONS_DBUS_TYPES_H_ #endif // COMPONENTS_DBUS_MENU_TYPES_H_
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
# Use of this source code is governed by a BSD-style license that can be # Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file. # found in the LICENSE file.
component("dbus_thread_linux") { component("thread_linux") {
sources = [ sources = [
"dbus_thread_linux.cc", "dbus_thread_linux.cc",
"dbus_thread_linux.h", "dbus_thread_linux.h",
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#include "components/dbus/dbus_thread_linux.h" #include "components/dbus/thread_linux/dbus_thread_linux.h"
#include "base/task/lazy_task_runner.h" #include "base/task/lazy_task_runner.h"
......
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#ifndef COMPONENTS_DBUS_DBUS_THREAD_LINUX_H_ #ifndef COMPONENTS_DBUS_THREAD_LINUX_DBUS_THREAD_LINUX_H_
#define COMPONENTS_DBUS_DBUS_THREAD_LINUX_H_ #define COMPONENTS_DBUS_THREAD_LINUX_DBUS_THREAD_LINUX_H_
#include "base/component_export.h" #include "base/component_export.h"
#include "base/memory/ref_counted.h" #include "base/memory/ref_counted.h"
...@@ -26,4 +26,4 @@ scoped_refptr<base::SingleThreadTaskRunner> GetTaskRunner(); ...@@ -26,4 +26,4 @@ scoped_refptr<base::SingleThreadTaskRunner> GetTaskRunner();
} // namespace dbus_thread_linux } // namespace dbus_thread_linux
#endif // COMPONENTS_DBUS_DBUS_THREAD_LINUX_H_ #endif // COMPONENTS_DBUS_THREAD_LINUX_DBUS_THREAD_LINUX_H_
...@@ -15,7 +15,7 @@ component("mpris") { ...@@ -15,7 +15,7 @@ component("mpris") {
deps = [ deps = [
"//base", "//base",
"//components/dbus:dbus_thread_linux", "//components/dbus/thread_linux",
"//dbus", "//dbus",
] ]
} }
...@@ -29,7 +29,7 @@ source_set("unit_tests") { ...@@ -29,7 +29,7 @@ source_set("unit_tests") {
":mpris", ":mpris",
"//base", "//base",
"//base/test:test_support", "//base/test:test_support",
"//components/dbus:dbus_thread_linux", "//components/dbus/thread_linux",
"//dbus", "//dbus",
"//dbus:test_support", "//dbus:test_support",
"//testing/gmock", "//testing/gmock",
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
#include "base/process/process.h" #include "base/process/process.h"
#include "base/unguessable_token.h" #include "base/unguessable_token.h"
#include "base/values.h" #include "base/values.h"
#include "components/dbus/dbus_thread_linux.h" #include "components/dbus/thread_linux/dbus_thread_linux.h"
#include "dbus/bus.h" #include "dbus/bus.h"
#include "dbus/exported_object.h" #include "dbus/exported_object.h"
#include "dbus/message.h" #include "dbus/message.h"
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
#include "base/run_loop.h" #include "base/run_loop.h"
#include "base/strings/utf_string_conversions.h" #include "base/strings/utf_string_conversions.h"
#include "base/test/scoped_task_environment.h" #include "base/test/scoped_task_environment.h"
#include "components/dbus/dbus_thread_linux.h" #include "components/dbus/thread_linux/dbus_thread_linux.h"
#include "dbus/message.h" #include "dbus/message.h"
#include "dbus/mock_bus.h" #include "dbus/mock_bus.h"
#include "dbus/mock_exported_object.h" #include "dbus/mock_exported_object.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