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

Side by Side Diff: chrome/browser/ui/global_error_service.cc

Issue 8342048: Make NotificationService an interface in the content namespace, and switch callers to use it. Mov... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 2 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/ui/global_error_service.h" 5 #include "chrome/browser/ui/global_error_service.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/stl_util.h" 9 #include "base/stl_util.h"
10 #include "chrome/browser/ui/global_error.h" 10 #include "chrome/browser/ui/global_error.h"
11 #include "chrome/common/chrome_notification_types.h" 11 #include "chrome/common/chrome_notification_types.h"
12 #include "content/common/notification_service.h" 12 #include "content/public/browser/notification_service.h"
13 13
14 GlobalErrorService::GlobalErrorService(Profile* profile) : profile_(profile) { 14 GlobalErrorService::GlobalErrorService(Profile* profile) : profile_(profile) {
15 } 15 }
16 16
17 GlobalErrorService::~GlobalErrorService() { 17 GlobalErrorService::~GlobalErrorService() {
18 STLDeleteElements(&errors_); 18 STLDeleteElements(&errors_);
19 } 19 }
20 20
21 void GlobalErrorService::AddGlobalError(GlobalError* error) { 21 void GlobalErrorService::AddGlobalError(GlobalError* error) {
22 errors_.push_back(error); 22 errors_.push_back(error);
(...skipping 30 matching lines...) Expand all
53 for (std::vector<GlobalError*>::const_iterator 53 for (std::vector<GlobalError*>::const_iterator
54 it = errors_.begin(); it != errors_.end(); ++it) { 54 it = errors_.begin(); it != errors_.end(); ++it) {
55 GlobalError* error = *it; 55 GlobalError* error = *it;
56 if (error->HasBubbleView() && !error->HasShownBubbleView()) 56 if (error->HasBubbleView() && !error->HasShownBubbleView())
57 return error; 57 return error;
58 } 58 }
59 return NULL; 59 return NULL;
60 } 60 }
61 61
62 void GlobalErrorService::NotifyErrorsChanged(GlobalError* error) { 62 void GlobalErrorService::NotifyErrorsChanged(GlobalError* error) {
63 NotificationService::current()->Notify( 63 content::NotificationService::current()->Notify(
64 chrome::NOTIFICATION_GLOBAL_ERRORS_CHANGED, 64 chrome::NOTIFICATION_GLOBAL_ERRORS_CHANGED,
65 content::Source<Profile>(profile_), 65 content::Source<Profile>(profile_),
66 content::Details<GlobalError>(error)); 66 content::Details<GlobalError>(error));
67 } 67 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/find_bar/find_tab_helper.cc ('k') | chrome/browser/ui/gtk/bookmarks/bookmark_bar_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698