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

Unified Diff: chrome/browser/ui/views/load_complete_listener.h

Issue 11515005: Delay updating jumplist to avoid blocking the file thread at start-up (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 12 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/ui/views/load_complete_listener.h
diff --git a/chrome/browser/ui/views/load_complete_listener.h b/chrome/browser/ui/views/load_complete_listener.h
new file mode 100644
index 0000000000000000000000000000000000000000..6745fa652822bf498288ba1d5db9e85d71939cb2
--- /dev/null
+++ b/chrome/browser/ui/views/load_complete_listener.h
@@ -0,0 +1,50 @@
+// Copyright (c) 2012 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_VIEWS_LOAD_COMPLETE_LISTENER_H_
+#define CHROME_BROWSER_UI_VIEWS_LOAD_COMPLETE_LISTENER_H_
+
+#include "content/public/browser/browser_thread.h"
tfarina 2013/01/09 23:58:24 you don't use this include here.
+#include "content/public/browser/notification_observer.h"
+
+namespace content {
+class NotificationSource;
tfarina 2013/01/09 23:58:24 you don't need to forward declare this and Details
+class NotificationRegistrar;
+class NotificationDetails;
+}
+
+// A class which takes a delegate which can be notified after the first page
+// load has been completed. This is particularly useful for triggering
+// IO-intensive tasks which should not be run until start-up is complete.
+class LoadCompleteListener
+ : public content::NotificationObserver {
+ public:
+ class Delegate {
+ public:
+ // Invoked when initial page load has completed.
+ virtual void OnLoadCompleted() = 0;
+
+ protected:
+ virtual ~Delegate() {}
+ };
+
+ explicit LoadCompleteListener(Delegate* delegate);
+
+ virtual ~LoadCompleteListener();
+
+ // NotificationObserver implementation.
+ virtual void Observe(int type,
+ const content::NotificationSource& source,
+ const content::NotificationDetails& details) OVERRIDE;
+
+ private:
+ content::NotificationRegistrar* registrar_;
+
+ // Delegate to be notified after the first page load has completed.
+ Delegate* delegate_;
+
+ DISALLOW_COPY_AND_ASSIGN(LoadCompleteListener);
+};
+
+#endif // CHROME_BROWSER_UI_VIEWS_LOAD_COMPLETE_LISTENER_H_

Powered by Google App Engine
This is Rietveld 408576698