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

Side by Side Diff: components/arc/test/fake_arc_bridge_service.h

Issue 1413153007: arc-app-launcher: Minimal support for ARC app launcher. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nit comment addressed Created 5 years, 1 month 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
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef COMPONENTS_ARC_TEST_FAKE_ARC_BRIDGE_SERVICE_H
xiyuan 2015/11/19 03:13:49 nit: end it with "_", i.e. COMPONENTS_ARC_TEST_FAK
khmel1 2015/11/19 17:11:42 Done.
6 #define COMPONENTS_ARC_TEST_FAKE_ARC_BRIDGE_SERVICE_H
7
8 #include <string>
9 #include <vector>
10
11 #include "base/macros.h"
12 #include "components/arc/arc_bridge_service.h"
13 #include "ui/base/layout.h"
14
15 class FakeArcBridgeService : public arc::ArcBridgeService {
16 public:
17 struct AppInfo {
elijahtaylor (use chromium) 2015/11/19 05:52:00 I was a little confused by this at first because i
khmel1 2015/11/19 17:11:42 Good point TestAppInfo sounds better
18 std::string id() const;
19
20 const char* name;
21 const char* package;
22 const char* activity;
23 };
24
25 struct IconRequest {
26 std::string package;
27 std::string activity;
28 int scale_factor;
29 };
30
31 FakeArcBridgeService();
32 ~FakeArcBridgeService() override;
33
34 // arc::ArcBridgeService
35 void HandleStartup() override;
36 void Shutdown() override;
37 bool RegisterInputDevice(const std::string& name,
38 const std::string& device_type,
39 base::ScopedFD fd) override;
40 bool RefreshApps() override;
41 bool LaunchApp(const std::string& package,CHROME_BROWSER_UI_APP_LIST_TEST_FAKE _ARC_BRIDGE_SERVICE_FOR_APP_LAUNCHER_H_
elijahtaylor (use chromium) 2015/11/19 05:52:00 looks like an unintentional paste accident
khmel1 2015/11/19 17:11:42 Done.
42 const std::string& activity) override;
43 bool RequestIcon(const std::string& package,
44 const std::string& activity,
45 int scale_factor) override;
46
47 int refresh_apps_count() const { return refresh_apps_count_; }
48
49 const std::vector<std::string>& launch_requests() const {
50 return launch_requests_;
51 }
52
53 const std::vector<IconRequest>& icon_requests() const {
54 return icon_requests_;
55 }
56
57 void SetReady();
58
59 void SetStopped();
60
61 bool HasObserver(const Observer* observer) const;
62
63 void SendRefreshApps(size_t size, const AppInfo* apps);
64
65 bool GenerateAndSendIcon(const AppInfo& app,
66 ui::ScaleFactor scale_factor,
67 std::vector<unsigned char>* png_data);
68
69 private:
70 // Number of RefreshApps calls.
71 int refresh_apps_count_;
72 // Keeps information about launch requests.
73 std::vector<std::string> launch_requests_;
74 // Keeps information about icon load requests.
75 std::vector<IconRequest> icon_requests_;
76
77 DISALLOW_COPY_AND_ASSIGN(FakeArcBridgeService);
78 };
79
80 #endif // COMPONENTS_ARC_TEST_FAKE_ARC_BRIDGE_SERVICE_H
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698