| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_BROWSER_LIST_H_ | 5 #ifndef CHROME_BROWSER_UI_BROWSER_LIST_H_ |
| 6 #define CHROME_BROWSER_UI_BROWSER_LIST_H_ | 6 #define CHROME_BROWSER_UI_BROWSER_LIST_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <set> | 9 #include <set> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 237 class TabContentsIterator { | 237 class TabContentsIterator { |
| 238 public: | 238 public: |
| 239 TabContentsIterator(); | 239 TabContentsIterator(); |
| 240 | 240 |
| 241 // Returns true if we are past the last Browser. | 241 // Returns true if we are past the last Browser. |
| 242 bool done() const { | 242 bool done() const { |
| 243 return cur_ == NULL; | 243 return cur_ == NULL; |
| 244 } | 244 } |
| 245 | 245 |
| 246 // Returns the Browser instance associated with the current TabContents. | 246 // Returns the Browser instance associated with the current TabContents. |
| 247 // Valid as long as !Done() | 247 // Valid as long as !done() |
| 248 Browser* browser() const { | 248 Browser* browser() const { |
| 249 if (browser_iterator_ != BrowserList::end()) | 249 if (browser_iterator_ != BrowserList::end()) |
| 250 return *browser_iterator_; | 250 return *browser_iterator_; |
| 251 return NULL; | 251 return NULL; |
| 252 } | 252 } |
| 253 | 253 |
| 254 // Returns the current TabContents, valid as long as !Done() | 254 // Returns the current TabContents, valid as long as !Done() |
| 255 TabContentsWrapper* operator->() const { | 255 TabContentsWrapper* operator->() const { |
| 256 return cur_; | 256 return cur_; |
| 257 } | 257 } |
| (...skipping 27 matching lines...) Expand all Loading... |
| 285 // iterator over the TabContentsWrappers doing background printing. | 285 // iterator over the TabContentsWrappers doing background printing. |
| 286 std::set<TabContentsWrapper*>::const_iterator bg_printing_iterator_; | 286 std::set<TabContentsWrapper*>::const_iterator bg_printing_iterator_; |
| 287 | 287 |
| 288 // Current TabContents, or NULL if we're at the end of the list. This can | 288 // Current TabContents, or NULL if we're at the end of the list. This can |
| 289 // be extracted given the browser iterator and index, but it's nice to cache | 289 // be extracted given the browser iterator and index, but it's nice to cache |
| 290 // this since the caller may access the current host many times. | 290 // this since the caller may access the current host many times. |
| 291 TabContentsWrapper* cur_; | 291 TabContentsWrapper* cur_; |
| 292 }; | 292 }; |
| 293 | 293 |
| 294 #endif // CHROME_BROWSER_UI_BROWSER_LIST_H_ | 294 #endif // CHROME_BROWSER_UI_BROWSER_LIST_H_ |
| OLD | NEW |