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

Unified Diff: chrome/browser/ui/global_error_service.cc

Issue 8844003: Send notifications to off-the-record profile about error bubble being added/removed. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Showing Protector bubble for Incognito windows Created 9 years 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
« no previous file with comments | « chrome/browser/protector/settings_change_global_error.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/global_error_service.cc
diff --git a/chrome/browser/ui/global_error_service.cc b/chrome/browser/ui/global_error_service.cc
index 3e47cc89f2fd8b75c9041175247661225af37744..19bd38a491a5077414f5fb6eb2d2425f131f703d 100644
--- a/chrome/browser/ui/global_error_service.cc
+++ b/chrome/browser/ui/global_error_service.cc
@@ -7,6 +7,7 @@
#include <algorithm>
#include "base/stl_util.h"
+#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/global_error.h"
#include "chrome/common/chrome_notification_types.h"
#include "content/public/browser/notification_service.h"
@@ -60,8 +61,18 @@ GlobalError* GlobalErrorService::GetFirstGlobalErrorWithBubbleView() const {
}
void GlobalErrorService::NotifyErrorsChanged(GlobalError* error) {
- content::NotificationService::current()->Notify(
- chrome::NOTIFICATION_GLOBAL_ERRORS_CHANGED,
- content::Source<Profile>(profile_),
- content::Details<GlobalError>(error));
+ std::vector<Profile*> profiles_to_notify;
sail 2011/12/08 17:44:45 can you add a DCHECK() for ServiceRedirectedInInco
whywhat 2011/12/09 11:14:33 I've added comment. How can I check ServiceRedirec
sail 2011/12/09 17:43:51 Ahh damn, never mind.
+ if (profile_ != NULL) {
+ profiles_to_notify.push_back(profile_);
+ if (profile_->IsOffTheRecord())
+ profiles_to_notify.push_back(profile_->GetOriginalProfile());
+ else if (profile_->HasOffTheRecordProfile())
+ profiles_to_notify.push_back(profile_->GetOffTheRecordProfile());
+ for (size_t i = 0; i < profiles_to_notify.size(); ++i) {
+ content::NotificationService::current()->Notify(
+ chrome::NOTIFICATION_GLOBAL_ERRORS_CHANGED,
+ content::Source<Profile>(profiles_to_notify[i]),
+ content::Details<GlobalError>(error));
+ }
+ }
}
« no previous file with comments | « chrome/browser/protector/settings_change_global_error.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698