| 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_set.h" | 5 #include "chrome/browser/extensions/extension_warning_set.h" |
| 6 | 6 |
| 7 #include "chrome/browser/browser_process.h" | 7 #include "chrome/browser/browser_process.h" |
| 8 #include "chrome/browser/extensions/extension_global_error_badge.h" | 8 #include "chrome/browser/extensions/extension_global_error_badge.h" |
| 9 #include "chrome/browser/extensions/extension_service.h" | 9 #include "chrome/browser/extensions/extension_service.h" |
| 10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
| 11 #include "chrome/browser/profiles/profile_manager.h" | 11 #include "chrome/browser/profiles/profile_manager.h" |
| 12 #include "chrome/browser/ui/global_error_service.h" | 12 #include "chrome/browser/ui/global_error/global_error_service.h" |
| 13 #include "chrome/browser/ui/global_error_service_factory.h" | 13 #include "chrome/browser/ui/global_error/global_error_service_factory.h" |
| 14 #include "chrome/common/chrome_notification_types.h" | 14 #include "chrome/common/chrome_notification_types.h" |
| 15 #include "content/public/browser/browser_thread.h" | 15 #include "content/public/browser/browser_thread.h" |
| 16 #include "content/public/browser/notification_service.h" | 16 #include "content/public/browser/notification_service.h" |
| 17 #include "grit/chromium_strings.h" | 17 #include "grit/chromium_strings.h" |
| 18 #include "grit/generated_resources.h" | 18 #include "grit/generated_resources.h" |
| 19 #include "ui/base/l10n/l10n_util.h" | 19 #include "ui/base/l10n/l10n_util.h" |
| 20 | 20 |
| 21 using content::BrowserThread; | 21 using content::BrowserThread; |
| 22 | 22 |
| 23 // This class is used to represent warnings if extensions misbehave. | 23 // This class is used to represent warnings if extensions misbehave. |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 186 ExtensionGlobalErrorBadge::GetMenuItemCommandID()); | 186 ExtensionGlobalErrorBadge::GetMenuItemCommandID()); |
| 187 | 187 |
| 188 // Activate or hide the warning badge in case the current state is incorrect. | 188 // Activate or hide the warning badge in case the current state is incorrect. |
| 189 if (error && !need_warning_badge) { | 189 if (error && !need_warning_badge) { |
| 190 service->RemoveGlobalError(error); | 190 service->RemoveGlobalError(error); |
| 191 delete error; | 191 delete error; |
| 192 } else if (!error && need_warning_badge) { | 192 } else if (!error && need_warning_badge) { |
| 193 service->AddGlobalError(new ExtensionGlobalErrorBadge); | 193 service->AddGlobalError(new ExtensionGlobalErrorBadge); |
| 194 } | 194 } |
| 195 } | 195 } |
| OLD | NEW |