| Index: chrome/browser/printing/print_preview_data_service.cc
|
| diff --git a/chrome/browser/printing/print_preview_data_service.cc b/chrome/browser/printing/print_preview_data_service.cc
|
| index 53ba36f81e00e1d493b537171e8a319568e3f184..1728158bf07b591005b78aed1691f8ce0daa5409 100644
|
| --- a/chrome/browser/printing/print_preview_data_service.cc
|
| +++ b/chrome/browser/printing/print_preview_data_service.cc
|
| @@ -49,6 +49,16 @@ class PrintPreviewDataStore : public base::RefCounted<PrintPreviewDataStore> {
|
| page_data_map_[index] = const_cast<RefCountedBytes*>(data);
|
| }
|
|
|
| + // Returns the available draft page count.
|
| + int GetAvailableDraftPageCount() {
|
| + int page_data_map_size = page_data_map_.size();
|
| + if (page_data_map_.find(printing::COMPLETE_PREVIEW_DOCUMENT_INDEX) !=
|
| + page_data_map_.end()) {
|
| + page_data_map_size--;
|
| + }
|
| + return page_data_map_size;
|
| + }
|
| +
|
| private:
|
| friend class base::RefCounted<PrintPreviewDataStore>;
|
|
|
| @@ -105,3 +115,10 @@ void PrintPreviewDataService::RemoveEntry(
|
| if (it != data_store_map_.end())
|
| data_store_map_.erase(it);
|
| }
|
| +
|
| +int PrintPreviewDataService::GetAvailableDraftPageCount(
|
| + const std::string& preview_ui_addr_str) {
|
| + if (data_store_map_.find(preview_ui_addr_str) != data_store_map_.end())
|
| + return data_store_map_[preview_ui_addr_str]->GetAvailableDraftPageCount();
|
| + return 0;
|
| +}
|
|
|