| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_CHROMEOS_TAB_CLOSEABLE_STATE_WATCHER_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_TAB_CLOSEABLE_STATE_WATCHER_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_TAB_CLOSEABLE_STATE_WATCHER_H_ | 6 #define CHROME_BROWSER_CHROMEOS_TAB_CLOSEABLE_STATE_WATCHER_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 // methods to TabCloseableStateWatcher::OnTabStripChanged. TabStripWatcher is | 107 // methods to TabCloseableStateWatcher::OnTabStripChanged. TabStripWatcher is |
| 108 // needed so we know which browser the TabStripModelObserver method relates | 108 // needed so we know which browser the TabStripModelObserver method relates |
| 109 // to. | 109 // to. |
| 110 class TabStripWatcher : public TabStripModelObserver { | 110 class TabStripWatcher : public TabStripModelObserver { |
| 111 public: | 111 public: |
| 112 TabStripWatcher(TabCloseableStateWatcher* main_watcher, | 112 TabStripWatcher(TabCloseableStateWatcher* main_watcher, |
| 113 const Browser* browser); | 113 const Browser* browser); |
| 114 virtual ~TabStripWatcher(); | 114 virtual ~TabStripWatcher(); |
| 115 | 115 |
| 116 // TabStripModelObserver implementation: | 116 // TabStripModelObserver implementation: |
| 117 virtual void TabInsertedAt(TabContents* contents, int index, | 117 virtual void TabInsertedAt(TabContentsWrapper* contents, int index, |
| 118 bool foreground); | 118 bool foreground); |
| 119 virtual void TabClosingAt(TabStripModel* tab_strip_model, | 119 virtual void TabClosingAt(TabStripModel* tab_strip_model, |
| 120 TabContents* contents, | 120 TabContentsWrapper* contents, |
| 121 int index); | 121 int index); |
| 122 virtual void TabDetachedAt(TabContents* contents, int index); | 122 virtual void TabDetachedAt(TabContentsWrapper* contents, int index); |
| 123 virtual void TabChangedAt(TabContents* contents, int index, | 123 virtual void TabChangedAt(TabContentsWrapper* contents, int index, |
| 124 TabChangeType change_type); | 124 TabChangeType change_type); |
| 125 | 125 |
| 126 const Browser* browser() const { | 126 const Browser* browser() const { |
| 127 return browser_; | 127 return browser_; |
| 128 } | 128 } |
| 129 | 129 |
| 130 private: | 130 private: |
| 131 TabCloseableStateWatcher* main_watcher_; | 131 TabCloseableStateWatcher* main_watcher_; |
| 132 const Browser* browser_; | 132 const Browser* browser_; |
| 133 | 133 |
| 134 DISALLOW_COPY_AND_ASSIGN(TabStripWatcher); | 134 DISALLOW_COPY_AND_ASSIGN(TabStripWatcher); |
| 135 }; | 135 }; |
| 136 | 136 |
| 137 friend class TabStripWatcher; | 137 friend class TabStripWatcher; |
| 138 | 138 |
| 139 std::vector<TabStripWatcher*> tabstrip_watchers_; | 139 std::vector<TabStripWatcher*> tabstrip_watchers_; |
| 140 | 140 |
| 141 DISALLOW_COPY_AND_ASSIGN(TabCloseableStateWatcher); | 141 DISALLOW_COPY_AND_ASSIGN(TabCloseableStateWatcher); |
| 142 }; | 142 }; |
| 143 | 143 |
| 144 } // namespace chromeos | 144 } // namespace chromeos |
| 145 | 145 |
| 146 #endif // CHROME_BROWSER_CHROMEOS_TAB_CLOSEABLE_STATE_WATCHER_H_ | 146 #endif // CHROME_BROWSER_CHROMEOS_TAB_CLOSEABLE_STATE_WATCHER_H_ |
| OLD | NEW |