chrome_launcher_support.h revision eb525c5499e34cc9c4b825d6d9e75bb07cc06ace
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#ifndef CHROME_INSTALLER_LAUNCHER_SUPPORT_CHROME_LAUNCHER_SUPPORT_H_ 6#define CHROME_INSTALLER_LAUNCHER_SUPPORT_CHROME_LAUNCHER_SUPPORT_H_ 7 8namespace base { 9class FilePath; 10} 11 12namespace chrome_launcher_support { 13 14enum InstallationLevel { 15 USER_LEVEL_INSTALLATION, 16 SYSTEM_LEVEL_INSTALLATION, 17}; 18 19enum InstallationState { 20 NOT_INSTALLED, 21 INSTALLED_AT_USER_LEVEL, 22 INSTALLED_AT_SYSTEM_LEVEL, 23}; 24 25// Returns the path to an existing setup.exe at the specified level, if it can 26// be found via Omaha client state. 27base::FilePath GetSetupExeForInstallationLevel(InstallationLevel level); 28 29// Returns the path to an installed chrome.exe at the specified level, if it can 30// be found via Omaha client state. Prefers the installer from a multi-install, 31// but may also return that of a single-install of Chrome if no multi-install 32// exists. 33base::FilePath GetChromePathForInstallationLevel(InstallationLevel level); 34 35// Returns the path to an installed app_host.exe at the specified level, if 36// it can be found via Omaha client state. 37base::FilePath GetAppHostPathForInstallationLevel(InstallationLevel level); 38 39// Returns the path to an installed chrome.exe, or an empty path. Prefers a 40// system-level installation to a user-level installation. Uses Omaha client 41// state to identify a Chrome installation location. 42// In non-official builds, to ease development, this will first look for a 43// chrome.exe in the same directory as the current executable. 44// The file path returned (if any) is guaranteed to exist. 45base::FilePath GetAnyChromePath(); 46 47// Returns the path to an installed app_host.exe, or an empty path. Prefers a 48// system-level installation to a user-level installation. Uses Omaha client 49// state to identify a App Host installation location. 50// In non-official builds, to ease development, this will first look for a 51// app_host.exe in the same directory as the current executable. 52// The file path returned (if any) is guaranteed to exist. 53base::FilePath GetAnyAppHostPath(); 54 55// Uninstalls the legacy app launcher by launching setup.exe with the uninstall 56// arguments from the App Launcher ClientState registry key. The uninstall will 57// run asynchronously. 58void UninstallLegacyAppLauncher(InstallationLevel level); 59 60// Returns true if App Host is installed (system-level or user-level), 61// or in the same directory as the current executable. 62bool IsAppHostPresent(); 63 64// Returns the app launcher installation state. If the launcher is installed 65// at both system level and user level, system level is returned. 66InstallationState GetAppLauncherInstallationState(); 67 68// Returns true if App Launcher is installed (system-level or user-level). 69bool IsAppLauncherPresent(); 70 71// Returns true if the Chrome browser is installed (system-level or user-level). 72// If this is running in an official build, it will check if a non-canary build 73// if installed. If it is not an official build, it will always return true. 74bool IsChromeBrowserPresent(); 75 76} // namespace chrome_launcher_support 77 78#endif // CHROME_INSTALLER_LAUNCHER_SUPPORT_CHROME_LAUNCHER_SUPPORT_H_ 79