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

Side by Side Diff: athena/content/content_activity_factory.cc

Issue 596493002: Add actiivity in factory (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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 unified diff | Download patch
« no previous file with comments | « athena/activity/activity_manager_unittest.cc ('k') | athena/content/web_activity.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
OLDNEW
« no previous file with comments | « athena/activity/activity_manager_unittest.cc ('k') | athena/content/web_activity.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698