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/ui/browser_tabstrip.h" |
10 #include "chrome/browser/printing/background_printing_manager.h" | 11 #include "chrome/browser/printing/background_printing_manager.h" |
11 | 12 |
12 namespace { | 13 namespace { |
13 | 14 |
14 printing::BackgroundPrintingManager* GetBackgroundPrintingManager() { | 15 printing::BackgroundPrintingManager* GetBackgroundPrintingManager() { |
15 return g_browser_process->background_printing_manager(); | 16 return g_browser_process->background_printing_manager(); |
16 } | 17 } |
17 | 18 |
18 } // namespace | 19 } // namespace |
19 | 20 |
(...skipping 14 matching lines...) Expand all Loading... |
34 // Update cur_ to the next TabContents in the list. | 35 // Update cur_ to the next TabContents in the list. |
35 while (browser_iterator_ != BrowserList::end()) { | 36 while (browser_iterator_ != BrowserList::end()) { |
36 if (++web_view_index_ >= (*browser_iterator_)->tab_count()) { | 37 if (++web_view_index_ >= (*browser_iterator_)->tab_count()) { |
37 // Advance to the next Browser in the list. | 38 // Advance to the next Browser in the list. |
38 ++browser_iterator_; | 39 ++browser_iterator_; |
39 web_view_index_ = -1; | 40 web_view_index_ = -1; |
40 continue; | 41 continue; |
41 } | 42 } |
42 | 43 |
43 TabContents* next_tab = | 44 TabContents* next_tab = |
44 (*browser_iterator_)->GetTabContentsAt(web_view_index_); | 45 chrome::GetTabContentsAt(*browser_iterator_, web_view_index_); |
45 if (next_tab) { | 46 if (next_tab) { |
46 cur_ = next_tab; | 47 cur_ = next_tab; |
47 return; | 48 return; |
48 } | 49 } |
49 } | 50 } |
50 // If no more TabContents from Browsers, check the BackgroundPrintingManager. | 51 // If no more TabContents from Browsers, check the BackgroundPrintingManager. |
51 while (bg_printing_iterator_ != GetBackgroundPrintingManager()->end()) { | 52 while (bg_printing_iterator_ != GetBackgroundPrintingManager()->end()) { |
52 cur_ = *bg_printing_iterator_; | 53 cur_ = *bg_printing_iterator_; |
53 CHECK(cur_); | 54 CHECK(cur_); |
54 ++bg_printing_iterator_; | 55 ++bg_printing_iterator_; |
55 return; | 56 return; |
56 } | 57 } |
57 // Reached the end - no more TabContents. | 58 // Reached the end - no more TabContents. |
58 cur_ = NULL; | 59 cur_ = NULL; |
59 } | 60 } |
OLD | NEW |