Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(340)

Unified Diff: athena/content/content_app_model_builder.cc

Issue 335003003: Introduces AppActivity and handler of chrome.shell API. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « athena/content/content_activity_factory.cc ('k') | athena/content/public/content_activity_factory.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: athena/content/content_app_model_builder.cc
diff --git a/athena/content/content_app_model_builder.cc b/athena/content/content_app_model_builder.cc
index 7fcad45e35e42213e44bfe49419dc9c6ada9f891..f91b1c10619f923ed217ff32002e791aa604b3fd 100644
--- a/athena/content/content_app_model_builder.cc
+++ b/athena/content/content_app_model_builder.cc
@@ -37,10 +37,11 @@ gfx::ImageSkia CreateFlatColorImage(SkColor color) {
class DummyItem : public app_list::AppListItem {
public:
DummyItem(const std::string& id,
+ const GURL& url,
SkColor color,
content::BrowserContext* browser_context)
: app_list::AppListItem(id),
- id_(id),
+ url_(url),
browser_context_(browser_context) {
SetIcon(CreateFlatColorImage(color), false /* has_shadow */);
@@ -51,11 +52,10 @@ class DummyItem : public app_list::AppListItem {
// Overridden from app_list::AppListItem:
virtual void Activate(int event_flags) OVERRIDE {
ActivityManager::Get()->AddActivity(
- ActivityFactory::Get()->CreateAppActivity(
- browser_context_, id_));
+ ActivityFactory::Get()->CreateWebActivity(browser_context_, url_));
}
- std::string id_;
+ GURL url_;
content::BrowserContext* browser_context_;
DISALLOW_COPY_AND_ASSIGN(DummyItem);
@@ -98,16 +98,19 @@ ContentAppModelBuilder::~ContentAppModelBuilder() {
}
void ContentAppModelBuilder::PopulateApps(app_list::AppListModel* model) {
- model->AddItem(scoped_ptr<app_list::AppListItem>(
- new DummyItem("mail", SK_ColorRED, browser_context_)));
- model->AddItem(scoped_ptr<app_list::AppListItem>(
- new DummyItem("calendar", SK_ColorBLUE, browser_context_)));
- model->AddItem(scoped_ptr<app_list::AppListItem>(
- new DummyItem("video", SK_ColorGREEN, browser_context_)));
- model->AddItem(scoped_ptr<app_list::AppListItem>(
- new DummyItem("music", SK_ColorYELLOW, browser_context_)));
- model->AddItem(scoped_ptr<app_list::AppListItem>(
- new DummyItem("contact", SK_ColorCYAN, browser_context_)));
+ model->AddItem(scoped_ptr<app_list::AppListItem>(new DummyItem(
+ "mail", GURL("http://gmail.com/"), SK_ColorRED, browser_context_)));
+ model->AddItem(scoped_ptr<app_list::AppListItem>(new DummyItem(
+ "calendar", GURL("https://calendar.google.com/"),
+ SK_ColorBLUE, browser_context_)));
+ model->AddItem(scoped_ptr<app_list::AppListItem>(new DummyItem(
+ "video", GURL("http://youtube.com/"), SK_ColorGREEN, browser_context_)));
+ model->AddItem(scoped_ptr<app_list::AppListItem>(new DummyItem(
+ "music", GURL("http://play.google.com/music"),
+ SK_ColorYELLOW, browser_context_)));
+ model->AddItem(scoped_ptr<app_list::AppListItem>(new DummyItem(
+ "contact", GURL("https://www.google.com/contacts"),
+ SK_ColorCYAN, browser_context_)));
ShellExtensionSystem* extension_system =
GetShellExtensionSystem(browser_context_);
« no previous file with comments | « athena/content/content_activity_factory.cc ('k') | athena/content/public/content_activity_factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698