| 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 ExtensionService::ExtensionWarningsType warnings = |
| 42 extension_service->GetWarnings(); |
| 43 for (ExtensionService::ExtensionWarningsType::const_iterator i = |
| 44 warnings.begin(); |
| 45 i != warnings.end(); ++i) { |
| 46 extension_service->SuppressWarning(i->first); |
| 47 } |
| 48 |
| 49 browser->ExecuteCommand(IDC_MANAGE_EXTENSIONS); |
| 50 } |
| 51 |
| 52 bool ExtensionGlobalError::HasBubbleView() { |
| 53 return false; |
| 54 } |
| 55 |
| 56 string16 ExtensionGlobalError::GetBubbleViewTitle() { |
| 57 return string16(); |
| 58 } |
| 59 |
| 60 string16 ExtensionGlobalError::GetBubbleViewMessage() { |
| 61 return string16(); |
| 62 } |
| 63 |
| 64 string16 ExtensionGlobalError::GetBubbleViewAcceptButtonLabel() { |
| 65 return string16(); |
| 66 } |
| 67 |
| 68 string16 ExtensionGlobalError::GetBubbleViewCancelButtonLabel() { |
| 69 return string16(); |
| 70 } |
| 71 |
| 72 void ExtensionGlobalError::BubbleViewDidClose() { |
| 73 } |
| 74 |
| 75 void ExtensionGlobalError::BubbleViewAcceptButtonPressed() { |
| 76 NOTREACHED(); |
| 77 } |
| 78 |
| 79 void ExtensionGlobalError::BubbleViewCancelButtonPressed() { |
| 80 NOTREACHED(); |
| 81 } |
| OLD | NEW |