| Index: chrome/browser/extensions/extension_global_error.cc
|
| diff --git a/chrome/browser/extensions/extension_global_error.cc b/chrome/browser/extensions/extension_global_error.cc
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..6e770df247a6c4072e2a3428ff3b04b48281ad15
|
| --- /dev/null
|
| +++ b/chrome/browser/extensions/extension_global_error.cc
|
| @@ -0,0 +1,81 @@
|
| +// Copyright (c) 2011 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.
|
| +
|
| +#include "chrome/browser/extensions/extension_global_error.h"
|
| +
|
| +#include "base/logging.h"
|
| +#include "chrome/app/chrome_command_ids.h"
|
| +#include "chrome/browser/extensions/extension_service.h"
|
| +#include "chrome/browser/profiles/profile.h"
|
| +#include "chrome/browser/ui/browser.h"
|
| +#include "grit/generated_resources.h"
|
| +#include "ui/base/l10n/l10n_util.h"
|
| +
|
| +ExtensionGlobalError::ExtensionGlobalError() {}
|
| +
|
| +ExtensionGlobalError::~ExtensionGlobalError() {}
|
| +
|
| +bool ExtensionGlobalError::HasBadge() {
|
| + return true;
|
| +}
|
| +
|
| +bool ExtensionGlobalError::HasMenuItem() {
|
| + return true;
|
| +}
|
| +
|
| +int ExtensionGlobalError::MenuItemCommandID() {
|
| + return IDC_EXTENSION_ERRORS;
|
| +}
|
| +
|
| +string16 ExtensionGlobalError::MenuItemLabel() {
|
| + return l10n_util::GetStringUTF16(IDS_EXTENSION_WARNINGS_WRENCH_MENU_ITEM);
|
| +}
|
| +
|
| +void ExtensionGlobalError::ExecuteMenuItem(Browser* browser) {
|
| + ExtensionService* extension_service =
|
| + browser->GetProfile()->GetExtensionService();
|
| +
|
| + // Suppress all current warnings in the extension service from triggering
|
| + // a badge on the wrench menu in the future of this session.
|
| + ExtensionService::ExtensionWarningsType warnings =
|
| + extension_service->GetWarnings();
|
| + for (ExtensionService::ExtensionWarningsType::const_iterator i =
|
| + warnings.begin();
|
| + i != warnings.end(); ++i) {
|
| + extension_service->SuppressWarning(i->first);
|
| + }
|
| +
|
| + browser->ExecuteCommand(IDC_MANAGE_EXTENSIONS);
|
| +}
|
| +
|
| +bool ExtensionGlobalError::HasBubbleView() {
|
| + return false;
|
| +}
|
| +
|
| +string16 ExtensionGlobalError::GetBubbleViewTitle() {
|
| + return string16();
|
| +}
|
| +
|
| +string16 ExtensionGlobalError::GetBubbleViewMessage() {
|
| + return string16();
|
| +}
|
| +
|
| +string16 ExtensionGlobalError::GetBubbleViewAcceptButtonLabel() {
|
| + return string16();
|
| +}
|
| +
|
| +string16 ExtensionGlobalError::GetBubbleViewCancelButtonLabel() {
|
| + return string16();
|
| +}
|
| +
|
| +void ExtensionGlobalError::BubbleViewDidClose() {
|
| +}
|
| +
|
| +void ExtensionGlobalError::BubbleViewAcceptButtonPressed() {
|
| + NOTREACHED();
|
| +}
|
| +
|
| +void ExtensionGlobalError::BubbleViewCancelButtonPressed() {
|
| + NOTREACHED();
|
| +}
|
|
|