Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(340)

Unified Diff: chrome/browser/extensions/extension_global_error_badge.cc

Issue 8176001: Warn user in case extension delays network traffic too much. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Merged with ToT Created 9 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/extensions/extension_global_error_badge.cc
diff --git a/chrome/browser/extensions/extension_global_error_badge.cc b/chrome/browser/extensions/extension_global_error_badge.cc
new file mode 100644
index 0000000000000000000000000000000000000000..8124dc8f0848fd5c1103dbb22585a449114f670c
--- /dev/null
+++ b/chrome/browser/extensions/extension_global_error_badge.cc
@@ -0,0 +1,75 @@
+// 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_badge.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"
+
+ExtensionGlobalErrorBadge::ExtensionGlobalErrorBadge() {}
+
+ExtensionGlobalErrorBadge::~ExtensionGlobalErrorBadge() {}
+
+bool ExtensionGlobalErrorBadge::HasBadge() {
+ return true;
+}
+
+bool ExtensionGlobalErrorBadge::HasMenuItem() {
+ return true;
+}
+
+int ExtensionGlobalErrorBadge::MenuItemCommandID() {
+ return IDC_EXTENSION_ERRORS;
+}
+
+string16 ExtensionGlobalErrorBadge::MenuItemLabel() {
+ return l10n_util::GetStringUTF16(IDS_EXTENSION_WARNINGS_WRENCH_MENU_ITEM);
+}
+
+void ExtensionGlobalErrorBadge::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.
+ extension_service->extension_warnings()->SuppressBadgeForCurrentWarnings();
+
+ browser->ExecuteCommand(IDC_MANAGE_EXTENSIONS);
+}
+
+bool ExtensionGlobalErrorBadge::HasBubbleView() {
+ return false;
+}
+
+string16 ExtensionGlobalErrorBadge::GetBubbleViewTitle() {
+ return string16();
+}
+
+string16 ExtensionGlobalErrorBadge::GetBubbleViewMessage() {
+ return string16();
+}
+
+string16 ExtensionGlobalErrorBadge::GetBubbleViewAcceptButtonLabel() {
+ return string16();
+}
+
+string16 ExtensionGlobalErrorBadge::GetBubbleViewCancelButtonLabel() {
+ return string16();
+}
+
+void ExtensionGlobalErrorBadge::BubbleViewDidClose() {
+}
+
+void ExtensionGlobalErrorBadge::BubbleViewAcceptButtonPressed() {
+ NOTREACHED();
+}
+
+void ExtensionGlobalErrorBadge::BubbleViewCancelButtonPressed() {
+ NOTREACHED();
+}
« no previous file with comments | « chrome/browser/extensions/extension_global_error_badge.h ('k') | chrome/browser/extensions/extension_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698