| 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/profiles/profile.h" | 9 #include "chrome/browser/profiles/profile.h" |
| 10 #include "chrome/browser/ui/browser_commands.h" | 10 #include "chrome/browser/ui/browser_commands.h" |
| 11 #include "chrome/browser/ui/global_error/global_error.h" | 11 #include "chrome/browser/ui/global_error/global_error.h" |
| 12 #include "chrome/browser/ui/global_error/global_error_service.h" | 12 #include "chrome/browser/ui/global_error/global_error_service.h" |
| 13 #include "chrome/browser/ui/global_error/global_error_service_factory.h" | 13 #include "chrome/browser/ui/global_error/global_error_service_factory.h" |
| 14 #include "chrome/grit/generated_resources.h" |
| 14 #include "extensions/browser/extension_system.h" | 15 #include "extensions/browser/extension_system.h" |
| 15 #include "grit/generated_resources.h" | |
| 16 #include "ui/base/l10n/l10n_util.h" | 16 #include "ui/base/l10n/l10n_util.h" |
| 17 | 17 |
| 18 namespace extensions { | 18 namespace extensions { |
| 19 | 19 |
| 20 namespace { | 20 namespace { |
| 21 // Non-modal GlobalError implementation that warns the user if extensions | 21 // Non-modal GlobalError implementation that warns the user if extensions |
| 22 // created warnings or errors. If the user clicks on the wrench menu, the user | 22 // created warnings or errors. If the user clicks on the wrench menu, the user |
| 23 // is redirected to chrome://extensions to inspect the errors. | 23 // is redirected to chrome://extensions to inspect the errors. |
| 24 class ErrorBadge : public GlobalError { | 24 class ErrorBadge : public GlobalError { |
| 25 public: | 25 public: |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 138 // Activate or hide the warning badge in case the current state is incorrect. | 138 // Activate or hide the warning badge in case the current state is incorrect. |
| 139 if (error && !show) { | 139 if (error && !show) { |
| 140 service->RemoveGlobalError(error); | 140 service->RemoveGlobalError(error); |
| 141 delete error; | 141 delete error; |
| 142 } else if (!error && show) { | 142 } else if (!error && show) { |
| 143 service->AddGlobalError(new ErrorBadge(this)); | 143 service->AddGlobalError(new ErrorBadge(this)); |
| 144 } | 144 } |
| 145 } | 145 } |
| 146 | 146 |
| 147 } // namespace extensions | 147 } // namespace extensions |
| OLD | NEW |