| 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/web_activity.h" | 7 #include "athena/content/web_activity.h" |
| 8 #include "content/public/browser/web_contents.h" | |
| 9 #include "url/gurl.h" | |
| 10 | 8 |
| 11 namespace athena { | 9 namespace athena { |
| 12 | 10 |
| 13 ContentActivityFactory::ContentActivityFactory() { | 11 ContentActivityFactory::ContentActivityFactory() { |
| 14 } | 12 } |
| 15 | 13 |
| 16 ContentActivityFactory::~ContentActivityFactory() {} | 14 ContentActivityFactory::~ContentActivityFactory() {} |
| 17 | 15 |
| 18 Activity* ContentActivityFactory::CreateWebActivity( | 16 Activity* ContentActivityFactory::CreateWebActivity( |
| 19 content::BrowserContext* browser_context, | 17 content::BrowserContext* browser_context, |
| 20 const GURL& url) { | 18 const GURL& url) { |
| 21 content::WebContents::CreateParams params(browser_context); | 19 return new WebActivity(browser_context, url); |
| 22 content::WebContents* contents = content::WebContents::Create(params); | |
| 23 contents->GetController().LoadURL(url, | |
| 24 content::Referrer(), | |
| 25 content::PAGE_TRANSITION_TYPED, | |
| 26 std::string()); | |
| 27 WebActivity* activity = new WebActivity(contents); | |
| 28 // TODO(mukai): it might be better to move Focus to another place. | |
| 29 contents->Focus(); | |
| 30 return activity; | |
| 31 } | 20 } |
| 32 | 21 |
| 33 } // namespace athena | 22 } // namespace athena |
| OLD | NEW |