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

Unified Diff: chrome/browser/browser.cc

Issue 67070: Merge 13131 - Make the throbber throb sooner after you navigate. This fixes t... (Closed) Base URL: svn://chrome-svn.corp.google.com/chrome/branches/172/src/
Patch Set: '' Created 11 years, 8 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 | « no previous file | chrome/browser/dom_ui/dom_ui_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/browser.cc
===================================================================
--- chrome/browser/browser.cc (revision 13559)
+++ chrome/browser/browser.cc (working copy)
@@ -1654,9 +1654,10 @@
if (GetStatusBubble())
GetStatusBubble()->Hide();
- // Synchronously update the location bar. This allows us to immediately
- // have the URL bar update when the user types something, rather than
- // going through the normal system of ScheduleUIUpdate which has a delay.
+ // Update the location bar and load state. These are both synchronous
+ // updates inside of ScheduleUIUpdate.
+ ScheduleUIUpdate(source, TabContents::INVALIDATE_URL |
+ TabContents::INVALIDATE_LOAD);
UpdateToolbar(false);
} else if (disposition == OFF_THE_RECORD) {
OpenURLOffTheRecord(profile_, url);
@@ -1865,7 +1866,7 @@
void Browser::ContentsStateChanged(TabContents* source) {
int index = tabstrip_model_.GetIndexOfTabContents(source);
if (index != TabStripModel::kNoTab)
- tabstrip_model_.UpdateTabContentsStateAt(index);
+ tabstrip_model_.UpdateTabContentsStateAt(index, true);
}
bool Browser::ShouldDisplayURLField() {
@@ -2196,18 +2197,28 @@
void Browser::ScheduleUIUpdate(const TabContents* source,
unsigned changed_flags) {
- // Synchronously update the URL.
+ // Do some synchronous updates.
if (changed_flags & TabContents::INVALIDATE_URL &&
source == GetSelectedTabContents()) {
// Only update the URL for the current tab. Note that we do not update
// the navigation commands since those would have already been updated
// synchronously by NavigationStateChanged.
UpdateToolbar(false);
-
- if (changed_flags == TabContents::INVALIDATE_URL)
- return; // Just had an update URL and nothing else.
}
+ if (changed_flags & TabContents::INVALIDATE_LOAD && source) {
+ // Update the loading state synchronously. This is so the throbber will
+ // immediately start/stop, which gives a more snappy feel. We want to do
+ // this for any tab so they start & stop quickly, but the source can be
+ // NULL, so we have to check for that.
+ tabstrip_model_.UpdateTabContentsStateAt(
+ tabstrip_model_.GetIndexOfController(source->controller()), true);
+ }
+ // If the only updates were synchronously handled above, we're done.
+ if (changed_flags ==
+ (TabContents::INVALIDATE_URL | TabContents::INVALIDATE_LOAD))
+ return;
+
// Save the dirty bits.
scheduled_updates_.push_back(UIUpdate(source, changed_flags));
@@ -2286,7 +2297,7 @@
if (invalidate_tab) { // INVALIDATE_TITLE or INVALIDATE_FAVICON.
tabstrip_model_.UpdateTabContentsStateAt(
- tabstrip_model_.GetIndexOfController(contents->controller()));
+ tabstrip_model_.GetIndexOfController(contents->controller()), false);
window_->UpdateTitleBar();
if (contents == GetSelectedTabContents()) {
« no previous file with comments | « no previous file | chrome/browser/dom_ui/dom_ui_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698