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/content/public/content_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" |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 | 95 |
96 ContentAppModelBuilder::~ContentAppModelBuilder() { | 96 ContentAppModelBuilder::~ContentAppModelBuilder() { |
97 } | 97 } |
98 | 98 |
99 void ContentAppModelBuilder::PopulateApps(app_list::AppListModel* model) { | 99 void ContentAppModelBuilder::PopulateApps(app_list::AppListModel* model) { |
100 ExtensionsDelegate* bridge = ExtensionsDelegate::Get(browser_context_); | 100 ExtensionsDelegate* bridge = ExtensionsDelegate::Get(browser_context_); |
101 const extensions::ExtensionSet& extensions = bridge->GetInstalledExtensions(); | 101 const extensions::ExtensionSet& extensions = bridge->GetInstalledExtensions(); |
102 for (extensions::ExtensionSet::const_iterator iter = extensions.begin(); | 102 for (extensions::ExtensionSet::const_iterator iter = extensions.begin(); |
103 iter != extensions.end(); | 103 iter != extensions.end(); |
104 ++iter) { | 104 ++iter) { |
105 model->AddItem(scoped_ptr<app_list::AppListItem>( | 105 // TODO(mukai): use chrome/browser/extension_ui_util. |
106 new AppItem(*iter, browser_context_))); | 106 if ((*iter)->ShouldDisplayInAppLauncher()) { |
| 107 model->AddItem(scoped_ptr<app_list::AppListItem>( |
| 108 new AppItem(*iter, browser_context_))); |
| 109 } |
107 } | 110 } |
108 | 111 |
109 model->AddItem(scoped_ptr<app_list::AppListItem>(new DummyItem( | 112 model->AddItem(scoped_ptr<app_list::AppListItem>(new DummyItem( |
110 "mail", GURL("http://gmail.com/"), SK_ColorRED, browser_context_))); | 113 "mail", GURL("http://gmail.com/"), SK_ColorRED, browser_context_))); |
111 model->AddItem(scoped_ptr<app_list::AppListItem>(new DummyItem( | 114 model->AddItem(scoped_ptr<app_list::AppListItem>(new DummyItem( |
112 "calendar", GURL("https://calendar.google.com/"), | 115 "calendar", GURL("https://calendar.google.com/"), |
113 SK_ColorBLUE, browser_context_))); | 116 SK_ColorBLUE, browser_context_))); |
114 model->AddItem(scoped_ptr<app_list::AppListItem>(new DummyItem( | 117 model->AddItem(scoped_ptr<app_list::AppListItem>(new DummyItem( |
115 "video", GURL("http://youtube.com/"), SK_ColorGREEN, browser_context_))); | 118 "video", GURL("http://youtube.com/"), SK_ColorGREEN, browser_context_))); |
116 model->AddItem(scoped_ptr<app_list::AppListItem>(new DummyItem( | 119 model->AddItem(scoped_ptr<app_list::AppListItem>(new DummyItem( |
117 "music", GURL("http://play.google.com/music"), | 120 "music", GURL("http://play.google.com/music"), |
118 SK_ColorYELLOW, browser_context_))); | 121 SK_ColorYELLOW, browser_context_))); |
119 model->AddItem(scoped_ptr<app_list::AppListItem>(new DummyItem( | 122 model->AddItem(scoped_ptr<app_list::AppListItem>(new DummyItem( |
120 "contact", GURL("https://www.google.com/contacts"), | 123 "contact", GURL("https://www.google.com/contacts"), |
121 SK_ColorCYAN, browser_context_))); | 124 SK_ColorCYAN, browser_context_))); |
122 } | 125 } |
123 | 126 |
124 } // namespace athena | 127 } // namespace athena |
OLD | NEW |