| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/extensions/extension_warning_badge_service.h" | 5 #include "chrome/browser/extensions/extension_warning_badge_service.h" |
| 6 | 6 |
| 7 #include "base/stl_util.h" | 7 #include "base/stl_util.h" |
| 8 #include "chrome/app/chrome_command_ids.h" | 8 #include "chrome/app/chrome_command_ids.h" |
| 9 #include "chrome/browser/extensions/extension_system.h" | 9 #include "chrome/browser/extensions/extension_system.h" |
| 10 #include "chrome/browser/ui/global_error/global_error.h" | 10 #include "chrome/browser/ui/global_error/global_error.h" |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 virtual ~ErrorBadge(); | 26 virtual ~ErrorBadge(); |
| 27 | 27 |
| 28 // Implementation for GlobalError: | 28 // Implementation for GlobalError: |
| 29 virtual bool HasMenuItem() OVERRIDE; | 29 virtual bool HasMenuItem() OVERRIDE; |
| 30 virtual int MenuItemCommandID() OVERRIDE; | 30 virtual int MenuItemCommandID() OVERRIDE; |
| 31 virtual string16 MenuItemLabel() OVERRIDE; | 31 virtual string16 MenuItemLabel() OVERRIDE; |
| 32 virtual void ExecuteMenuItem(Browser* browser) OVERRIDE; | 32 virtual void ExecuteMenuItem(Browser* browser) OVERRIDE; |
| 33 | 33 |
| 34 virtual bool HasBubbleView() OVERRIDE; | 34 virtual bool HasBubbleView() OVERRIDE; |
| 35 virtual string16 GetBubbleViewTitle() OVERRIDE; | 35 virtual string16 GetBubbleViewTitle() OVERRIDE; |
| 36 virtual string16 GetBubbleViewMessage() OVERRIDE; | 36 virtual std::vector<string16> GetBubbleViewMessages() OVERRIDE; |
| 37 virtual string16 GetBubbleViewAcceptButtonLabel() OVERRIDE; | 37 virtual string16 GetBubbleViewAcceptButtonLabel() OVERRIDE; |
| 38 virtual string16 GetBubbleViewCancelButtonLabel() OVERRIDE; | 38 virtual string16 GetBubbleViewCancelButtonLabel() OVERRIDE; |
| 39 virtual void OnBubbleViewDidClose(Browser* browser) OVERRIDE; | 39 virtual void OnBubbleViewDidClose(Browser* browser) OVERRIDE; |
| 40 virtual void BubbleViewAcceptButtonPressed(Browser* browser) OVERRIDE; | 40 virtual void BubbleViewAcceptButtonPressed(Browser* browser) OVERRIDE; |
| 41 virtual void BubbleViewCancelButtonPressed(Browser* browser) OVERRIDE; | 41 virtual void BubbleViewCancelButtonPressed(Browser* browser) OVERRIDE; |
| 42 | 42 |
| 43 static int GetMenuItemCommandID(); | 43 static int GetMenuItemCommandID(); |
| 44 | 44 |
| 45 private: | 45 private: |
| 46 ExtensionWarningBadgeService* badge_service_; | 46 ExtensionWarningBadgeService* badge_service_; |
| (...skipping 27 matching lines...) Expand all Loading... |
| 74 } | 74 } |
| 75 | 75 |
| 76 bool ErrorBadge::HasBubbleView() { | 76 bool ErrorBadge::HasBubbleView() { |
| 77 return false; | 77 return false; |
| 78 } | 78 } |
| 79 | 79 |
| 80 string16 ErrorBadge::GetBubbleViewTitle() { | 80 string16 ErrorBadge::GetBubbleViewTitle() { |
| 81 return string16(); | 81 return string16(); |
| 82 } | 82 } |
| 83 | 83 |
| 84 string16 ErrorBadge::GetBubbleViewMessage() { | 84 std::vector<string16> ErrorBadge::GetBubbleViewMessages() { |
| 85 return string16(); | 85 return std::vector<string16>(); |
| 86 } | 86 } |
| 87 | 87 |
| 88 string16 ErrorBadge::GetBubbleViewAcceptButtonLabel() { | 88 string16 ErrorBadge::GetBubbleViewAcceptButtonLabel() { |
| 89 return string16(); | 89 return string16(); |
| 90 } | 90 } |
| 91 | 91 |
| 92 string16 ErrorBadge::GetBubbleViewCancelButtonLabel() { | 92 string16 ErrorBadge::GetBubbleViewCancelButtonLabel() { |
| 93 return string16(); | 93 return string16(); |
| 94 } | 94 } |
| 95 | 95 |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 162 // Activate or hide the warning badge in case the current state is incorrect. | 162 // Activate or hide the warning badge in case the current state is incorrect. |
| 163 if (error && !show) { | 163 if (error && !show) { |
| 164 service->RemoveGlobalError(error); | 164 service->RemoveGlobalError(error); |
| 165 delete error; | 165 delete error; |
| 166 } else if (!error && show) { | 166 } else if (!error && show) { |
| 167 service->AddGlobalError(new ErrorBadge(this)); | 167 service->AddGlobalError(new ErrorBadge(this)); |
| 168 } | 168 } |
| 169 } | 169 } |
| 170 | 170 |
| 171 } // extensions | 171 } // extensions |
| OLD | NEW |