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