| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "components/arc/test/fake_app_instance.h" | 5 #include "components/arc/test/fake_app_instance.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 const std::vector<mojom::ShortcutInfo>& shortcuts) { | 67 const std::vector<mojom::ShortcutInfo>& shortcuts) { |
| 68 for (auto& shortcut : shortcuts) { | 68 for (auto& shortcut : shortcuts) { |
| 69 app_host_->OnInstallShortcut(shortcut.Clone()); | 69 app_host_->OnInstallShortcut(shortcut.Clone()); |
| 70 } | 70 } |
| 71 } | 71 } |
| 72 | 72 |
| 73 void FakeAppInstance::SendInstallShortcut(const mojom::ShortcutInfo& shortcut) { | 73 void FakeAppInstance::SendInstallShortcut(const mojom::ShortcutInfo& shortcut) { |
| 74 app_host_->OnInstallShortcut(shortcut.Clone()); | 74 app_host_->OnInstallShortcut(shortcut.Clone()); |
| 75 } | 75 } |
| 76 | 76 |
| 77 void FakeAppInstance::SendAppAdded(const mojom::AppInfo& app) { | |
| 78 app_host_->OnAppAdded(mojom::AppInfo::From(app)); | |
| 79 } | |
| 80 | |
| 81 void FakeAppInstance::SendTaskCreated(int32_t taskId, | 77 void FakeAppInstance::SendTaskCreated(int32_t taskId, |
| 82 const mojom::AppInfo& app) { | 78 const mojom::AppInfo& app) { |
| 83 app_host_->OnTaskCreated(taskId, app.package_name, app.activity, app.name); | 79 app_host_->OnTaskCreated(taskId, app.package_name, app.activity); |
| 84 } | 80 } |
| 85 | 81 |
| 86 void FakeAppInstance::SendTaskDestroyed(int32_t taskId) { | 82 void FakeAppInstance::SendTaskDestroyed(int32_t taskId) { |
| 87 app_host_->OnTaskDestroyed(taskId); | 83 app_host_->OnTaskDestroyed(taskId); |
| 88 } | 84 } |
| 89 | 85 |
| 90 bool FakeAppInstance::GenerateAndSendIcon(const mojom::AppInfo& app, | 86 bool FakeAppInstance::GenerateAndSendIcon(const mojom::AppInfo& app, |
| 91 mojom::ScaleFactor scale_factor, | 87 mojom::ScaleFactor scale_factor, |
| 92 std::string* png_data_as_string) { | 88 std::string* png_data_as_string) { |
| 93 if (!GetFakeIcon(scale_factor, png_data_as_string)) { | 89 if (!GetFakeIcon(scale_factor, png_data_as_string)) { |
| (...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 246 | 242 |
| 247 std::string png_data_as_string; | 243 std::string png_data_as_string; |
| 248 if (GetFakeIcon(scale_factor, &png_data_as_string)) { | 244 if (GetFakeIcon(scale_factor, &png_data_as_string)) { |
| 249 callback.Run(mojo::Array<uint8_t>::From(png_data_as_string)); | 245 callback.Run(mojo::Array<uint8_t>::From(png_data_as_string)); |
| 250 } | 246 } |
| 251 } | 247 } |
| 252 | 248 |
| 253 void FakeAppInstance::RemoveCachedIcon(const mojo::String& icon_resource_id) {} | 249 void FakeAppInstance::RemoveCachedIcon(const mojo::String& icon_resource_id) {} |
| 254 | 250 |
| 255 } // namespace arc | 251 } // namespace arc |
| OLD | NEW |