| 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/printing/background_printing_manager.h" | 5 #include "chrome/browser/printing/background_printing_manager.h" |
| 6 | 6 |
| 7 #include "base/stl_util.h" | 7 #include "base/stl_util.h" |
| 8 #include "chrome/browser/chrome_notification_types.h" | 8 #include "chrome/browser/chrome_notification_types.h" |
| 9 #include "chrome/browser/printing/print_job.h" | 9 #include "chrome/browser/printing/print_job.h" |
| 10 #include "chrome/browser/printing/print_preview_dialog_controller.h" | 10 #include "chrome/browser/printing/print_preview_dialog_controller.h" |
| 11 #include "content/public/browser/browser_thread.h" | 11 #include "content/public/browser/browser_thread.h" |
| 12 #include "content/public/browser/notification_details.h" | 12 #include "content/public/browser/notification_details.h" |
| 13 #include "content/public/browser/notification_source.h" | 13 #include "content/public/browser/notification_source.h" |
| 14 #include "content/public/browser/render_view_host.h" | 14 #include "content/public/browser/render_view_host.h" |
| 15 #include "content/public/browser/web_contents.h" | 15 #include "content/public/browser/web_contents.h" |
| 16 #include "content/public/browser/web_contents_delegate.h" | 16 #include "content/public/browser/web_contents_delegate.h" |
| 17 #include "content/public/browser/web_contents_observer.h" | 17 #include "content/public/browser/web_contents_observer.h" |
| 18 | 18 |
| 19 using content::BrowserThread; | 19 using content::BrowserThread; |
| 20 using content::WebContents; | 20 using content::WebContents; |
| 21 | 21 |
| 22 namespace printing { | 22 namespace printing { |
| 23 | 23 |
| 24 class BackgroundPrintingManager::Observer | 24 class BackgroundPrintingManager::Observer |
| 25 : public content::WebContentsObserver { | 25 : public content::WebContentsObserver { |
| 26 public: | 26 public: |
| 27 Observer(BackgroundPrintingManager* manager, WebContents* web_contents); | 27 Observer(BackgroundPrintingManager* manager, WebContents* web_contents); |
| 28 | 28 |
| 29 private: | 29 private: |
| 30 virtual void RenderProcessGone(base::TerminationStatus status) OVERRIDE; | 30 virtual void RenderProcessGone(base::TerminationStatus status) override; |
| 31 virtual void WebContentsDestroyed() OVERRIDE; | 31 virtual void WebContentsDestroyed() override; |
| 32 | 32 |
| 33 BackgroundPrintingManager* manager_; | 33 BackgroundPrintingManager* manager_; |
| 34 }; | 34 }; |
| 35 | 35 |
| 36 BackgroundPrintingManager::Observer::Observer( | 36 BackgroundPrintingManager::Observer::Observer( |
| 37 BackgroundPrintingManager* manager, WebContents* web_contents) | 37 BackgroundPrintingManager* manager, WebContents* web_contents) |
| 38 : content::WebContentsObserver(web_contents), | 38 : content::WebContentsObserver(web_contents), |
| 39 manager_(manager) { | 39 manager_(manager) { |
| 40 } | 40 } |
| 41 | 41 |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 } | 125 } |
| 126 return result; | 126 return result; |
| 127 } | 127 } |
| 128 | 128 |
| 129 bool BackgroundPrintingManager::HasPrintPreviewDialog( | 129 bool BackgroundPrintingManager::HasPrintPreviewDialog( |
| 130 WebContents* preview_dialog) { | 130 WebContents* preview_dialog) { |
| 131 return ContainsKey(printing_contents_map_, preview_dialog); | 131 return ContainsKey(printing_contents_map_, preview_dialog); |
| 132 } | 132 } |
| 133 | 133 |
| 134 } // namespace printing | 134 } // namespace printing |
| OLD | NEW |