OLD | NEW |
---|---|
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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/ui/browser.h" | 5 #include "chrome/browser/ui/browser.h" |
6 | 6 |
7 #if defined(OS_WIN) | 7 #if defined(OS_WIN) |
8 #include <windows.h> | 8 #include <windows.h> |
9 #include <shellapi.h> | 9 #include <shellapi.h> |
10 #endif // defined(OS_WIN) | 10 #endif // defined(OS_WIN) |
(...skipping 1896 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1907 if (!source) | 1907 if (!source) |
1908 return; | 1908 return; |
1909 | 1909 |
1910 // Do some synchronous updates. | 1910 // Do some synchronous updates. |
1911 if (changed_flags & content::INVALIDATE_TYPE_URL && | 1911 if (changed_flags & content::INVALIDATE_TYPE_URL && |
1912 source == tab_strip_model_->GetActiveWebContents()) { | 1912 source == tab_strip_model_->GetActiveWebContents()) { |
1913 // Only update the URL for the current tab. Note that we do not update | 1913 // Only update the URL for the current tab. Note that we do not update |
1914 // the navigation commands since those would have already been updated | 1914 // the navigation commands since those would have already been updated |
1915 // synchronously by NavigationStateChanged. | 1915 // synchronously by NavigationStateChanged. |
1916 UpdateToolbar(false); | 1916 UpdateToolbar(false); |
1917 | |
1918 tab_strip_model_->UpdateWebContentsStateAt( | |
1919 tab_strip_model_->GetIndexOfWebContents(source), | |
1920 TabStripModelObserver::URL_CHANGING_ONLY); | |
sky
2013/09/11 02:09:58
Your usage here is not entirely correct so that UR
| |
1921 | |
1917 changed_flags &= ~content::INVALIDATE_TYPE_URL; | 1922 changed_flags &= ~content::INVALIDATE_TYPE_URL; |
1918 } | 1923 } |
1919 if (changed_flags & content::INVALIDATE_TYPE_LOAD) { | 1924 if (changed_flags & content::INVALIDATE_TYPE_LOAD) { |
1920 // Update the loading state synchronously. This is so the throbber will | 1925 // Update the loading state synchronously. This is so the throbber will |
1921 // immediately start/stop, which gives a more snappy feel. We want to do | 1926 // immediately start/stop, which gives a more snappy feel. We want to do |
1922 // this for any tab so they start & stop quickly. | 1927 // this for any tab so they start & stop quickly. |
1923 tab_strip_model_->UpdateWebContentsStateAt( | 1928 tab_strip_model_->UpdateWebContentsStateAt( |
1924 tab_strip_model_->GetIndexOfWebContents(source), | 1929 tab_strip_model_->GetIndexOfWebContents(source), |
1925 TabStripModelObserver::LOADING_ONLY); | 1930 TabStripModelObserver::LOADING_ONLY); |
1926 // The status bubble needs to be updated during INVALIDATE_TYPE_LOAD too, | 1931 // The status bubble needs to be updated during INVALIDATE_TYPE_LOAD too, |
(...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2300 if (contents && !allow_js_access) { | 2305 if (contents && !allow_js_access) { |
2301 contents->web_contents()->GetController().LoadURL( | 2306 contents->web_contents()->GetController().LoadURL( |
2302 target_url, | 2307 target_url, |
2303 content::Referrer(), | 2308 content::Referrer(), |
2304 content::PAGE_TRANSITION_LINK, | 2309 content::PAGE_TRANSITION_LINK, |
2305 std::string()); // No extra headers. | 2310 std::string()); // No extra headers. |
2306 } | 2311 } |
2307 | 2312 |
2308 return contents != NULL; | 2313 return contents != NULL; |
2309 } | 2314 } |
OLD | NEW |