| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_BROWSER_UI_COCOA_TABS_TAB_STRIP_MODEL_OBSERVER_BRIDGE_H_ | 5 #ifndef CHROME_BROWSER_UI_COCOA_TABS_TAB_STRIP_MODEL_OBSERVER_BRIDGE_H_ |
| 6 #define CHROME_BROWSER_UI_COCOA_TABS_TAB_STRIP_MODEL_OBSERVER_BRIDGE_H_ | 6 #define CHROME_BROWSER_UI_COCOA_TABS_TAB_STRIP_MODEL_OBSERVER_BRIDGE_H_ |
| 7 | 7 |
| 8 #import <Foundation/Foundation.h> | 8 #import <Foundation/Foundation.h> |
| 9 | 9 |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 // informal protocol below. The owner of this object is responsible for deleting | 22 // informal protocol below. The owner of this object is responsible for deleting |
| 23 // it (and thus unhooking notifications) before |controller| is destroyed. | 23 // it (and thus unhooking notifications) before |controller| is destroyed. |
| 24 class TabStripModelObserverBridge : public TabStripModelObserver { | 24 class TabStripModelObserverBridge : public TabStripModelObserver { |
| 25 public: | 25 public: |
| 26 TabStripModelObserverBridge(TabStripModel* model, id controller); | 26 TabStripModelObserverBridge(TabStripModel* model, id controller); |
| 27 virtual ~TabStripModelObserverBridge(); | 27 virtual ~TabStripModelObserverBridge(); |
| 28 | 28 |
| 29 // Overridden from TabStripModelObserver | 29 // Overridden from TabStripModelObserver |
| 30 virtual void TabInsertedAt(content::WebContents* contents, | 30 virtual void TabInsertedAt(content::WebContents* contents, |
| 31 int index, | 31 int index, |
| 32 bool foreground) OVERRIDE; | 32 bool foreground) override; |
| 33 virtual void TabClosingAt(TabStripModel* tab_strip_model, | 33 virtual void TabClosingAt(TabStripModel* tab_strip_model, |
| 34 content::WebContents* contents, | 34 content::WebContents* contents, |
| 35 int index) OVERRIDE; | 35 int index) override; |
| 36 virtual void TabDetachedAt(content::WebContents* contents, | 36 virtual void TabDetachedAt(content::WebContents* contents, |
| 37 int index) OVERRIDE; | 37 int index) override; |
| 38 virtual void TabDeactivated(content::WebContents* contents) OVERRIDE; | 38 virtual void TabDeactivated(content::WebContents* contents) override; |
| 39 virtual void ActiveTabChanged(content::WebContents* old_contents, | 39 virtual void ActiveTabChanged(content::WebContents* old_contents, |
| 40 content::WebContents* new_contents, | 40 content::WebContents* new_contents, |
| 41 int index, | 41 int index, |
| 42 int reason) OVERRIDE; | 42 int reason) override; |
| 43 virtual void TabSelectionChanged( | 43 virtual void TabSelectionChanged( |
| 44 TabStripModel* tab_strip_model, | 44 TabStripModel* tab_strip_model, |
| 45 const ui::ListSelectionModel& old_model) OVERRIDE; | 45 const ui::ListSelectionModel& old_model) override; |
| 46 virtual void TabMoved(content::WebContents* contents, | 46 virtual void TabMoved(content::WebContents* contents, |
| 47 int from_index, | 47 int from_index, |
| 48 int to_index) OVERRIDE; | 48 int to_index) override; |
| 49 virtual void TabChangedAt(content::WebContents* contents, | 49 virtual void TabChangedAt(content::WebContents* contents, |
| 50 int index, | 50 int index, |
| 51 TabChangeType change_type) OVERRIDE; | 51 TabChangeType change_type) override; |
| 52 virtual void TabReplacedAt(TabStripModel* tab_strip_model, | 52 virtual void TabReplacedAt(TabStripModel* tab_strip_model, |
| 53 content::WebContents* old_contents, | 53 content::WebContents* old_contents, |
| 54 content::WebContents* new_contents, | 54 content::WebContents* new_contents, |
| 55 int index) OVERRIDE; | 55 int index) override; |
| 56 virtual void TabMiniStateChanged(content::WebContents* contents, | 56 virtual void TabMiniStateChanged(content::WebContents* contents, |
| 57 int index) OVERRIDE; | 57 int index) override; |
| 58 virtual void TabStripEmpty() OVERRIDE; | 58 virtual void TabStripEmpty() override; |
| 59 virtual void TabStripModelDeleted() OVERRIDE; | 59 virtual void TabStripModelDeleted() override; |
| 60 | 60 |
| 61 private: | 61 private: |
| 62 id controller_; // weak, owns me | 62 id controller_; // weak, owns me |
| 63 TabStripModel* model_; // weak, owned by Browser | 63 TabStripModel* model_; // weak, owned by Browser |
| 64 }; | 64 }; |
| 65 | 65 |
| 66 // A collection of methods which can be selectively implemented by any | 66 // A collection of methods which can be selectively implemented by any |
| 67 // Cocoa object to receive updates about changes to a tab strip model. It is | 67 // Cocoa object to receive updates about changes to a tab strip model. It is |
| 68 // ok to not implement them, the calling code checks before calling. | 68 // ok to not implement them, the calling code checks before calling. |
| 69 @interface NSObject(TabStripModelBridge) | 69 @interface NSObject(TabStripModelBridge) |
| (...skipping 19 matching lines...) Expand all Loading... |
| 89 previousContents:(content::WebContents*)oldContents | 89 previousContents:(content::WebContents*)oldContents |
| 90 atIndex:(NSInteger)index; | 90 atIndex:(NSInteger)index; |
| 91 - (void)tabMiniStateChangedWithContents:(content::WebContents*)contents | 91 - (void)tabMiniStateChangedWithContents:(content::WebContents*)contents |
| 92 atIndex:(NSInteger)index; | 92 atIndex:(NSInteger)index; |
| 93 - (void)tabStripEmpty; | 93 - (void)tabStripEmpty; |
| 94 - (void)tabStripModelDeleted; | 94 - (void)tabStripModelDeleted; |
| 95 - (void)tabSelectionChanged; | 95 - (void)tabSelectionChanged; |
| 96 @end | 96 @end |
| 97 | 97 |
| 98 #endif // CHROME_BROWSER_UI_COCOA_TABS_TAB_STRIP_MODEL_OBSERVER_BRIDGE_H_ | 98 #endif // CHROME_BROWSER_UI_COCOA_TABS_TAB_STRIP_MODEL_OBSERVER_BRIDGE_H_ |
| OLD | NEW |