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

Side by Side Diff: chrome/browser/browser.cc

Issue 100033: Synchronously update the loading state when a load starts so that the UI will... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 7 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/extensions/extension_view.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/browser.h" 5 #include "chrome/browser/browser.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/idle_timer.h" 8 #include "base/idle_timer.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/string_util.h" 10 #include "base/string_util.h"
(...skipping 1719 matching lines...) Expand 10 before | Expand all | Expand 10 after
1730 instance); 1730 instance);
1731 browser->window()->Show(); 1731 browser->window()->Show();
1732 } else if ((disposition == CURRENT_TAB) && current_tab) { 1732 } else if ((disposition == CURRENT_TAB) && current_tab) {
1733 tabstrip_model_.TabNavigating(current_tab, transition); 1733 tabstrip_model_.TabNavigating(current_tab, transition);
1734 1734
1735 current_tab->controller().LoadURL(url, referrer, transition); 1735 current_tab->controller().LoadURL(url, referrer, transition);
1736 new_contents = current_tab; 1736 new_contents = current_tab;
1737 if (GetStatusBubble()) 1737 if (GetStatusBubble())
1738 GetStatusBubble()->Hide(); 1738 GetStatusBubble()->Hide();
1739 1739
1740 // Update the location bar and load state. These are both synchronous 1740 // Update the location bar. This is synchronous. We specfically don't update
1741 // updates inside of ScheduleUIUpdate. 1741 // the load state since the load hasn't started yet and updating it will put
1742 ScheduleUIUpdate(current_tab, TabContents::INVALIDATE_URL | 1742 // it out of sync with the actual state like whether we're displaying a
1743 TabContents::INVALIDATE_LOAD); 1743 // favicon, which controls the throbber. If we updated it here, the throbber
1744 // will show the default favicon for a split second when navigating away
1745 // from the new tab page.
1746 ScheduleUIUpdate(current_tab, TabContents::INVALIDATE_URL);
1744 } else if (disposition == OFF_THE_RECORD) { 1747 } else if (disposition == OFF_THE_RECORD) {
1745 OpenURLOffTheRecord(profile_, url); 1748 OpenURLOffTheRecord(profile_, url);
1746 return; 1749 return;
1747 } else if (disposition != SUPPRESS_OPEN) { 1750 } else if (disposition != SUPPRESS_OPEN) {
1748 new_contents = AddTabWithURL(url, referrer, transition, 1751 new_contents = AddTabWithURL(url, referrer, transition,
1749 disposition != NEW_BACKGROUND_TAB, -1, 1752 disposition != NEW_BACKGROUND_TAB, -1,
1750 instance); 1753 instance);
1751 } 1754 }
1752 1755
1753 if (disposition != NEW_BACKGROUND_TAB && source_tab_was_frontmost) { 1756 if (disposition != NEW_BACKGROUND_TAB && source_tab_was_frontmost) {
(...skipping 881 matching lines...) Expand 10 before | Expand all | Expand 10 after
2635 2638
2636 // We need to register the window position pref. 2639 // We need to register the window position pref.
2637 std::wstring window_pref(prefs::kBrowserWindowPlacement); 2640 std::wstring window_pref(prefs::kBrowserWindowPlacement);
2638 window_pref.append(L"_"); 2641 window_pref.append(L"_");
2639 window_pref.append(app_name); 2642 window_pref.append(app_name);
2640 PrefService* prefs = g_browser_process->local_state(); 2643 PrefService* prefs = g_browser_process->local_state();
2641 DCHECK(prefs); 2644 DCHECK(prefs);
2642 2645
2643 prefs->RegisterDictionaryPref(window_pref.c_str()); 2646 prefs->RegisterDictionaryPref(window_pref.c_str());
2644 } 2647 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/extensions/extension_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698