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

Unified Diff: ios/chrome/browser/snapshots/snapshot_cache_web_state_list_observer.h

Issue 2703333006: Move the notion of current Tab from TabModel to WebStateList. (Closed)
Patch Set: Rebase. Created 3 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 side-by-side diff with in-line comments
Download patch
Index: ios/chrome/browser/snapshots/snapshot_cache_web_state_list_observer.h
diff --git a/ios/chrome/browser/snapshots/snapshot_cache_web_state_list_observer.h b/ios/chrome/browser/snapshots/snapshot_cache_web_state_list_observer.h
new file mode 100644
index 0000000000000000000000000000000000000000..a6e306eaad4496d5ff0afbd9f530742d1d7fc20b
--- /dev/null
+++ b/ios/chrome/browser/snapshots/snapshot_cache_web_state_list_observer.h
@@ -0,0 +1,32 @@
+// Copyright 2017 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 IOS_CHROME_BROWSER_SNAPSHOTS_SNAPSHOT_CACHE_WEB_STATE_LIST_OBSERVER_H_
+#define IOS_CHROME_BROWSER_SNAPSHOTS_SNAPSHOT_CACHE_WEB_STATE_LIST_OBSERVER_H_
+
+#include "base/macros.h"
+#import "ios/shared/chrome/browser/tabs/web_state_list_observer.h"
+
+@class SnapshotCache;
+
+// Updates the SnapshotCache when the active Tab changes.
+class SnapshotCacheWebStateListObserver : public WebStateListObserver {
+ public:
+ explicit SnapshotCacheWebStateListObserver(SnapshotCache* snapshot_cache);
+ ~SnapshotCacheWebStateListObserver() override;
+
+ private:
+ // WebStateListObserver implementation.
+ void WebStateActivatedAt(WebStateList* web_state_list,
+ web::WebState* old_web_state,
+ web::WebState* new_web_state,
+ int active_index,
+ bool user_action) override;
+
+ SnapshotCache* snapshot_cache_;
+
+ DISALLOW_COPY_AND_ASSIGN(SnapshotCacheWebStateListObserver);
+};
+
+#endif // IOS_CHROME_BROWSER_SNAPSHOTS_SNAPSHOT_CACHE_WEB_STATE_LIST_OBSERVER_H_
« no previous file with comments | « ios/chrome/browser/snapshots/BUILD.gn ('k') | ios/chrome/browser/snapshots/snapshot_cache_web_state_list_observer.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698