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

Unified Diff: chrome/browser/jumplist_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: Add JumpListListener Created 8 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 | « no previous file | chrome/browser/jumplist_listener.cc » ('j') | chrome/browser/jumplist_listener.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/jumplist_listener.h
diff --git a/chrome/browser/jumplist_listener.h b/chrome/browser/jumplist_listener.h
new file mode 100644
index 0000000000000000000000000000000000000000..7541db91b8f9bbb0f76eded62ac45923c5d5fe00
--- /dev/null
+++ b/chrome/browser/jumplist_listener.h
@@ -0,0 +1,44 @@
+// 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_JUMPLIST_LISTENER_H_
+#define CHROME_BROWSER_JUMPLIST_LISTENER_H_
+
+#include "base/memory/ref_counted.h"
+#include "base/memory/weak_ptr.h"
+#include "content/public/browser/browser_thread.h"
+#include "content/public/browser/notification_observer.h"
+
+class JumpList;
+class Profile;
+
+namespace content {
+class NotificationSource;
+class NotificationRegistrar;
+class NotificationDetails;
+}
+
+class JumpListListener : public content::NotificationObserver {
sky 2012/12/18 20:52:38 Add description.
sky 2012/12/18 20:52:38 Since this is only used by UI code, I would move i
Cait (Slow) 2012/12/19 19:27:01 Done.
Cait (Slow) 2012/12/19 19:27:01 Done.
+ public:
+ explicit JumpListListener(base::Closure callback);
sky 2012/12/18 20:52:38 const Closure& ?
Cait (Slow) 2012/12/19 19:27:01 Switched to delegate, rather than callback.
+ ~JumpListListener();
sky 2012/12/18 20:52:38 virtual
Cait (Slow) 2012/12/19 19:27:01 Done.
+
+ // NotificationObserver implementation.
+ virtual void Observe(int type,
+ const content::NotificationSource& source,
+ const content::NotificationDetails& details);
sky 2012/12/18 20:52:38 OVERRIDE
Cait (Slow) 2012/12/19 19:27:01 Done.
+
+ private:
+ scoped_ptr<content::NotificationRegistrar> registrar_;
sky 2012/12/18 20:52:38 Why the scoped_ptr?
Cait (Slow) 2012/12/19 19:27:01 Done.
+
+ // Callback to be called after the first pageload has completed.
+ base::Closure callback_;
+
+ // Flag denoting that the callback has been completed.
+ bool called_;
+
+ DISALLOW_COPY_AND_ASSIGN(JumpListListener);
+};
+
+#endif // CHROME_BROWSER_JUMPLIST_LISTENER_H_
« no previous file with comments | « no previous file | chrome/browser/jumplist_listener.cc » ('j') | chrome/browser/jumplist_listener.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698