OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #include "athena/content/public/content_app_model_builder.h" | 5 #include "athena/extensions/public/extension_app_model_builder.h" |
6 | 6 |
7 #include "athena/activity/public/activity_factory.h" | 7 #include "athena/activity/public/activity_factory.h" |
8 #include "athena/activity/public/activity_manager.h" | 8 #include "athena/activity/public/activity_manager.h" |
9 #include "athena/extensions/public/extensions_delegate.h" | 9 #include "athena/extensions/public/extensions_delegate.h" |
10 #include "extensions/browser/extension_icon_image.h" | 10 #include "extensions/browser/extension_icon_image.h" |
11 #include "extensions/common/constants.h" | 11 #include "extensions/common/constants.h" |
12 #include "extensions/common/extension_set.h" | 12 #include "extensions/common/extension_set.h" |
13 #include "extensions/common/manifest_handlers/icons_handler.h" | 13 #include "extensions/common/manifest_handlers/icons_handler.h" |
14 #include "extensions/grit/extensions_browser_resources.h" | 14 #include "extensions/grit/extensions_browser_resources.h" |
15 #include "ui/app_list/app_list_item.h" | 15 #include "ui/app_list/app_list_item.h" |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 | 84 |
85 scoped_refptr<const extensions::Extension> extension_; | 85 scoped_refptr<const extensions::Extension> extension_; |
86 content::BrowserContext* browser_context_; | 86 content::BrowserContext* browser_context_; |
87 extensions::IconImage icon_image_; | 87 extensions::IconImage icon_image_; |
88 | 88 |
89 DISALLOW_COPY_AND_ASSIGN(AppItem); | 89 DISALLOW_COPY_AND_ASSIGN(AppItem); |
90 }; | 90 }; |
91 | 91 |
92 } // namespace | 92 } // namespace |
93 | 93 |
94 ContentAppModelBuilder::ContentAppModelBuilder( | 94 ExtensionAppModelBuilder::ExtensionAppModelBuilder( |
95 content::BrowserContext* browser_context) | 95 content::BrowserContext* browser_context) |
96 : browser_context_(browser_context) { | 96 : browser_context_(browser_context) { |
97 } | 97 } |
98 | 98 |
99 ContentAppModelBuilder::~ContentAppModelBuilder() { | 99 ExtensionAppModelBuilder::~ExtensionAppModelBuilder() { |
100 } | 100 } |
101 | 101 |
102 void ContentAppModelBuilder::PopulateApps(app_list::AppListModel* model) { | 102 void ExtensionAppModelBuilder::PopulateApps(app_list::AppListModel* model) { |
103 ExtensionsDelegate* bridge = ExtensionsDelegate::Get(browser_context_); | 103 ExtensionsDelegate* bridge = ExtensionsDelegate::Get(browser_context_); |
104 const extensions::ExtensionSet& extensions = bridge->GetInstalledExtensions(); | 104 const extensions::ExtensionSet& extensions = bridge->GetInstalledExtensions(); |
105 for (extensions::ExtensionSet::const_iterator iter = extensions.begin(); | 105 for (extensions::ExtensionSet::const_iterator iter = extensions.begin(); |
106 iter != extensions.end(); | 106 iter != extensions.end(); |
107 ++iter) { | 107 ++iter) { |
108 // TODO(mukai): use chrome/browser/extension_ui_util. | 108 // TODO(mukai): use chrome/browser/extension_ui_util. |
109 if ((*iter)->ShouldDisplayInAppLauncher()) { | 109 if ((*iter)->ShouldDisplayInAppLauncher()) { |
110 model->AddItem(scoped_ptr<app_list::AppListItem>( | 110 model->AddItem(scoped_ptr<app_list::AppListItem>( |
111 new AppItem(*iter, browser_context_))); | 111 new AppItem(*iter, browser_context_))); |
112 } | 112 } |
113 } | 113 } |
114 | 114 |
115 model->AddItem(scoped_ptr<app_list::AppListItem>(new DummyItem( | 115 model->AddItem(scoped_ptr<app_list::AppListItem>(new DummyItem( |
116 "mail", GURL("http://gmail.com/"), SK_ColorRED, browser_context_))); | 116 "mail", GURL("http://gmail.com/"), SK_ColorRED, browser_context_))); |
117 model->AddItem(scoped_ptr<app_list::AppListItem>(new DummyItem( | 117 model->AddItem(scoped_ptr<app_list::AppListItem>(new DummyItem( |
118 "calendar", GURL("https://calendar.google.com/"), | 118 "calendar", GURL("https://calendar.google.com/"), |
119 SK_ColorBLUE, browser_context_))); | 119 SK_ColorBLUE, browser_context_))); |
120 model->AddItem(scoped_ptr<app_list::AppListItem>(new DummyItem( | 120 model->AddItem(scoped_ptr<app_list::AppListItem>(new DummyItem( |
121 "video", GURL("http://youtube.com/"), SK_ColorGREEN, browser_context_))); | 121 "video", GURL("http://youtube.com/"), SK_ColorGREEN, browser_context_))); |
122 model->AddItem(scoped_ptr<app_list::AppListItem>(new DummyItem( | 122 model->AddItem(scoped_ptr<app_list::AppListItem>(new DummyItem( |
123 "music", GURL("http://play.google.com/music"), | 123 "music", GURL("http://play.google.com/music"), |
124 SK_ColorYELLOW, browser_context_))); | 124 SK_ColorYELLOW, browser_context_))); |
125 model->AddItem(scoped_ptr<app_list::AppListItem>(new DummyItem( | 125 model->AddItem(scoped_ptr<app_list::AppListItem>(new DummyItem( |
126 "contact", GURL("https://www.google.com/contacts"), | 126 "contact", GURL("https://www.google.com/contacts"), |
127 SK_ColorCYAN, browser_context_))); | 127 SK_ColorCYAN, browser_context_))); |
128 } | 128 } |
129 | 129 |
130 } // namespace athena | 130 } // namespace athena |
OLD | NEW |