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/print_preview_data_service.h" | 5 #include "chrome/browser/printing/print_preview_data_service.h" |
6 | 6 |
| 7 #include "base/macros.h" |
7 #include "base/memory/ref_counted_memory.h" | 8 #include "base/memory/ref_counted_memory.h" |
8 #include "base/memory/singleton.h" | 9 #include "base/memory/singleton.h" |
9 #include "base/stl_util.h" | 10 #include "base/stl_util.h" |
10 #include "printing/print_job_constants.h" | 11 #include "printing/print_job_constants.h" |
11 | 12 |
12 // PrintPreviewDataStore stores data for preview workflow and preview printing | 13 // PrintPreviewDataStore stores data for preview workflow and preview printing |
13 // workflow. | 14 // workflow. |
14 // | 15 // |
15 // NOTE: | 16 // NOTE: |
16 // This class stores a list of PDFs. The list |index| is zero-based and can | 17 // This class stores a list of PDFs. The list |index| is zero-based and can |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 | 112 |
112 void PrintPreviewDataService::RemoveEntry(int32_t preview_ui_id) { | 113 void PrintPreviewDataService::RemoveEntry(int32_t preview_ui_id) { |
113 data_store_map_.erase(preview_ui_id); | 114 data_store_map_.erase(preview_ui_id); |
114 } | 115 } |
115 | 116 |
116 int PrintPreviewDataService::GetAvailableDraftPageCount(int32_t preview_ui_id) { | 117 int PrintPreviewDataService::GetAvailableDraftPageCount(int32_t preview_ui_id) { |
117 PreviewDataStoreMap::const_iterator it = data_store_map_.find(preview_ui_id); | 118 PreviewDataStoreMap::const_iterator it = data_store_map_.find(preview_ui_id); |
118 return (it == data_store_map_.end()) ? | 119 return (it == data_store_map_.end()) ? |
119 0 : it->second->GetAvailableDraftPageCount(); | 120 0 : it->second->GetAvailableDraftPageCount(); |
120 } | 121 } |
OLD | NEW |