| Index: chrome/browser/installable/installable_logging.h
|
| diff --git a/chrome/browser/installable/installable_logging.h b/chrome/browser/installable/installable_logging.h
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..342448c21a9b4143c29043687671aa40d4086afb
|
| --- /dev/null
|
| +++ b/chrome/browser/installable/installable_logging.h
|
| @@ -0,0 +1,54 @@
|
| +// Copyright 2016 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#ifndef CHROME_BROWSER_INSTALLABLE_INSTALLABLE_LOGGING_H_
|
| +#define CHROME_BROWSER_INSTALLABLE_INSTALLABLE_LOGGING_H_
|
| +
|
| +#include <string>
|
| +
|
| +namespace content {
|
| +class WebContents;
|
| +}
|
| +
|
| +namespace installable {
|
| +
|
| +// These values are a central reference for installability errors. The
|
| +// InstallableChecker will specify an ErrorCode (or NO_ERROR) in its result.
|
| +// Clients of the InstallableChecker may also add their own error codes to this
|
| +// list, and utilise the LogErrorToConsole method to write a message to the
|
| +// devtools console informing users of any issues.
|
| +// TODO(dominickn) add an UMA metric for this enum.
|
| +enum ErrorCode {
|
| + NO_ERROR,
|
| + RENDERER_EXITING,
|
| + RENDERER_CANCELLED,
|
| + USER_NAVIGATED,
|
| + NOT_IN_MAIN_FRAME,
|
| + NOT_FROM_SECURE_ORIGIN,
|
| + NO_MANIFEST,
|
| + MANIFEST_EMPTY,
|
| + START_URL_NOT_VALID,
|
| + MANIFEST_MISSING_NAME_OR_SHORT_NAME,
|
| + MANIFEST_DISPLAY_NOT_SUPPORTED,
|
| + MANIFEST_MISSING_SUITABLE_ICON,
|
| + NO_MATCHING_SERVICE_WORKER,
|
| + NO_ACCEPTABLE_ICON,
|
| + CANNOT_DOWNLOAD_ICON,
|
| + NO_ICON_AVAILABLE,
|
| + PLATFORM_NOT_SUPPORTED_ON_ANDROID,
|
| + NO_ID_SPECIFIED,
|
| + IDS_DO_NOT_MATCH,
|
| + MAX_ERROR_CODE,
|
| +};
|
| +
|
| +// Logs a message associated with |code| with a parameter |param| to the
|
| +// devtools console attached to |web_contents|. Does nothing if |web_contents|
|
| +// is nullptr.
|
| +void LogErrorToConsole(content::WebContents* web_contents,
|
| + ErrorCode code,
|
| + const std::string& param);
|
| +
|
| +} // namespace installable
|
| +
|
| +#endif // CHROME_BROWSER_INSTALLABLE_INSTALLABLE_LOGGING_H_
|
|
|