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

Unified Diff: chrome/browser/tab_contents/tab_contents.cc

Issue 211050: Implemented upload progress indicator in status bar. (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 11 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/tab_contents/tab_contents.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/tab_contents/tab_contents.cc
===================================================================
--- chrome/browser/tab_contents/tab_contents.cc (revision 26719)
+++ chrome/browser/tab_contents/tab_contents.cc (working copy)
@@ -240,6 +240,8 @@
current_load_start_(),
load_state_(net::LOAD_STATE_IDLE),
load_state_host_(),
+ upload_size_(0),
+ upload_position_(0),
received_page_title_(false),
is_starred_(false),
contents_mime_type_(),
@@ -556,7 +558,12 @@
case net::LOAD_STATE_CONNECTING:
return l10n_util::GetString(IDS_LOAD_STATE_CONNECTING);
case net::LOAD_STATE_SENDING_REQUEST:
- return l10n_util::GetString(IDS_LOAD_STATE_SENDING_REQUEST);
+ if (upload_size_)
+ return l10n_util::GetStringF(
+ IDS_LOAD_STATE_SENDING_REQUEST_WITH_PROGRESS,
+ static_cast<int>((100 * upload_position_) / upload_size_));
+ else
+ return l10n_util::GetString(IDS_LOAD_STATE_SENDING_REQUEST);
case net::LOAD_STATE_WAITING_FOR_RESPONSE:
return l10n_util::GetStringF(IDS_LOAD_STATE_WAITING_FOR_RESPONSE,
load_state_host_);
@@ -1164,6 +1171,8 @@
if (!is_loading) {
load_state_ = net::LOAD_STATE_IDLE;
load_state_host_.clear();
+ upload_size_ = 0;
+ upload_position_ = 0;
}
render_manager_.SetIsLoading(is_loading);
@@ -2386,8 +2395,12 @@
}
void TabContents::LoadStateChanged(const GURL& url,
- net::LoadState load_state) {
+ net::LoadState load_state,
+ uint64 upload_position,
+ uint64 upload_size) {
load_state_ = load_state;
+ upload_position_ = upload_position;
+ upload_size_ = upload_size;
std::wstring languages =
profile()->GetPrefs()->GetString(prefs::kAcceptLanguages);
load_state_host_.clear();
« no previous file with comments | « chrome/browser/tab_contents/tab_contents.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698