| OLD | NEW |
| (Empty) |
| 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 #include "chrome/browser/extensions/extension_global_error_badge.h" | |
| 6 | |
| 7 #include "base/logging.h" | |
| 8 #include "chrome/app/chrome_command_ids.h" | |
| 9 #include "chrome/browser/extensions/extension_service.h" | |
| 10 #include "chrome/browser/profiles/profile.h" | |
| 11 #include "chrome/browser/ui/browser.h" | |
| 12 #include "chrome/browser/ui/browser_commands.h" | |
| 13 #include "grit/generated_resources.h" | |
| 14 #include "ui/base/l10n/l10n_util.h" | |
| 15 | |
| 16 ExtensionGlobalErrorBadge::ExtensionGlobalErrorBadge() {} | |
| 17 | |
| 18 ExtensionGlobalErrorBadge::~ExtensionGlobalErrorBadge() {} | |
| 19 | |
| 20 bool ExtensionGlobalErrorBadge::HasBadge() { | |
| 21 return true; | |
| 22 } | |
| 23 | |
| 24 bool ExtensionGlobalErrorBadge::HasMenuItem() { | |
| 25 return true; | |
| 26 } | |
| 27 | |
| 28 int ExtensionGlobalErrorBadge::MenuItemCommandID() { | |
| 29 return GetMenuItemCommandID(); | |
| 30 } | |
| 31 | |
| 32 string16 ExtensionGlobalErrorBadge::MenuItemLabel() { | |
| 33 return l10n_util::GetStringUTF16(IDS_EXTENSION_WARNINGS_WRENCH_MENU_ITEM); | |
| 34 } | |
| 35 | |
| 36 void ExtensionGlobalErrorBadge::ExecuteMenuItem(Browser* browser) { | |
| 37 ExtensionService* extension_service = | |
| 38 browser->profile()->GetExtensionService(); | |
| 39 | |
| 40 // Suppress all current warnings in the extension service from triggering | |
| 41 // a badge on the wrench menu in the future of this session. | |
| 42 extension_service->extension_warnings()->SuppressBadgeForCurrentWarnings(); | |
| 43 | |
| 44 chrome::ExecuteCommand(browser, IDC_MANAGE_EXTENSIONS); | |
| 45 } | |
| 46 | |
| 47 bool ExtensionGlobalErrorBadge::HasBubbleView() { | |
| 48 return false; | |
| 49 } | |
| 50 | |
| 51 string16 ExtensionGlobalErrorBadge::GetBubbleViewTitle() { | |
| 52 return string16(); | |
| 53 } | |
| 54 | |
| 55 string16 ExtensionGlobalErrorBadge::GetBubbleViewMessage() { | |
| 56 return string16(); | |
| 57 } | |
| 58 | |
| 59 string16 ExtensionGlobalErrorBadge::GetBubbleViewAcceptButtonLabel() { | |
| 60 return string16(); | |
| 61 } | |
| 62 | |
| 63 string16 ExtensionGlobalErrorBadge::GetBubbleViewCancelButtonLabel() { | |
| 64 return string16(); | |
| 65 } | |
| 66 | |
| 67 void ExtensionGlobalErrorBadge::OnBubbleViewDidClose(Browser* browser) { | |
| 68 } | |
| 69 | |
| 70 void ExtensionGlobalErrorBadge::BubbleViewAcceptButtonPressed( | |
| 71 Browser* browser) { | |
| 72 NOTREACHED(); | |
| 73 } | |
| 74 | |
| 75 void ExtensionGlobalErrorBadge::BubbleViewCancelButtonPressed( | |
| 76 Browser* browser) { | |
| 77 NOTREACHED(); | |
| 78 } | |
| 79 | |
| 80 // static | |
| 81 int ExtensionGlobalErrorBadge::GetMenuItemCommandID() { | |
| 82 return IDC_EXTENSION_ERRORS; | |
| 83 } | |
| OLD | NEW |