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/test/sample_activity_factory.h" 6 7 #include <string> 8 9 #include "athena/test/sample_activity.h" 10 #include "base/logging.h" 11 #include "base/strings/utf_string_conversions.h" 12 #include "third_party/skia/include/core/SkColor.h" 13 #include "url/gurl.h" 14 15 namespace athena { 16 namespace test { 17 18 namespace { 19 const SkColor kDefaultColor = SK_ColorRED; 20 const SkColor kDefaultContentColor = SK_ColorGREEN; 21 22 const SkColor kDefaultAppColor = SK_ColorYELLOW; 23 const SkColor kDefaultAppContentColor = SK_ColorBLUE; 24 } 25 SampleActivityFactory()26SampleActivityFactory::SampleActivityFactory() {} 27 ~SampleActivityFactory()28SampleActivityFactory::~SampleActivityFactory() {} 29 CreateWebActivity(content::BrowserContext * browser_context,const GURL & url)30Activity* SampleActivityFactory::CreateWebActivity( 31 content::BrowserContext* browser_context, 32 const GURL& url) { 33 return new SampleActivity( 34 kDefaultColor, kDefaultContentColor, base::UTF8ToUTF16(url.spec())); 35 } 36 CreateAppActivity(apps::ShellAppWindow * app_window)37Activity* SampleActivityFactory::CreateAppActivity( 38 apps::ShellAppWindow* app_window) { 39 // SampleActivityFactory can't own the |app_window|, so it must be NULL. 40 DCHECK(app_window == NULL); 41 return new SampleActivity( 42 kDefaultAppColor, kDefaultAppContentColor, base::UTF8ToUTF16("App")); 43 } 44 45 } // namespace test 46 } // namespace athena 47