| 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 #include "chrome/browser/ui/tab_contents/tab_contents_iterator.h" | 5 #include "chrome/browser/ui/tab_contents/tab_contents_iterator.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "chrome/browser/browser_process.h" | 8 #include "chrome/browser/browser_process.h" |
| 9 #include "chrome/browser/ui/browser.h" | 9 #include "chrome/browser/ui/browser.h" |
| 10 #include "chrome/browser/printing/background_printing_manager.h" | 10 #include "chrome/browser/printing/background_printing_manager.h" |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 // Update cur_ to the next TabContents in the list. | 34 // Update cur_ to the next TabContents in the list. |
| 35 while (browser_iterator_ != BrowserList::end()) { | 35 while (browser_iterator_ != BrowserList::end()) { |
| 36 if (++web_view_index_ >= (*browser_iterator_)->tab_count()) { | 36 if (++web_view_index_ >= (*browser_iterator_)->tab_count()) { |
| 37 // Advance to the next Browser in the list. | 37 // Advance to the next Browser in the list. |
| 38 ++browser_iterator_; | 38 ++browser_iterator_; |
| 39 web_view_index_ = -1; | 39 web_view_index_ = -1; |
| 40 continue; | 40 continue; |
| 41 } | 41 } |
| 42 | 42 |
| 43 TabContents* next_tab = | 43 TabContents* next_tab = |
| 44 (*browser_iterator_)->GetTabContentsWrapperAt(web_view_index_); | 44 (*browser_iterator_)->GetTabContentsAt(web_view_index_); |
| 45 if (next_tab) { | 45 if (next_tab) { |
| 46 cur_ = next_tab; | 46 cur_ = next_tab; |
| 47 return; | 47 return; |
| 48 } | 48 } |
| 49 } | 49 } |
| 50 // If no more TabContents from Browsers, check the BackgroundPrintingManager. | 50 // If no more TabContents from Browsers, check the BackgroundPrintingManager. |
| 51 while (bg_printing_iterator_ != GetBackgroundPrintingManager()->end()) { | 51 while (bg_printing_iterator_ != GetBackgroundPrintingManager()->end()) { |
| 52 cur_ = *bg_printing_iterator_; | 52 cur_ = *bg_printing_iterator_; |
| 53 CHECK(cur_); | 53 CHECK(cur_); |
| 54 ++bg_printing_iterator_; | 54 ++bg_printing_iterator_; |
| 55 return; | 55 return; |
| 56 } | 56 } |
| 57 // Reached the end - no more TabContents. | 57 // Reached the end - no more TabContents. |
| 58 cur_ = NULL; | 58 cur_ = NULL; |
| 59 } | 59 } |
| OLD | NEW |