| 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/content_activity_factory.h" | 5 #include "athena/content/content_activity_factory.h" |
| 6 | 6 |
| 7 #include "athena/activity/public/activity_manager.h" |
| 7 #include "athena/content/app_activity.h" | 8 #include "athena/content/app_activity.h" |
| 8 #include "athena/content/web_activity.h" | 9 #include "athena/content/web_activity.h" |
| 9 #include "base/logging.h" | 10 #include "base/logging.h" |
| 10 | 11 |
| 11 namespace athena { | 12 namespace athena { |
| 12 | 13 |
| 13 ContentActivityFactory::ContentActivityFactory() { | 14 ContentActivityFactory::ContentActivityFactory() { |
| 14 } | 15 } |
| 15 | 16 |
| 16 ContentActivityFactory::~ContentActivityFactory() {} | 17 ContentActivityFactory::~ContentActivityFactory() {} |
| 17 | 18 |
| 18 Activity* ContentActivityFactory::CreateWebActivity( | 19 Activity* ContentActivityFactory::CreateWebActivity( |
| 19 content::BrowserContext* browser_context, | 20 content::BrowserContext* browser_context, |
| 20 const base::string16& title, | 21 const base::string16& title, |
| 21 const GURL& url) { | 22 const GURL& url) { |
| 22 return new WebActivity(browser_context, title, url); | 23 Activity* activity = new WebActivity(browser_context, title, url); |
| 24 ActivityManager::Get()->AddActivity(activity); |
| 25 return activity; |
| 23 } | 26 } |
| 24 | 27 |
| 25 Activity* ContentActivityFactory::CreateAppActivity( | 28 Activity* ContentActivityFactory::CreateAppActivity( |
| 26 extensions::AppWindow* app_window, | 29 extensions::AppWindow* app_window, |
| 27 views::WebView* web_view) { | 30 views::WebView* web_view) { |
| 28 return new AppActivity(app_window, web_view); | 31 Activity* activity = new AppActivity(app_window, web_view); |
| 32 ActivityManager::Get()->AddActivity(activity); |
| 33 return activity; |
| 29 } | 34 } |
| 30 | 35 |
| 31 ActivityFactory* CreateContentActivityFactory() { | 36 ActivityFactory* CreateContentActivityFactory() { |
| 32 return new ContentActivityFactory(); | 37 return new ContentActivityFactory(); |
| 33 } | 38 } |
| 34 | 39 |
| 35 } // namespace athena | 40 } // namespace athena |
| OLD | NEW |