| 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_activity_factory.h" | 5 #include "athena/content/public/content_activity_factory.h" |
| 6 | 6 |
| 7 #include "athena/content/app_activity.h" |
| 7 #include "athena/content/web_activity.h" | 8 #include "athena/content/web_activity.h" |
| 8 #include "base/logging.h" | 9 #include "base/logging.h" |
| 9 | 10 |
| 10 namespace athena { | 11 namespace athena { |
| 11 | 12 |
| 12 ContentActivityFactory::ContentActivityFactory() { | 13 ContentActivityFactory::ContentActivityFactory() { |
| 13 } | 14 } |
| 14 | 15 |
| 15 ContentActivityFactory::~ContentActivityFactory() {} | 16 ContentActivityFactory::~ContentActivityFactory() {} |
| 16 | 17 |
| 17 Activity* ContentActivityFactory::CreateWebActivity( | 18 Activity* ContentActivityFactory::CreateWebActivity( |
| 18 content::BrowserContext* browser_context, | 19 content::BrowserContext* browser_context, |
| 19 const GURL& url) { | 20 const GURL& url) { |
| 20 return new WebActivity(browser_context, url); | 21 return new WebActivity(browser_context, url); |
| 21 } | 22 } |
| 22 | 23 |
| 23 Activity* ContentActivityFactory::CreateAppActivity( | 24 Activity* ContentActivityFactory::CreateAppActivity( |
| 24 content::BrowserContext* browser_context, | 25 apps::ShellAppWindow* app_window) { |
| 25 const std::string& app_id) { | 26 return new AppActivity(app_window); |
| 26 // TODO(mukai): port the extension system and launch the app actually. | |
| 27 GURL url; | |
| 28 if (app_id == "mail") | |
| 29 url = GURL("https://mail.google.com/"); | |
| 30 else if (app_id == "calendar") | |
| 31 url = GURL("https://calendar.google.com/"); | |
| 32 else if (app_id == "video") | |
| 33 url = GURL("http://youtube.com/"); | |
| 34 else if (app_id == "music") | |
| 35 url = GURL("https://play.google.com/music"); | |
| 36 else if (app_id == "contact") | |
| 37 url = GURL("https://www.google.com/contacts"); | |
| 38 else | |
| 39 LOG(FATAL) << "Unknown app id: " << app_id; | |
| 40 DCHECK(!url.is_empty()); | |
| 41 return CreateWebActivity(browser_context, url); | |
| 42 } | 27 } |
| 43 | 28 |
| 44 } // namespace athena | 29 } // namespace athena |
| OLD | NEW |