Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(176)

Unified Diff: chrome/browser/extensions/warning_badge_service.cc

Issue 921423003: Rename ExtensionWarningBadgeService to WarningBadgeService (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/extensions/warning_badge_service.cc
diff --git a/chrome/browser/extensions/extension_warning_badge_service.cc b/chrome/browser/extensions/warning_badge_service.cc
similarity index 75%
rename from chrome/browser/extensions/extension_warning_badge_service.cc
rename to chrome/browser/extensions/warning_badge_service.cc
index 7afb6fcb4b490090bf2f6ee4e516b074892a139d..a3358ec618ddb245f8b102230f6aef548a015f96 100644
--- a/chrome/browser/extensions/extension_warning_badge_service.cc
+++ b/chrome/browser/extensions/warning_badge_service.cc
@@ -2,11 +2,11 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/browser/extensions/extension_warning_badge_service.h"
+#include "chrome/browser/extensions/warning_badge_service.h"
#include "base/stl_util.h"
#include "chrome/app/chrome_command_ids.h"
-#include "chrome/browser/extensions/extension_warning_badge_service_factory.h"
+#include "chrome/browser/extensions/warning_badge_service_factory.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/browser_commands.h"
#include "chrome/browser/ui/global_error/global_error.h"
@@ -23,7 +23,7 @@ namespace {
// is redirected to chrome://extensions to inspect the errors.
class ErrorBadge : public GlobalError {
public:
- explicit ErrorBadge(ExtensionWarningBadgeService* badge_service);
+ explicit ErrorBadge(WarningBadgeService* badge_service);
~ErrorBadge() override;
// Implementation for GlobalError:
@@ -40,15 +40,17 @@ class ErrorBadge : public GlobalError {
static int GetMenuItemCommandID();
private:
- ExtensionWarningBadgeService* badge_service_;
+ WarningBadgeService* badge_service_;
DISALLOW_COPY_AND_ASSIGN(ErrorBadge);
};
-ErrorBadge::ErrorBadge(ExtensionWarningBadgeService* badge_service)
- : badge_service_(badge_service) {}
+ErrorBadge::ErrorBadge(WarningBadgeService* badge_service)
+ : badge_service_(badge_service) {
+}
-ErrorBadge::~ErrorBadge() {}
+ErrorBadge::~ErrorBadge() {
+}
bool ErrorBadge::HasMenuItem() {
return true;
@@ -70,11 +72,17 @@ void ErrorBadge::ExecuteMenuItem(Browser* browser) {
chrome::ExecuteCommand(browser, IDC_MANAGE_EXTENSIONS);
}
-bool ErrorBadge::HasBubbleView() { return false; }
+bool ErrorBadge::HasBubbleView() {
+ return false;
+}
-bool ErrorBadge::HasShownBubbleView() { return false; }
+bool ErrorBadge::HasShownBubbleView() {
+ return false;
+}
-void ErrorBadge::ShowBubbleView(Browser* browser) { NOTREACHED(); }
+void ErrorBadge::ShowBubbleView(Browser* browser) {
+ NOTREACHED();
+}
GlobalErrorBubbleViewBase* ErrorBadge::GetBubbleView() {
return NULL;
@@ -87,21 +95,22 @@ int ErrorBadge::GetMenuItemCommandID() {
} // namespace
-ExtensionWarningBadgeService::ExtensionWarningBadgeService(Profile* profile)
+WarningBadgeService::WarningBadgeService(Profile* profile)
: profile_(profile), warning_service_observer_(this) {
DCHECK(CalledOnValidThread());
warning_service_observer_.Add(WarningService::Get(profile_));
}
-ExtensionWarningBadgeService::~ExtensionWarningBadgeService() {}
+WarningBadgeService::~WarningBadgeService() {
+}
// static
-ExtensionWarningBadgeService* ExtensionWarningBadgeService::Get(
+WarningBadgeService* WarningBadgeService::Get(
content::BrowserContext* context) {
- return ExtensionWarningBadgeServiceFactory::GetForBrowserContext(context);
+ return WarningBadgeServiceFactory::GetForBrowserContext(context);
}
-void ExtensionWarningBadgeService::SuppressCurrentWarnings() {
+void WarningBadgeService::SuppressCurrentWarnings() {
DCHECK(CalledOnValidThread());
size_t old_size = suppressed_warnings_.size();
@@ -112,16 +121,16 @@ void ExtensionWarningBadgeService::SuppressCurrentWarnings() {
UpdateBadgeStatus();
}
-const WarningSet& ExtensionWarningBadgeService::GetCurrentWarnings() const {
+const WarningSet& WarningBadgeService::GetCurrentWarnings() const {
return WarningService::Get(profile_)->warnings();
}
-void ExtensionWarningBadgeService::ExtensionWarningsChanged() {
+void WarningBadgeService::ExtensionWarningsChanged() {
DCHECK(CalledOnValidThread());
UpdateBadgeStatus();
}
-void ExtensionWarningBadgeService::UpdateBadgeStatus() {
+void WarningBadgeService::UpdateBadgeStatus() {
const std::set<Warning>& warnings = GetCurrentWarnings();
bool non_suppressed_warnings_exist = false;
for (std::set<Warning>::const_iterator i = warnings.begin();
@@ -134,7 +143,7 @@ void ExtensionWarningBadgeService::UpdateBadgeStatus() {
ShowBadge(non_suppressed_warnings_exist);
}
-void ExtensionWarningBadgeService::ShowBadge(bool show) {
+void WarningBadgeService::ShowBadge(bool show) {
GlobalErrorService* service =
GlobalErrorServiceFactory::GetForProfile(profile_);
GlobalError* error = service->GetGlobalErrorByMenuItemCommandID(
« no previous file with comments | « chrome/browser/extensions/warning_badge_service.h ('k') | chrome/browser/extensions/warning_badge_service_factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698