| OLD | NEW |
| 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" |
| 11 #include "chrome/browser/extensions/extension_icon_image.h" | 11 #include "chrome/browser/extensions/extension_icon_image.h" |
| 12 #include "chrome/browser/ui/app_list/chrome_app_list_item.h" | 12 #include "chrome/browser/ui/app_list/chrome_app_list_item.h" |
| 13 #include "sync/api/string_ordinal.h" | 13 #include "sync/api/string_ordinal.h" |
| 14 #include "ui/base/models/simple_menu_model.h" | 14 #include "ui/base/models/simple_menu_model.h" |
| 15 | 15 |
| 16 class AppListController; | 16 class AppListControllerDelegate; |
| 17 class ExtensionResource; | 17 class ExtensionResource; |
| 18 class Profile; | 18 class Profile; |
| 19 class SkBitmap; | 19 class SkBitmap; |
| 20 | 20 |
| 21 namespace extensions { | 21 namespace extensions { |
| 22 class ContextMenuMatcher; | 22 class ContextMenuMatcher; |
| 23 class Extension; | 23 class Extension; |
| 24 } | 24 } |
| 25 | 25 |
| 26 // ExtensionAppItem represents an extension app in app list. | 26 // ExtensionAppItem represents an extension app in app list. |
| 27 class ExtensionAppItem : public ChromeAppListItem, | 27 class ExtensionAppItem : public ChromeAppListItem, |
| 28 public extensions::IconImage::Observer, | 28 public extensions::IconImage::Observer, |
| 29 public ui::SimpleMenuModel::Delegate { | 29 public ui::SimpleMenuModel::Delegate { |
| 30 public: | 30 public: |
| 31 ExtensionAppItem(Profile* profile, | 31 ExtensionAppItem(Profile* profile, |
| 32 const extensions::Extension* extension, | 32 const extensions::Extension* extension, |
| 33 AppListController* controller); | 33 AppListControllerDelegate* controller); |
| 34 virtual ~ExtensionAppItem(); | 34 virtual ~ExtensionAppItem(); |
| 35 | 35 |
| 36 // Gets extension associated with this model. Returns NULL if extension | 36 // Gets extension associated with this model. Returns NULL if extension |
| 37 // no longer exists. | 37 // no longer exists. |
| 38 const extensions::Extension* GetExtension() const; | 38 const extensions::Extension* GetExtension() const; |
| 39 | 39 |
| 40 syncer::StringOrdinal GetPageOrdinal() const; | 40 syncer::StringOrdinal GetPageOrdinal() const; |
| 41 syncer::StringOrdinal GetAppLaunchOrdinal() const; | 41 syncer::StringOrdinal GetAppLaunchOrdinal() const; |
| 42 | 42 |
| 43 const std::string& extension_id() const { return extension_id_; } | 43 const std::string& extension_id() const { return extension_id_; } |
| (...skipping 19 matching lines...) Expand all Loading... |
| 63 int command_id, | 63 int command_id, |
| 64 ui::Accelerator* acclelrator) OVERRIDE; | 64 ui::Accelerator* acclelrator) OVERRIDE; |
| 65 virtual void ExecuteCommand(int command_id) OVERRIDE; | 65 virtual void ExecuteCommand(int command_id) OVERRIDE; |
| 66 | 66 |
| 67 // Overridden from ChromeAppListItem: | 67 // Overridden from ChromeAppListItem: |
| 68 virtual void Activate(int event_flags) OVERRIDE; | 68 virtual void Activate(int event_flags) OVERRIDE; |
| 69 virtual ui::MenuModel* GetContextMenuModel() OVERRIDE; | 69 virtual ui::MenuModel* GetContextMenuModel() OVERRIDE; |
| 70 | 70 |
| 71 Profile* profile_; | 71 Profile* profile_; |
| 72 const std::string extension_id_; | 72 const std::string extension_id_; |
| 73 AppListController* controller_; | 73 AppListControllerDelegate* controller_; |
| 74 | 74 |
| 75 scoped_ptr<extensions::IconImage> icon_; | 75 scoped_ptr<extensions::IconImage> icon_; |
| 76 scoped_ptr<ui::SimpleMenuModel> context_menu_model_; | 76 scoped_ptr<ui::SimpleMenuModel> context_menu_model_; |
| 77 scoped_ptr<extensions::ContextMenuMatcher> extension_menu_items_; | 77 scoped_ptr<extensions::ContextMenuMatcher> extension_menu_items_; |
| 78 | 78 |
| 79 DISALLOW_COPY_AND_ASSIGN(ExtensionAppItem); | 79 DISALLOW_COPY_AND_ASSIGN(ExtensionAppItem); |
| 80 }; | 80 }; |
| 81 | 81 |
| 82 #endif // CHROME_BROWSER_UI_APP_LIST_EXTENSION_APP_ITEM_H_ | 82 #endif // CHROME_BROWSER_UI_APP_LIST_EXTENSION_APP_ITEM_H_ |
| OLD | NEW |