Home | History | Annotate | Download | only in util
      1 // Copyright (c) 2012 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 // This file extends generic BrowserDistribution class to declare Google Chrome
      6 // specific implementation.
      7 
      8 #ifndef CHROME_INSTALLER_UTIL_GOOGLE_CHROME_DISTRIBUTION_H_
      9 #define CHROME_INSTALLER_UTIL_GOOGLE_CHROME_DISTRIBUTION_H_
     10 
     11 #include "base/gtest_prod_util.h"
     12 #include "base/strings/string16.h"
     13 #include "chrome/installer/util/browser_distribution.h"
     14 
     15 namespace base {
     16 class FilePath;
     17 }
     18 
     19 class GoogleChromeDistribution : public BrowserDistribution {
     20  public:
     21   // Opens the Google Chrome uninstall survey window.
     22   // version refers to the version of Chrome being uninstalled.
     23   // local_data_path is the path of the file containing json metrics that
     24   //   will be parsed. If this file indicates that the user has opted in to
     25   //   providing anonymous usage data, then some additional statistics will
     26   //   be added to the survey url.
     27   // distribution_data contains Google Update related data that will be
     28   //   concatenated to the survey url if the file in local_data_path indicates
     29   //   the user has opted in to providing anonymous usage data.
     30   virtual void DoPostUninstallOperations(
     31       const Version& version,
     32       const base::FilePath& local_data_path,
     33       const string16& distribution_data) OVERRIDE;
     34 
     35   virtual string16 GetActiveSetupGuid() OVERRIDE;
     36 
     37   virtual string16 GetAppGuid() OVERRIDE;
     38 
     39   virtual string16 GetBaseAppName() OVERRIDE;
     40 
     41   virtual string16 GetAppShortCutName() OVERRIDE;
     42 
     43   virtual string16 GetAlternateApplicationName() OVERRIDE;
     44 
     45   virtual string16 GetBaseAppId() OVERRIDE;
     46 
     47   virtual string16 GetInstallSubDir() OVERRIDE;
     48 
     49   virtual string16 GetPublisherName() OVERRIDE;
     50 
     51   virtual string16 GetAppDescription() OVERRIDE;
     52 
     53   virtual std::string GetSafeBrowsingName() OVERRIDE;
     54 
     55   virtual string16 GetStateKey() OVERRIDE;
     56 
     57   virtual string16 GetStateMediumKey() OVERRIDE;
     58 
     59   virtual std::string GetNetworkStatsServer() const OVERRIDE;
     60 
     61   virtual std::string GetHttpPipeliningTestServer() const OVERRIDE;
     62 
     63   // This method reads data from the Google Update ClientState key for
     64   // potential use in the uninstall survey. It must be called before the
     65   // key returned by GetVersionKey() is deleted.
     66   virtual string16 GetDistributionData(HKEY root_key) OVERRIDE;
     67 
     68   virtual string16 GetUninstallLinkName() OVERRIDE;
     69 
     70   virtual string16 GetUninstallRegPath() OVERRIDE;
     71 
     72   virtual string16 GetVersionKey() OVERRIDE;
     73 
     74   virtual string16 GetIconFilename() OVERRIDE;
     75 
     76   virtual bool GetCommandExecuteImplClsid(
     77       string16* handler_class_uuid) OVERRIDE;
     78 
     79   virtual bool AppHostIsSupported() OVERRIDE;
     80 
     81   virtual void UpdateInstallStatus(
     82       bool system_install,
     83       installer::ArchiveType archive_type,
     84       installer::InstallStatus install_status) OVERRIDE;
     85 
     86   virtual bool ShouldSetExperimentLabels() OVERRIDE;
     87 
     88   virtual bool HasUserExperiments() OVERRIDE;
     89 
     90   const string16& product_guid() { return product_guid_; }
     91 
     92  protected:
     93   void set_product_guid(const string16& guid) { product_guid_ = guid; }
     94 
     95   // Disallow construction from others.
     96   GoogleChromeDistribution();
     97 
     98  private:
     99   friend class BrowserDistribution;
    100 
    101   // The product ID for Google Update.
    102   string16 product_guid_;
    103 };
    104 
    105 #endif  // CHROME_INSTALLER_UTIL_GOOGLE_CHROME_DISTRIBUTION_H_
    106