| 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 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 1534 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1545 // TODO(erikchen): Remove ScopedTracker below once http://crbug.com/466285 | 1545 // TODO(erikchen): Remove ScopedTracker below once http://crbug.com/466285 |
| 1546 // is fixed. | 1546 // is fixed. |
| 1547 tracked_objects::ScopedTracker tracking_profile2( | 1547 tracked_objects::ScopedTracker tracking_profile2( |
| 1548 FROM_HERE_WITH_EXPLICIT_FUNCTION( | 1548 FROM_HERE_WITH_EXPLICIT_FUNCTION( |
| 1549 "466285 Browser::NavigationStateChanged::TabStateChanged")); | 1549 "466285 Browser::NavigationStateChanged::TabStateChanged")); |
| 1550 // We can synchronously update commands since they will only change once per | 1550 // We can synchronously update commands since they will only change once per |
| 1551 // navigation, so we don't have to worry about flickering. We do, however, | 1551 // navigation, so we don't have to worry about flickering. We do, however, |
| 1552 // need to update the command state early on load to always present usable | 1552 // need to update the command state early on load to always present usable |
| 1553 // actions in the face of slow-to-commit pages. | 1553 // actions in the face of slow-to-commit pages. |
| 1554 if (changed_flags & (content::INVALIDATE_TYPE_URL | | 1554 if (changed_flags & (content::INVALIDATE_TYPE_URL | |
| 1555 content::INVALIDATE_TYPE_LOAD)) | 1555 content::INVALIDATE_TYPE_LOAD | |
| 1556 content::INVALIDATE_TYPE_TAB)) |
| 1556 command_controller_->TabStateChanged(); | 1557 command_controller_->TabStateChanged(); |
| 1557 | 1558 |
| 1558 if (hosted_app_controller_) | 1559 if (hosted_app_controller_) |
| 1559 hosted_app_controller_->UpdateLocationBarVisibility(true); | 1560 hosted_app_controller_->UpdateLocationBarVisibility(true); |
| 1560 } | 1561 } |
| 1561 | 1562 |
| 1562 void Browser::VisibleSSLStateChanged(const WebContents* source) { | 1563 void Browser::VisibleSSLStateChanged(const WebContents* source) { |
| 1563 // When the current tab's SSL state changes, we need to update the URL | 1564 // When the current tab's SSL state changes, we need to update the URL |
| 1564 // bar to reflect the new state. | 1565 // bar to reflect the new state. |
| 1565 DCHECK(source); | 1566 DCHECK(source); |
| (...skipping 1174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2740 if (contents && !allow_js_access) { | 2741 if (contents && !allow_js_access) { |
| 2741 contents->web_contents()->GetController().LoadURL( | 2742 contents->web_contents()->GetController().LoadURL( |
| 2742 target_url, | 2743 target_url, |
| 2743 content::Referrer(), | 2744 content::Referrer(), |
| 2744 ui::PAGE_TRANSITION_LINK, | 2745 ui::PAGE_TRANSITION_LINK, |
| 2745 std::string()); // No extra headers. | 2746 std::string()); // No extra headers. |
| 2746 } | 2747 } |
| 2747 | 2748 |
| 2748 return contents != NULL; | 2749 return contents != NULL; |
| 2749 } | 2750 } |
| OLD | NEW |