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

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

Issue 7857014: patch for global error bubbles (view/gtk) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 3 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
« no previous file with comments | « chrome/browser/ui/global_error_delegate.cc ('k') | chrome/browser/ui/global_error_service.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/global_error_service.h
diff --git a/chrome/browser/ui/global_error_service.h b/chrome/browser/ui/global_error_service.h
new file mode 100644
index 0000000000000000000000000000000000000000..1ac8edebfe63aed81e655ed328ea7f810f9f4782
--- /dev/null
+++ b/chrome/browser/ui/global_error_service.h
@@ -0,0 +1,41 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_UI_GLOBAL_ERROR_SERVICE_H_
+#define CHROME_BROWSER_UI_GLOBAL_ERROR_SERVICE_H_
+#pragma once
+
+#include <vector>
+
+#include "base/basictypes.h"
+#include "chrome/browser/profiles/profile_keyed_service.h"
+
+class GlobalErrorDelegate;
+
+// This service manages a list of errors that are meant to be shown globally.
+// If an error applies to an entire profile and not just to a tab then the
+// error should be shown using this service. Examples of global errors are:
+// - the previous session crashed for a given profile.
+// - a sync error occurred
+class GlobalErrorService : public ProfileKeyedService {
+ public:
+ GlobalErrorService();
+ ~GlobalErrorService();
+
+ // This class takes ownership of the delegate.
+ void AddGlobalError(GlobalErrorDelegate* delegate);
+
+ // Removes the delegate. Caller then takes ownership of the delegate and is
+ // responsible for deleting it.
+ void RemoveGlobalError(GlobalErrorDelegate* delegate);
+
+ const std::vector<GlobalErrorDelegate*>& GetErrorDelegates();
+
+ private:
+ std::vector<GlobalErrorDelegate*> errors_;
+
+ DISALLOW_COPY_AND_ASSIGN(GlobalErrorService);
+};
+
+#endif // CHROME_BROWSER_UI_GLOBAL_ERROR_SERVICE_H_
« no previous file with comments | « chrome/browser/ui/global_error_delegate.cc ('k') | chrome/browser/ui/global_error_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698