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

Side by Side Diff: chrome/browser/ui/app_list/arc/arc_app_item.h

Issue 1507873006: Implement base class for app_list items. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nits addressed Created 5 years 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 | « no previous file | chrome/browser/ui/app_list/arc/arc_app_item.cc » ('j') | 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 #ifndef CHROME_BROWSER_UI_APP_LIST_ARC_ARC_APP_ITEM_H_ 5 #ifndef CHROME_BROWSER_UI_APP_LIST_ARC_ARC_APP_ITEM_H_
6 #define CHROME_BROWSER_UI_APP_LIST_ARC_ARC_APP_ITEM_H_ 6 #define CHROME_BROWSER_UI_APP_LIST_ARC_ARC_APP_ITEM_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
11 #include "chrome/browser/ui/app_list/app_list_syncable_service.h"
12 #include "chrome/browser/ui/app_list/arc/arc_app_icon.h" 11 #include "chrome/browser/ui/app_list/arc/arc_app_icon.h"
12 #include "chrome/browser/ui/app_list/chrome_app_list_item.h"
13 #include "ui/app_list/app_list_item.h" 13 #include "ui/app_list/app_list_item.h"
14 14
15 namespace content { 15 class Profile;
16 class BrowserContext;
17 } // content
18 16
19 // ArcAppItem represents an ARC app in app list. 17 // ArcAppItem represents an ARC app in app list.
20 class ArcAppItem : public app_list::AppListItem, 18 class ArcAppItem : public ChromeAppListItem,
21 public ArcAppIcon::Observer { 19 public ArcAppIcon::Observer {
22 public: 20 public:
23 static const char kItemType[]; 21 static const char kItemType[];
24 22
25 ArcAppItem(content::BrowserContext* context, 23 ArcAppItem(Profile* profile,
26 const app_list::AppListSyncableService::SyncItem* sync_item, 24 const app_list::AppListSyncableService::SyncItem* sync_item,
27 const std::string& id, 25 const std::string& id,
28 const std::string& name, 26 const std::string& name,
29 bool ready); 27 bool ready);
30 ~ArcAppItem() override; 28 ~ArcAppItem() override;
31 29
32 void SetName(const std::string& name); 30 void SetName(const std::string& name);
33 31
34 void Activate(int event_flags) override; 32 void Activate(int event_flags) override;
35 const char* GetItemType() const override; 33 const char* GetItemType() const override;
36 34
37 ArcAppIcon* arc_app_icon() { return arc_app_icon_.get(); } 35 ArcAppIcon* arc_app_icon() { return arc_app_icon_.get(); }
38 36
39 bool ready() const { return ready_; } 37 bool ready() const { return ready_; }
40 38
41 void SetReady(bool ready); 39 void SetReady(bool ready);
42 40
43 // ArcAppIcon::Observer 41 // ArcAppIcon::Observer
44 void OnIconUpdated() override; 42 void OnIconUpdated() override;
45 43
46 private: 44 private:
47 // Updates the app item's icon, if necessary making it gray. 45 // Updates the app item's icon, if necessary making it gray.
48 void UpdateIcon(); 46 void UpdateIcon();
49 47
50 content::BrowserContext* context_; 48 // Set the position from the ordering.
49 void UpdatePositionFromOrdering();
50
51 bool ready_; 51 bool ready_;
52 scoped_ptr<ArcAppIcon> arc_app_icon_; 52 scoped_ptr<ArcAppIcon> arc_app_icon_;
53 53
54 DISALLOW_COPY_AND_ASSIGN(ArcAppItem); 54 DISALLOW_COPY_AND_ASSIGN(ArcAppItem);
55 }; 55 };
56 56
57 #endif // CHROME_BROWSER_UI_APP_LIST_ARC_ARC_APP_ITEM_H_ 57 #endif // CHROME_BROWSER_UI_APP_LIST_ARC_ARC_APP_ITEM_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/app_list/arc/arc_app_item.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698