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

Side by Side Diff: chrome/browser/extensions/extension_warning_set.cc

Issue 9433044: Fix extensions compile issues for Android on sync_unit_tests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Tracked issue for default_height in a bug and put bug # here. Created 8 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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"
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 bool inserted = warnings_.insert(warning).second; 104 bool inserted = warnings_.insert(warning).second;
105 if (inserted) { 105 if (inserted) {
106 NotifyWarningsChanged(); 106 NotifyWarningsChanged();
107 UpdateWarningBadge(); 107 UpdateWarningBadge();
108 } 108 }
109 } 109 }
110 110
111 void ExtensionWarningSet::ClearWarnings( 111 void ExtensionWarningSet::ClearWarnings(
112 const std::set<ExtensionWarningSet::WarningType>& types) { 112 const std::set<ExtensionWarningSet::WarningType>& types) {
113 bool deleted_anything = false; 113 bool deleted_anything = false;
114 for (const_iterator i = warnings_.begin(); i != warnings_.end();) { 114 for (iterator i = warnings_.begin(); i != warnings_.end();) {
asargent_no_longer_on_chrome 2012/02/22 21:47:55 Out of curiousity, are you switching to using a no
David Trainor- moved to gerrit 2012/02/22 21:51:42 It looks like our Android stl port of std::set doe
115 if (types.find(i->warning_type()) != types.end()) { 115 if (types.find(i->warning_type()) != types.end()) {
116 deleted_anything = true; 116 deleted_anything = true;
117 warnings_.erase(i++); 117 warnings_.erase(i++);
118 } else { 118 } else {
119 ++i; 119 ++i;
120 } 120 }
121 } 121 }
122 122
123 if (deleted_anything) { 123 if (deleted_anything) {
124 NotifyWarningsChanged(); 124 NotifyWarningsChanged();
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
185 ExtensionGlobalErrorBadge::GetMenuItemCommandID()); 185 ExtensionGlobalErrorBadge::GetMenuItemCommandID());
186 186
187 // Activate or hide the warning badge in case the current state is incorrect. 187 // Activate or hide the warning badge in case the current state is incorrect.
188 if (error && !need_warning_badge) { 188 if (error && !need_warning_badge) {
189 service->RemoveGlobalError(error); 189 service->RemoveGlobalError(error);
190 delete error; 190 delete error;
191 } else if (!error && need_warning_badge) { 191 } else if (!error && need_warning_badge) {
192 service->AddGlobalError(new ExtensionGlobalErrorBadge); 192 service->AddGlobalError(new ExtensionGlobalErrorBadge);
193 } 193 }
194 } 194 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698