Index: components/arc/test/fake_arc_bridge_service.h |
diff --git a/components/arc/test/fake_arc_bridge_service.h b/components/arc/test/fake_arc_bridge_service.h |
index ef4e20d0c8fa8a3e6f23e114ac3264a8ac6cc0bf..d9e892a2ff1c048a892868bb3e4cd644312ae0bf 100644 |
--- a/components/arc/test/fake_arc_bridge_service.h |
+++ b/components/arc/test/fake_arc_bridge_service.h |
@@ -9,108 +9,34 @@ |
#include <vector> |
#include "base/macros.h" |
-#include "base/memory/scoped_vector.h" |
#include "components/arc/arc_bridge_service.h" |
namespace arc { |
class FakeArcBridgeService : public ArcBridgeService { |
public: |
- class Request { |
- public: |
- Request(const std::string& package, const std::string& activity) |
- : package_(package), |
- activity_(activity) { |
- } |
- |
- ~Request() { |
- } |
- |
- const std::string& package() const { return package_; } |
- |
- const std::string& activity() const { return activity_; } |
- |
- bool IsForApp(const AppInfo& app_info) const { |
- return package_ == app_info.package && activity_ == app_info.activity; |
- } |
- |
- private: |
- std::string package_; |
- std::string activity_; |
- |
- DISALLOW_COPY_AND_ASSIGN(Request); |
- }; |
- |
- class IconRequest : public Request { |
- public: |
- IconRequest(const std::string& package, |
- const std::string& activity, |
- ScaleFactor scale_factor) |
- : Request(package, activity), |
- scale_factor_(scale_factor) { |
- } |
- |
- ~IconRequest() { |
- } |
- |
- int scale_factor() const { return scale_factor_; } |
- |
- private: |
- int scale_factor_; |
- |
- DISALLOW_COPY_AND_ASSIGN(IconRequest); |
- }; |
- |
FakeArcBridgeService(); |
~FakeArcBridgeService() override; |
+ // Mojo interface setters. |
+ void SetAppInstance(AppInstancePtr instance_ptr); |
+ void SetInputInstance(InputInstancePtr instance_ptr); |
+ void SetNotificationsInstance(NotificationsInstancePtr instance_ptr); |
+ void SetPowerInstance(PowerInstancePtr instance_ptr); |
+ void SetProcessListInstance(ProcessListInstancePtr instance_ptr); |
+ |
// arc::ArcBridgeService |
void DetectAvailability() override; |
void HandleStartup() override; |
void Shutdown() override; |
- bool RegisterInputDevice(const std::string& name, |
- const std::string& device_type, |
- base::ScopedFD fd) override; |
- bool RefreshAppList() override; |
- bool LaunchApp(const std::string& package, |
- const std::string& activity) override; |
- bool RequestAppIcon(const std::string& package, |
- const std::string& activity, |
- ScaleFactor scale_factor) override; |
- bool SendNotificationEventToAndroid(const std::string& key, |
- ArcNotificationEvent event) override; |
- |
- int refresh_app_list_count() const { return refresh_app_list_count_; } |
- |
- const ScopedVector<Request>& launch_requests() const { |
- return launch_requests_; |
- } |
- |
- const ScopedVector<IconRequest>& icon_requests() const { |
- return icon_requests_; |
- } |
void SetReady(); |
void SetStopped(); |
bool HasObserver(const Observer* observer); |
- bool HasAppObserver(const AppObserver* observer); |
- |
- void SendRefreshAppList(const std::vector<AppInfo>& apps); |
- |
- bool GenerateAndSendIcon(const AppInfo& app, |
- ScaleFactor scale_factor, |
- std::string* png_data); |
private: |
- // Number of RefreshAppList calls. |
- int refresh_app_list_count_ = 0; |
- // Keeps information about launch requests. |
- ScopedVector<Request> launch_requests_; |
- // Keeps information about icon load requests. |
- ScopedVector<IconRequest> icon_requests_; |
- |
DISALLOW_COPY_AND_ASSIGN(FakeArcBridgeService); |
}; |