| 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/test/sample_activity_factory.h" | 5 #include "athena/test/sample_activity_factory.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "athena/activity/public/activity_manager.h" |
| 9 #include "athena/test/sample_activity.h" | 10 #include "athena/test/sample_activity.h" |
| 10 #include "base/logging.h" | 11 #include "base/logging.h" |
| 11 #include "base/strings/utf_string_conversions.h" | 12 #include "base/strings/utf_string_conversions.h" |
| 12 #include "third_party/skia/include/core/SkColor.h" | 13 #include "third_party/skia/include/core/SkColor.h" |
| 13 #include "url/gurl.h" | 14 #include "url/gurl.h" |
| 14 | 15 |
| 15 namespace athena { | 16 namespace athena { |
| 16 namespace test { | 17 namespace test { |
| 17 | 18 |
| 18 namespace { | 19 namespace { |
| 19 const SkColor kDefaultColor = SK_ColorRED; | 20 const SkColor kDefaultColor = SK_ColorRED; |
| 20 const SkColor kDefaultContentColor = SK_ColorGREEN; | 21 const SkColor kDefaultContentColor = SK_ColorGREEN; |
| 21 | 22 |
| 22 const SkColor kDefaultAppColor = SK_ColorYELLOW; | 23 const SkColor kDefaultAppColor = SK_ColorYELLOW; |
| 23 const SkColor kDefaultAppContentColor = SK_ColorBLUE; | 24 const SkColor kDefaultAppContentColor = SK_ColorBLUE; |
| 24 } | 25 } |
| 25 | 26 |
| 26 SampleActivityFactory::SampleActivityFactory() {} | 27 SampleActivityFactory::SampleActivityFactory() {} |
| 27 | 28 |
| 28 SampleActivityFactory::~SampleActivityFactory() {} | 29 SampleActivityFactory::~SampleActivityFactory() {} |
| 29 | 30 |
| 30 Activity* SampleActivityFactory::CreateWebActivity( | 31 Activity* SampleActivityFactory::CreateWebActivity( |
| 31 content::BrowserContext* browser_context, | 32 content::BrowserContext* browser_context, |
| 32 const base::string16& title, | 33 const base::string16& title, |
| 33 const GURL& url) { | 34 const GURL& url) { |
| 34 return new SampleActivity( | 35 Activity* activity = new SampleActivity( |
| 35 kDefaultColor, kDefaultContentColor, base::UTF8ToUTF16(url.spec())); | 36 kDefaultColor, kDefaultContentColor, base::UTF8ToUTF16(url.spec())); |
| 37 ActivityManager::Get()->AddActivity(activity); |
| 38 return activity; |
| 36 } | 39 } |
| 37 | 40 |
| 38 Activity* SampleActivityFactory::CreateAppActivity( | 41 Activity* SampleActivityFactory::CreateAppActivity( |
| 39 extensions::AppWindow* app_window, | 42 extensions::AppWindow* app_window, |
| 40 views::WebView* web_view) { | 43 views::WebView* web_view) { |
| 41 DCHECK(!web_view); | 44 DCHECK(!web_view); |
| 42 return new SampleActivity( | 45 Activity* activity = new SampleActivity( |
| 43 kDefaultAppColor, kDefaultAppContentColor, base::UTF8ToUTF16("App")); | 46 kDefaultAppColor, kDefaultAppContentColor, base::UTF8ToUTF16("App")); |
| 47 ActivityManager::Get()->AddActivity(activity); |
| 48 return activity; |
| 44 } | 49 } |
| 45 | 50 |
| 46 } // namespace test | 51 } // namespace test |
| 47 } // namespace athena | 52 } // namespace athena |
| OLD | NEW |