Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(14)

Side by Side Diff: components/arc/test/fake_app_instance.cc

Issue 2858703002: arc: Support UNINSTALL_SHORTCUT (Closed)
Patch Set: typo fix Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « components/arc/test/fake_app_instance.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 <utility> 10 #include <utility>
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 const std::string& package_name, 71 const std::string& package_name,
72 const std::vector<mojom::AppInfo>& apps) { 72 const std::vector<mojom::AppInfo>& apps) {
73 std::vector<mojom::AppInfoPtr> v; 73 std::vector<mojom::AppInfoPtr> v;
74 for (const auto& app : apps) 74 for (const auto& app : apps)
75 v.emplace_back(app.Clone()); 75 v.emplace_back(app.Clone());
76 app_host_->OnPackageAppListRefreshed(package_name, std::move(v)); 76 app_host_->OnPackageAppListRefreshed(package_name, std::move(v));
77 } 77 }
78 78
79 void FakeAppInstance::SendInstallShortcuts( 79 void FakeAppInstance::SendInstallShortcuts(
80 const std::vector<mojom::ShortcutInfo>& shortcuts) { 80 const std::vector<mojom::ShortcutInfo>& shortcuts) {
81 for (auto& shortcut : shortcuts) { 81 for (auto& shortcut : shortcuts)
82 app_host_->OnInstallShortcut(shortcut.Clone()); 82 SendInstallShortcut(shortcut);
83 }
84 } 83 }
85 84
86 void FakeAppInstance::SendInstallShortcut(const mojom::ShortcutInfo& shortcut) { 85 void FakeAppInstance::SendInstallShortcut(const mojom::ShortcutInfo& shortcut) {
87 app_host_->OnInstallShortcut(shortcut.Clone()); 86 app_host_->OnInstallShortcut(shortcut.Clone());
88 } 87 }
89 88
89 void FakeAppInstance::SendUninstallShortcut(const std::string& package_name,
90 const std::string& intent_uri) {
91 app_host_->OnUninstallShortcut(package_name, intent_uri);
92 }
93
90 void FakeAppInstance::SendAppAdded(const mojom::AppInfo& app) { 94 void FakeAppInstance::SendAppAdded(const mojom::AppInfo& app) {
91 app_host_->OnAppAddedDeprecated(mojom::AppInfo::From(app)); 95 app_host_->OnAppAddedDeprecated(mojom::AppInfo::From(app));
92 } 96 }
93 97
94 void FakeAppInstance::SendTaskCreated(int32_t taskId, 98 void FakeAppInstance::SendTaskCreated(int32_t taskId,
95 const mojom::AppInfo& app, 99 const mojom::AppInfo& app,
96 const std::string& intent) { 100 const std::string& intent) {
97 app_host_->OnTaskCreated(taskId, 101 app_host_->OnTaskCreated(taskId,
98 app.package_name, 102 app.package_name,
99 app.activity, 103 app.activity,
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
268 std::string png_data_as_string; 272 std::string png_data_as_string;
269 if (GetFakeIcon(scale_factor, &png_data_as_string)) { 273 if (GetFakeIcon(scale_factor, &png_data_as_string)) {
270 callback.Run(std::vector<uint8_t>(png_data_as_string.begin(), 274 callback.Run(std::vector<uint8_t>(png_data_as_string.begin(),
271 png_data_as_string.end())); 275 png_data_as_string.end()));
272 } 276 }
273 } 277 }
274 278
275 void FakeAppInstance::RemoveCachedIcon(const std::string& icon_resource_id) {} 279 void FakeAppInstance::RemoveCachedIcon(const std::string& icon_resource_id) {}
276 280
277 } // namespace arc 281 } // namespace arc
OLDNEW
« no previous file with comments | « components/arc/test/fake_app_instance.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698