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 #include "chrome/browser/printing/background_printing_manager.h" | 5 #include "chrome/browser/printing/background_printing_manager.h" |
6 | 6 |
7 #include "chrome/browser/printing/print_job.h" | 7 #include "chrome/browser/printing/print_job.h" |
8 #include "chrome/browser/printing/print_preview_tab_controller.h" | 8 #include "chrome/browser/printing/print_preview_tab_controller.h" |
9 #include "chrome/browser/sessions/restore_tab_helper.h" | 9 #include "chrome/browser/sessions/restore_tab_helper.h" |
10 #include "chrome/browser/tabs/tab_strip_model.h" | 10 #include "chrome/browser/tabs/tab_strip_model.h" |
11 #include "chrome/browser/ui/browser_list.h" | 11 #include "chrome/browser/ui/browser_list.h" |
12 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" | 12 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" |
13 #include "chrome/common/chrome_notification_types.h" | 13 #include "chrome/common/chrome_notification_types.h" |
14 #include "content/browser/renderer_host/render_view_host.h" | 14 #include "content/browser/renderer_host/render_view_host.h" |
15 #include "content/public/browser/browser_thread.h" | 15 #include "content/public/browser/browser_thread.h" |
16 #include "content/public/browser/notification_details.h" | 16 #include "content/public/browser/notification_details.h" |
17 #include "content/public/browser/notification_source.h" | 17 #include "content/public/browser/notification_source.h" |
18 | 18 |
| 19 using content::BrowserThread; |
| 20 |
19 namespace printing { | 21 namespace printing { |
20 | 22 |
21 BackgroundPrintingManager::BackgroundPrintingManager() { | 23 BackgroundPrintingManager::BackgroundPrintingManager() { |
22 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 24 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
23 } | 25 } |
24 | 26 |
25 BackgroundPrintingManager::~BackgroundPrintingManager() { | 27 BackgroundPrintingManager::~BackgroundPrintingManager() { |
26 DCHECK(CalledOnValidThread()); | 28 DCHECK(CalledOnValidThread()); |
27 // The might be some TabContentsWrappers still in |printing_tabs_| at | 29 // The might be some TabContentsWrappers still in |printing_tabs_| at |
28 // this point. E.g. when the last remaining tab is a print preview tab and | 30 // this point. E.g. when the last remaining tab is a print preview tab and |
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
258 | 260 |
259 bool BackgroundPrintingManager::HasPrintPreviewTab( | 261 bool BackgroundPrintingManager::HasPrintPreviewTab( |
260 TabContentsWrapper* preview_tab) { | 262 TabContentsWrapper* preview_tab) { |
261 if (printing_tabs_.find(preview_tab) != printing_tabs_.end()) | 263 if (printing_tabs_.find(preview_tab) != printing_tabs_.end()) |
262 return true; | 264 return true; |
263 return printing_tabs_pending_deletion_.find(preview_tab) != | 265 return printing_tabs_pending_deletion_.find(preview_tab) != |
264 printing_tabs_pending_deletion_.end(); | 266 printing_tabs_pending_deletion_.end(); |
265 } | 267 } |
266 | 268 |
267 } // namespace printing | 269 } // namespace printing |
OLD | NEW |