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

Unified Diff: ios/chrome/browser/tabs/tab_model_observer.h

Issue 2585233003: Upstream Chrome on iOS source code [2/11]. (Closed)
Patch Set: Created 4 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 | « ios/chrome/browser/tabs/tab_model.mm ('k') | ios/chrome/browser/tabs/tab_model_order_controller.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/chrome/browser/tabs/tab_model_observer.h
diff --git a/ios/chrome/browser/tabs/tab_model_observer.h b/ios/chrome/browser/tabs/tab_model_observer.h
new file mode 100644
index 0000000000000000000000000000000000000000..990e2e9cca4680508fe427eddf9eaf684a476af1
--- /dev/null
+++ b/ios/chrome/browser/tabs/tab_model_observer.h
@@ -0,0 +1,67 @@
+// Copyright 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 IOS_CHROME_BROWSER_TABS_TAB_MODEL_OBSERVER_H_
+#define IOS_CHROME_BROWSER_TABS_TAB_MODEL_OBSERVER_H_
+
+#import <Foundation/Foundation.h>
+
+@class Tab;
+@class TabModel;
+
+// Observers implement these methods to be alerted to changes in the model.
+// These methods are all optional.
+@protocol TabModelObserver<NSObject>
+@optional
+
+// A tab was inserted at the given index.
+- (void)tabModel:(TabModel*)model
+ didInsertTab:(Tab*)tab
+ atIndex:(NSUInteger)index
+ inForeground:(BOOL)fg;
+
+// The given tab will be removed.
+- (void)tabModel:(TabModel*)model willRemoveTab:(Tab*)tab;
+
+// A tab was removed at the given index.
+- (void)tabModel:(TabModel*)model
+ didRemoveTab:(Tab*)tab
+ atIndex:(NSUInteger)index;
+
+// A tab was moved to the given index. |fromIndex| is guaranteed to be
+// different than |toIndex| (moves to the same index do not trigger
+// notifications). This method is only called for moves that change the
+// relative order of tabs (for example, closing the first tab decrements all tab
+// indexes by one, but will not call this observer method).
+- (void)tabModel:(TabModel*)model
+ didMoveTab:(Tab*)tab
+ fromIndex:(NSUInteger)fromIndex
+ toIndex:(NSUInteger)toIndex;
+
+// A Tab was replaced in the model, at the given index.
+- (void)tabModel:(TabModel*)model
+ didReplaceTab:(Tab*)oldTab
+ withTab:(Tab*)newTab
+ atIndex:(NSUInteger)index;
+
+// A tab was activated.
+- (void)tabModel:(TabModel*)model
+ didChangeActiveTab:(Tab*)newTab
+ previousTab:(Tab*)previousTab
+ atIndex:(NSUInteger)index;
+
+// The number of Tabs in this TabModel changed.
+- (void)tabModelDidChangeTabCount:(TabModel*)model;
+
+// Some properties about the given tab changed, such as the URL or title.
+- (void)tabModel:(TabModel*)model didChangeTab:(Tab*)tab;
+
+// The |tab|'s snapshot was changed to |image|.
+- (void)tabModel:(TabModel*)model
+ didChangeTabSnapshot:(Tab*)tab
+ withImage:image;
+
+@end
+
+#endif // IOS_CHROME_BROWSER_TABS_TAB_MODEL_OBSERVER_H_
« no previous file with comments | « ios/chrome/browser/tabs/tab_model.mm ('k') | ios/chrome/browser/tabs/tab_model_order_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698