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

Unified Diff: chrome/browser/browser.cc

Issue 60066: Make the throbber throb sooner after you navigate. This fixes the new tab pag... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 9 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 13028)
+++ chrome/browser/browser.cc (working copy)
@@ -1657,6 +1657,8 @@
// 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.
+ ScheduleUIUpdate(source, TabContents::INVALIDATE_URL |
Ben Goodger (Google) 2009/04/04 17:27:59 You might move this above the comment above since
+ TabContents::INVALIDATE_LOAD);
UpdateToolbar(false);
} else if (disposition == OFF_THE_RECORD) {
OpenURLOffTheRecord(profile_, url);
@@ -1865,7 +1867,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 +2198,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 +2298,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