| 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_TAB_CONTENTS_TAB_CONTENTS_ITERATOR_H_ | 5 #ifndef CHROME_BROWSER_UI_TAB_CONTENTS_TAB_CONTENTS_ITERATOR_H_ |
| 6 #define CHROME_BROWSER_UI_TAB_CONTENTS_TAB_CONTENTS_ITERATOR_H_ | 6 #define CHROME_BROWSER_UI_TAB_CONTENTS_TAB_CONTENTS_ITERATOR_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <set> | 9 #include <set> |
| 10 | 10 |
| 11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
| 12 #include "chrome/browser/ui/browser_list.h" | 12 #include "chrome/browser/ui/browser_list.h" |
| 13 | 13 |
| 14 class TabContentsWrapper; | 14 class TabContents; |
| 15 typedef TabContents TabContentsWrapper; |
| 15 | 16 |
| 16 // Iterates through all web view hosts in all browser windows. Because the | 17 // Iterates through all web view hosts in all browser windows. Because the |
| 17 // renderers act asynchronously, getting a host through this interface does | 18 // renderers act asynchronously, getting a host through this interface does |
| 18 // not guarantee that the renderer is ready to go. Doing anything to affect | 19 // not guarantee that the renderer is ready to go. Doing anything to affect |
| 19 // browser windows or tabs while iterating may cause incorrect behavior. | 20 // browser windows or tabs while iterating may cause incorrect behavior. |
| 20 // | 21 // |
| 21 // Example: | 22 // Example: |
| 22 // for (TabContentsIterator iterator; !iterator.done(); ++iterator) { | 23 // for (TabContentsIterator iterator; !iterator.done(); ++iterator) { |
| 23 // TabContentsWrapper* cur = *iterator; | 24 // TabContentsWrapper* cur = *iterator; |
| 24 // -or- | 25 // -or- |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 | 77 |
| 77 // Current TabContentsWrapper, or NULL if we're at the end of the list. This | 78 // Current TabContentsWrapper, or NULL if we're at the end of the list. This |
| 78 // can be extracted given the browser iterator and index, but it's nice to | 79 // can be extracted given the browser iterator and index, but it's nice to |
| 79 // cache this since the caller may access the current host many times. | 80 // cache this since the caller may access the current host many times. |
| 80 TabContentsWrapper* cur_; | 81 TabContentsWrapper* cur_; |
| 81 | 82 |
| 82 DISALLOW_COPY_AND_ASSIGN(TabContentsIterator); | 83 DISALLOW_COPY_AND_ASSIGN(TabContentsIterator); |
| 83 }; | 84 }; |
| 84 | 85 |
| 85 #endif // CHROME_BROWSER_UI_TAB_CONTENTS_TAB_CONTENTS_ITERATOR_H_ | 86 #endif // CHROME_BROWSER_UI_TAB_CONTENTS_TAB_CONTENTS_ITERATOR_H_ |
| OLD | NEW |