Home | History | Annotate | Download | only in history
      1 // Copyright (c) 2013 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 "chrome/browser/history/top_sites.h"
      6 
      7 #include "base/metrics/field_trial.h"
      8 #include "base/strings/string_util.h"
      9 #include "chrome/browser/history/top_sites_impl.h"
     10 #include "chrome/browser/history/top_sites_likely_impl.h"
     11 #include "grit/chromium_strings.h"
     12 #include "grit/generated_resources.h"
     13 #include "grit/locale_settings.h"
     14 #include "grit/theme_resources.h"
     15 
     16 namespace history {
     17 
     18 const TopSites::PrepopulatedPage kPrepopulatedPages[] = {
     19 #if defined(OS_ANDROID)
     20     { IDS_MOBILE_WELCOME_URL, IDS_NEW_TAB_CHROME_WELCOME_PAGE_TITLE,
     21     IDR_PRODUCT_LOGO_16, IDR_NEWTAB_CHROME_WELCOME_PAGE_THUMBNAIL,
     22     SkColorSetRGB(0, 147, 60) }
     23 #else
     24   { IDS_CHROME_WELCOME_URL, IDS_NEW_TAB_CHROME_WELCOME_PAGE_TITLE,
     25     IDR_PRODUCT_LOGO_16, IDR_NEWTAB_CHROME_WELCOME_PAGE_THUMBNAIL,
     26     SkColorSetRGB(0, 147, 60) },
     27 #endif
     28 #if !defined(OS_ANDROID)
     29   { IDS_WEBSTORE_URL, IDS_EXTENSION_WEB_STORE_TITLE,
     30     IDR_WEBSTORE_ICON_16, IDR_NEWTAB_WEBSTORE_THUMBNAIL,
     31     SkColorSetRGB(63, 132, 197) }
     32 #endif
     33 };
     34 
     35 // static
     36 TopSites* TopSites::Create(Profile* profile, const base::FilePath& db_name) {
     37   if (base::FieldTrialList::FindFullName("MostLikely") == "Likely_Client") {
     38     // Experimental group. Enabled through a command-line flag.
     39     TopSitesLikelyImpl* top_sites_likely_impl = new TopSitesLikelyImpl(profile);
     40     top_sites_likely_impl->Init(db_name);
     41     return top_sites_likely_impl;
     42   }
     43   TopSitesImpl* top_sites_impl = new TopSitesImpl(profile);
     44   top_sites_impl->Init(db_name);
     45   return top_sites_impl;
     46 }
     47 
     48 }  // namespace history
     49