OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_SEARCH_APP_RESULT_H_ | 5 #ifndef CHROME_BROWSER_UI_APP_LIST_SEARCH_APP_RESULT_H_ |
6 #define CHROME_BROWSER_UI_APP_LIST_SEARCH_APP_RESULT_H_ | 6 #define CHROME_BROWSER_UI_APP_LIST_SEARCH_APP_RESULT_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/ui/app_list/app_context_menu_delegate.h" | 11 #include "chrome/browser/ui/app_list/app_context_menu_delegate.h" |
12 #include "chrome/browser/ui/app_list/search/chrome_search_result.h" | 12 #include "chrome/browser/ui/app_list/search/chrome_search_result.h" |
13 #include "chrome/browser/ui/extensions/extension_enable_flow_delegate.h" | 13 #include "chrome/browser/ui/extensions/extension_enable_flow_delegate.h" |
14 #include "extensions/browser/extension_icon_image.h" | 14 #include "extensions/browser/extension_icon_image.h" |
15 #include "extensions/browser/extension_registry_observer.h" | 15 #include "extensions/browser/extension_registry_observer.h" |
16 | 16 |
17 class AppListControllerDelegate; | 17 class AppListControllerDelegate; |
18 class ExtensionEnableFlow; | 18 class ExtensionEnableFlow; |
19 class Profile; | 19 class Profile; |
20 | 20 |
| 21 namespace base { |
| 22 class Time; |
| 23 } |
| 24 |
21 namespace extensions { | 25 namespace extensions { |
22 class ExtensionRegistry; | 26 class ExtensionRegistry; |
23 } | 27 } |
24 | 28 |
25 namespace app_list { | 29 namespace app_list { |
26 | 30 |
27 class AppContextMenu; | 31 class AppContextMenu; |
28 class TokenizedString; | 32 class TokenizedString; |
29 class TokenizedStringMatch; | 33 class TokenizedStringMatch; |
30 | 34 |
31 class AppResult : public ChromeSearchResult, | 35 class AppResult : public ChromeSearchResult, |
32 public extensions::IconImage::Observer, | 36 public extensions::IconImage::Observer, |
33 public AppContextMenuDelegate, | 37 public AppContextMenuDelegate, |
34 public ExtensionEnableFlowDelegate, | 38 public ExtensionEnableFlowDelegate, |
35 public extensions::ExtensionRegistryObserver { | 39 public extensions::ExtensionRegistryObserver { |
36 public: | 40 public: |
37 AppResult(Profile* profile, | 41 AppResult(Profile* profile, |
38 const std::string& app_id, | 42 const std::string& app_id, |
39 AppListControllerDelegate* controller); | 43 AppListControllerDelegate* controller); |
40 virtual ~AppResult(); | 44 virtual ~AppResult(); |
41 | 45 |
42 void UpdateFromMatch(const TokenizedString& title, | 46 void UpdateFromMatch(const TokenizedString& title, |
43 const TokenizedStringMatch& match); | 47 const TokenizedStringMatch& match); |
44 | 48 |
| 49 void UpdateFromLastLaunched(const base::Time& current_time, |
| 50 const base::Time& last_launched); |
| 51 |
45 // ChromeSearchResult overides: | 52 // ChromeSearchResult overides: |
46 virtual void Open(int event_flags) OVERRIDE; | 53 virtual void Open(int event_flags) OVERRIDE; |
47 virtual void InvokeAction(int action_index, int event_flags) OVERRIDE; | 54 virtual void InvokeAction(int action_index, int event_flags) OVERRIDE; |
48 virtual scoped_ptr<ChromeSearchResult> Duplicate() OVERRIDE; | 55 virtual scoped_ptr<ChromeSearchResult> Duplicate() OVERRIDE; |
49 virtual ui::MenuModel* GetContextMenuModel() OVERRIDE; | 56 virtual ui::MenuModel* GetContextMenuModel() OVERRIDE; |
50 virtual ChromeSearchResultType GetType() OVERRIDE; | 57 virtual ChromeSearchResultType GetType() OVERRIDE; |
51 | 58 |
52 private: | 59 private: |
53 void StartObservingExtensionRegistry(); | 60 void StartObservingExtensionRegistry(); |
54 void StopObservingExtensionRegistry(); | 61 void StopObservingExtensionRegistry(); |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 scoped_ptr<ExtensionEnableFlow> extension_enable_flow_; | 98 scoped_ptr<ExtensionEnableFlow> extension_enable_flow_; |
92 | 99 |
93 extensions::ExtensionRegistry* extension_registry_; | 100 extensions::ExtensionRegistry* extension_registry_; |
94 | 101 |
95 DISALLOW_COPY_AND_ASSIGN(AppResult); | 102 DISALLOW_COPY_AND_ASSIGN(AppResult); |
96 }; | 103 }; |
97 | 104 |
98 } // namespace app_list | 105 } // namespace app_list |
99 | 106 |
100 #endif // CHROME_BROWSER_UI_APP_LIST_SEARCH_APP_RESULT_H_ | 107 #endif // CHROME_BROWSER_UI_APP_LIST_SEARCH_APP_RESULT_H_ |
OLD | NEW |