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