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" | |
13 #include "chrome/browser/ui/extensions/extension_enable_flow_delegate.h" | 12 #include "chrome/browser/ui/extensions/extension_enable_flow_delegate.h" |
14 #include "extensions/browser/extension_icon_image.h" | 13 #include "extensions/browser/extension_icon_image.h" |
15 #include "extensions/browser/extension_registry_observer.h" | 14 #include "extensions/browser/extension_registry_observer.h" |
15 #include "ui/app_list/search_result.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 { | 21 namespace base { |
22 class Time; | 22 class Time; |
23 } | 23 } |
24 | 24 |
25 namespace extensions { | 25 namespace extensions { |
26 class ExtensionRegistry; | 26 class ExtensionRegistry; |
27 } | 27 } |
28 | 28 |
29 namespace app_list { | 29 namespace app_list { |
30 | 30 |
31 class AppContextMenu; | 31 class AppContextMenu; |
32 class TokenizedString; | 32 class TokenizedString; |
33 class TokenizedStringMatch; | 33 class TokenizedStringMatch; |
34 | 34 |
35 class AppResult : public ChromeSearchResult, | 35 class AppResult : public SearchResult, |
36 public extensions::IconImage::Observer, | 36 public extensions::IconImage::Observer, |
37 public AppContextMenuDelegate, | 37 public AppContextMenuDelegate, |
38 public ExtensionEnableFlowDelegate, | 38 public ExtensionEnableFlowDelegate, |
39 public extensions::ExtensionRegistryObserver { | 39 public extensions::ExtensionRegistryObserver { |
40 public: | 40 public: |
41 AppResult(Profile* profile, | 41 AppResult(Profile* profile, |
42 const std::string& app_id, | 42 const std::string& app_id, |
43 AppListControllerDelegate* controller); | 43 AppListControllerDelegate* controller); |
44 virtual ~AppResult(); | 44 virtual ~AppResult(); |
45 | 45 |
46 void UpdateFromMatch(const TokenizedString& title, | 46 void UpdateFromMatch(const TokenizedString& title, |
47 const TokenizedStringMatch& match); | 47 const TokenizedStringMatch& match); |
48 | 48 |
49 void UpdateFromLastLaunched(const base::Time& current_time, | 49 void UpdateFromLastLaunched(const base::Time& current_time, |
50 const base::Time& last_launched); | 50 const base::Time& last_launched); |
51 | 51 |
52 // ChromeSearchResult overides: | 52 // SearchResult overides: |
tapted
2014/10/02 07:19:21
nit (while you're here) overides -> overrides. Or
Jun Mukai
2014/10/03 01:24:23
Done.
| |
53 virtual void Open(int event_flags) OVERRIDE; | 53 virtual void Open(int event_flags) OVERRIDE; |
54 virtual void InvokeAction(int action_index, int event_flags) OVERRIDE; | 54 virtual scoped_ptr<SearchResult> Duplicate() OVERRIDE; |
55 virtual scoped_ptr<ChromeSearchResult> Duplicate() OVERRIDE; | |
56 virtual ui::MenuModel* GetContextMenuModel() OVERRIDE; | 55 virtual ui::MenuModel* GetContextMenuModel() OVERRIDE; |
57 virtual ChromeSearchResultType GetType() OVERRIDE; | 56 virtual SearchResultType GetType() OVERRIDE; |
58 | 57 |
59 private: | 58 private: |
60 void StartObservingExtensionRegistry(); | 59 void StartObservingExtensionRegistry(); |
61 void StopObservingExtensionRegistry(); | 60 void StopObservingExtensionRegistry(); |
62 | 61 |
63 // Checks if extension is disabled and if enable flow should be started. | 62 // Checks if extension is disabled and if enable flow should be started. |
64 // Returns true if extension enable flow is started or there is already one | 63 // Returns true if extension enable flow is started or there is already one |
65 // running. | 64 // running. |
66 bool RunExtensionEnableFlow(); | 65 bool RunExtensionEnableFlow(); |
67 | 66 |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
99 scoped_ptr<ExtensionEnableFlow> extension_enable_flow_; | 98 scoped_ptr<ExtensionEnableFlow> extension_enable_flow_; |
100 | 99 |
101 extensions::ExtensionRegistry* extension_registry_; | 100 extensions::ExtensionRegistry* extension_registry_; |
102 | 101 |
103 DISALLOW_COPY_AND_ASSIGN(AppResult); | 102 DISALLOW_COPY_AND_ASSIGN(AppResult); |
104 }; | 103 }; |
105 | 104 |
106 } // namespace app_list | 105 } // namespace app_list |
107 | 106 |
108 #endif // CHROME_BROWSER_UI_APP_LIST_SEARCH_APP_RESULT_H_ | 107 #endif // CHROME_BROWSER_UI_APP_LIST_SEARCH_APP_RESULT_H_ |
OLD | NEW |