Chromium Code Reviews| 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()) { |