google_chrome_distribution.h revision 0f1bc08d4cfcc34181b0b5cbf065c40f687bf740
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
15namespace base {
16class FilePath;
17}
18
19class 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 GetShortcutName(ShortcutType shortcut_type) OVERRIDE;
40
41  virtual string16 GetIconFilename() OVERRIDE;
42
43  virtual int GetIconIndex(ShortcutType shortcut_type) OVERRIDE;
44
45  virtual string16 GetBaseAppName() OVERRIDE;
46
47  virtual string16 GetBaseAppId() OVERRIDE;
48
49  virtual string16 GetBrowserProgIdPrefix() OVERRIDE;
50
51  virtual string16 GetBrowserProgIdDesc() OVERRIDE;
52
53  virtual string16 GetInstallSubDir() OVERRIDE;
54
55  virtual string16 GetPublisherName() OVERRIDE;
56
57  virtual string16 GetAppDescription() OVERRIDE;
58
59  virtual std::string GetSafeBrowsingName() OVERRIDE;
60
61  virtual string16 GetStateKey() OVERRIDE;
62
63  virtual string16 GetStateMediumKey() OVERRIDE;
64
65  virtual std::string GetNetworkStatsServer() const OVERRIDE;
66
67  virtual std::string GetHttpPipeliningTestServer() const OVERRIDE;
68
69  // This method reads data from the Google Update ClientState key for
70  // potential use in the uninstall survey. It must be called before the
71  // key returned by GetVersionKey() is deleted.
72  virtual string16 GetDistributionData(HKEY root_key) OVERRIDE;
73
74  virtual string16 GetUninstallLinkName() OVERRIDE;
75
76  virtual string16 GetUninstallRegPath() OVERRIDE;
77
78  virtual string16 GetVersionKey() OVERRIDE;
79
80  virtual bool GetCommandExecuteImplClsid(
81      string16* handler_class_uuid) OVERRIDE;
82
83  virtual bool AppHostIsSupported() OVERRIDE;
84
85  virtual void UpdateInstallStatus(
86      bool system_install,
87      installer::ArchiveType archive_type,
88      installer::InstallStatus install_status) OVERRIDE;
89
90  virtual bool ShouldSetExperimentLabels() OVERRIDE;
91
92  virtual bool HasUserExperiments() OVERRIDE;
93
94  virtual uint32 GetSafeModeHotkey() OVERRIDE;
95
96  const string16& product_guid() { return product_guid_; }
97
98 protected:
99  void set_product_guid(const string16& guid) { product_guid_ = guid; }
100
101  // Disallow construction from others.
102  GoogleChromeDistribution();
103
104 private:
105  friend class BrowserDistribution;
106
107  // The product ID for Google Update.
108  string16 product_guid_;
109};
110
111#endif  // CHROME_INSTALLER_UTIL_GOOGLE_CHROME_DISTRIBUTION_H_
112