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

Side by Side Diff: chrome/browser/ui/app_list/extension_app_item.h

Issue 17038002: Separate the NTP app ordering from the app list app ordering (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: revert lazy initialzation Created 7 years, 3 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_EXTENSION_APP_ITEM_H_ 5 #ifndef CHROME_BROWSER_UI_APP_LIST_EXTENSION_APP_ITEM_H_
6 #define CHROME_BROWSER_UI_APP_LIST_EXTENSION_APP_ITEM_H_ 6 #define CHROME_BROWSER_UI_APP_LIST_EXTENSION_APP_ITEM_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 27 matching lines...) Expand all
38 const std::string& extension_id, 38 const std::string& extension_id,
39 AppListControllerDelegate* controller, 39 AppListControllerDelegate* controller,
40 const std::string& extension_name, 40 const std::string& extension_name,
41 const gfx::ImageSkia& installing_icon, 41 const gfx::ImageSkia& installing_icon,
42 bool is_platform_app); 42 bool is_platform_app);
43 virtual ~ExtensionAppItem(); 43 virtual ~ExtensionAppItem();
44 44
45 // Reload the title and icon from the underlying extension. 45 // Reload the title and icon from the underlying extension.
46 void Reload(); 46 void Reload();
47 47
48 syncer::StringOrdinal GetPageOrdinal() const;
49 syncer::StringOrdinal GetAppLaunchOrdinal() const;
50
51 // Update page and app launcher ordinals to put the app in between |prev| and 48 // Update page and app launcher ordinals to put the app in between |prev| and
52 // |next|. Note that |prev| and |next| could be NULL when the app is put at 49 // |next|. Note that |prev| and |next| could be NULL when the app is put at
53 // the beginning or at the end. 50 // the beginning or at the end.
54 void Move(const ExtensionAppItem* prev, const ExtensionAppItem* next); 51 void Move(const ExtensionAppItem* prev, const ExtensionAppItem* next);
55 52
56 // Updates the app item's icon, if necessary adding an overlay and/or making 53 // Updates the app item's icon, if necessary adding an overlay and/or making
57 // it gray. 54 // it gray.
58 void UpdateIcon(); 55 void UpdateIcon();
59 56
57 // Returns true if this ExtensionAppItem precedes |item| in the app list app
58 // ordering. The item's extension id must be in the app list ordering.
59 bool Precedes(const ExtensionAppItem* item) const;
60
61 // Returns true if thie ExtensionAppItem's extension id is in the app list app
62 // ordering.
63 bool ExistsInSorting();
64
60 const std::string& extension_id() const { return extension_id_; } 65 const std::string& extension_id() const { return extension_id_; }
61 66
62 private: 67 private:
63 // Gets extension associated with this model. Returns NULL if extension 68 // Gets extension associated with this model. Returns NULL if extension
64 // no longer exists. 69 // no longer exists.
65 const extensions::Extension* GetExtension() const; 70 const extensions::Extension* GetExtension() const;
66 71
67 // Loads extension icon. 72 // Loads extension icon.
68 void LoadImage(const extensions::Extension* extension); 73 void LoadImage(const extensions::Extension* extension);
69 74
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 // Icon for the extension if we can't access the installed extension. 112 // Icon for the extension if we can't access the installed extension.
108 gfx::ImageSkia installing_icon_; 113 gfx::ImageSkia installing_icon_;
109 114
110 // Whether or not this app is a platform app. 115 // Whether or not this app is a platform app.
111 bool is_platform_app_; 116 bool is_platform_app_;
112 117
113 DISALLOW_COPY_AND_ASSIGN(ExtensionAppItem); 118 DISALLOW_COPY_AND_ASSIGN(ExtensionAppItem);
114 }; 119 };
115 120
116 #endif // CHROME_BROWSER_UI_APP_LIST_EXTENSION_APP_ITEM_H_ 121 #endif // CHROME_BROWSER_UI_APP_LIST_EXTENSION_APP_ITEM_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698