Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(105)

Unified Diff: chrome/browser/save_page_model.cc

Issue 3040: Move the Save Page code. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 12 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/save_page_model.h ('k') | chrome/browser/save_page_uitest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/save_page_model.cc
===================================================================
--- chrome/browser/save_page_model.cc (revision 2173)
+++ chrome/browser/save_page_model.cc (working copy)
@@ -1,48 +0,0 @@
-// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "chrome/browser/save_page_model.h"
-
-#include "base/string_util.h"
-#include "chrome/browser/download/download_manager.h"
-#include "chrome/browser/save_package.h"
-#include "chrome/common/l10n_util.h"
-
-#include "generated_resources.h"
-
-SavePageModel::SavePageModel(SavePackage* save, DownloadItem* download)
- : save_(save),
- download_(download) {
-}
-
-void SavePageModel::CancelTask() {
- save_->Cancel(true);
-}
-
-std::wstring SavePageModel::GetStatusText() {
- int64 size = download_->received_bytes();
- int64 total_size = download_->total_bytes();
-
- std::wstring status_text;
- switch (download_->state()) {
- case DownloadItem::IN_PROGRESS:
- status_text = l10n_util::GetStringF(IDS_SAVE_PAGE_PROGRESS,
- FormatNumber(size),
- FormatNumber(total_size));
- break;
- case DownloadItem::COMPLETE:
- status_text = l10n_util::GetString(IDS_SAVE_PAGE_STATUS_COMPLETED);
- break;
- case DownloadItem::CANCELLED:
- status_text = l10n_util::GetString(IDS_SAVE_PAGE_STATUS_CANCELLED);
- break;
- case DownloadItem::REMOVING:
- break;
- default:
- NOTREACHED();
- }
-
- return status_text;
-}
-
« no previous file with comments | « chrome/browser/save_page_model.h ('k') | chrome/browser/save_page_uitest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698