| 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 752 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 763 | 763 |
| 764 //////////////////////////////////////////////////////////////////////////////// | 764 //////////////////////////////////////////////////////////////////////////////// |
| 765 // Browser, Tab adding/showing functions: | 765 // Browser, Tab adding/showing functions: |
| 766 | 766 |
| 767 void Browser::WindowFullscreenStateChanged() { | 767 void Browser::WindowFullscreenStateChanged() { |
| 768 fullscreen_controller_->WindowFullscreenStateChanged(); | 768 fullscreen_controller_->WindowFullscreenStateChanged(); |
| 769 command_controller_->FullscreenStateChanged(); | 769 command_controller_->FullscreenStateChanged(); |
| 770 UpdateBookmarkBarState(BOOKMARK_BAR_STATE_CHANGE_TOGGLE_FULLSCREEN); | 770 UpdateBookmarkBarState(BOOKMARK_BAR_STATE_CHANGE_TOGGLE_FULLSCREEN); |
| 771 } | 771 } |
| 772 | 772 |
| 773 void Browser::VisibleSSLStateChanged(content::WebContents* web_contents) { | |
| 774 // When the current tab's SSL state changes, we need to update the URL | |
| 775 // bar to reflect the new state. | |
| 776 DCHECK(web_contents); | |
| 777 if (tab_strip_model_->GetActiveWebContents() == web_contents) | |
| 778 UpdateToolbar(false); | |
| 779 } | |
| 780 | |
| 781 | |
| 782 /////////////////////////////////////////////////////////////////////////////// | 773 /////////////////////////////////////////////////////////////////////////////// |
| 783 // Browser, Assorted browser commands: | 774 // Browser, Assorted browser commands: |
| 784 | 775 |
| 785 void Browser::ToggleFullscreenModeWithExtension(const GURL& extension_url) { | 776 void Browser::ToggleFullscreenModeWithExtension(const GURL& extension_url) { |
| 786 fullscreen_controller_-> | 777 fullscreen_controller_-> |
| 787 ToggleBrowserFullscreenModeWithExtension(extension_url); | 778 ToggleBrowserFullscreenModeWithExtension(extension_url); |
| 788 } | 779 } |
| 789 | 780 |
| 790 bool Browser::SupportsWindowFeature(WindowFeature feature) const { | 781 bool Browser::SupportsWindowFeature(WindowFeature feature) const { |
| 791 return SupportsWindowFeatureImpl(feature, true); | 782 return SupportsWindowFeatureImpl(feature, true); |
| (...skipping 536 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1328 | 1319 |
| 1329 // We can synchronously update commands since they will only change once per | 1320 // We can synchronously update commands since they will only change once per |
| 1330 // navigation, so we don't have to worry about flickering. We do, however, | 1321 // navigation, so we don't have to worry about flickering. We do, however, |
| 1331 // need to update the command state early on load to always present usable | 1322 // need to update the command state early on load to always present usable |
| 1332 // actions in the face of slow-to-commit pages. | 1323 // actions in the face of slow-to-commit pages. |
| 1333 if (changed_flags & (content::INVALIDATE_TYPE_URL | | 1324 if (changed_flags & (content::INVALIDATE_TYPE_URL | |
| 1334 content::INVALIDATE_TYPE_LOAD)) | 1325 content::INVALIDATE_TYPE_LOAD)) |
| 1335 command_controller_->TabStateChanged(); | 1326 command_controller_->TabStateChanged(); |
| 1336 } | 1327 } |
| 1337 | 1328 |
| 1329 void Browser::VisibleSSLStateChanged(const WebContents* source) { |
| 1330 // When the current tab's SSL state changes, we need to update the URL |
| 1331 // bar to reflect the new state. |
| 1332 DCHECK(source); |
| 1333 if (tab_strip_model_->GetActiveWebContents() == source) |
| 1334 UpdateToolbar(false); |
| 1335 } |
| 1336 |
| 1338 void Browser::AddNewContents(WebContents* source, | 1337 void Browser::AddNewContents(WebContents* source, |
| 1339 WebContents* new_contents, | 1338 WebContents* new_contents, |
| 1340 WindowOpenDisposition disposition, | 1339 WindowOpenDisposition disposition, |
| 1341 const gfx::Rect& initial_pos, | 1340 const gfx::Rect& initial_pos, |
| 1342 bool user_gesture, | 1341 bool user_gesture, |
| 1343 bool* was_blocked) { | 1342 bool* was_blocked) { |
| 1344 chrome::AddWebContents(this, source, new_contents, disposition, initial_pos, | 1343 chrome::AddWebContents(this, source, new_contents, disposition, initial_pos, |
| 1345 user_gesture, was_blocked); | 1344 user_gesture, was_blocked); |
| 1346 } | 1345 } |
| 1347 | 1346 |
| (...skipping 1071 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2419 if (contents && !allow_js_access) { | 2418 if (contents && !allow_js_access) { |
| 2420 contents->web_contents()->GetController().LoadURL( | 2419 contents->web_contents()->GetController().LoadURL( |
| 2421 target_url, | 2420 target_url, |
| 2422 content::Referrer(), | 2421 content::Referrer(), |
| 2423 content::PAGE_TRANSITION_LINK, | 2422 content::PAGE_TRANSITION_LINK, |
| 2424 std::string()); // No extra headers. | 2423 std::string()); // No extra headers. |
| 2425 } | 2424 } |
| 2426 | 2425 |
| 2427 return contents != NULL; | 2426 return contents != NULL; |
| 2428 } | 2427 } |
| OLD | NEW |