Chromium Code Reviews| 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 1410 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1421 command_controller_->TabStateChanged(); | 1421 command_controller_->TabStateChanged(); |
| 1422 | 1422 |
| 1423 if (hosted_app_controller_) | 1423 if (hosted_app_controller_) |
| 1424 hosted_app_controller_->UpdateLocationBarVisibility(true); | 1424 hosted_app_controller_->UpdateLocationBarVisibility(true); |
| 1425 } | 1425 } |
| 1426 | 1426 |
| 1427 void Browser::VisibleSSLStateChanged(const WebContents* source) { | 1427 void Browser::VisibleSSLStateChanged(const WebContents* source) { |
| 1428 // When the current tab's SSL state changes, we need to update the URL | 1428 // When the current tab's SSL state changes, we need to update the URL |
| 1429 // bar to reflect the new state. | 1429 // bar to reflect the new state. |
| 1430 DCHECK(source); | 1430 DCHECK(source); |
| 1431 if (tab_strip_model_->GetActiveWebContents() == source) | 1431 WebContents* active_contents = tab_strip_model_->GetActiveWebContents(); |
| 1432 if (active_contents == source) { | |
|
sky
2016/10/14 22:21:47
Why do you only care about the active webcontents?
estark
2016/10/14 23:50:01
Done, but there's an unfortunate side effect of th
sky
2016/10/17 15:41:48
Ick. I think it better to change the function to n
estark
2016/10/17 16:11:13
Why? This API explicitly goes against the content
estark
2016/10/17 16:14:08
Actually re-reading your comment I'm not sure I un
| |
| 1432 UpdateToolbar(false); | 1433 UpdateToolbar(false); |
| 1434 ChromeSecurityStateModelClient* security_model = | |
| 1435 ChromeSecurityStateModelClient::FromWebContents(active_contents); | |
| 1436 security_model->VisibleSSLStateChanged(); | |
| 1437 } | |
| 1433 } | 1438 } |
| 1434 | 1439 |
| 1435 void Browser::AddNewContents(WebContents* source, | 1440 void Browser::AddNewContents(WebContents* source, |
| 1436 WebContents* new_contents, | 1441 WebContents* new_contents, |
| 1437 WindowOpenDisposition disposition, | 1442 WindowOpenDisposition disposition, |
| 1438 const gfx::Rect& initial_rect, | 1443 const gfx::Rect& initial_rect, |
| 1439 bool user_gesture, | 1444 bool user_gesture, |
| 1440 bool* was_blocked) { | 1445 bool* was_blocked) { |
| 1441 chrome::AddWebContents(this, source, new_contents, disposition, initial_rect, | 1446 chrome::AddWebContents(this, source, new_contents, disposition, initial_rect, |
| 1442 user_gesture, was_blocked); | 1447 user_gesture, was_blocked); |
| (...skipping 1127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2570 if (contents && !allow_js_access) { | 2575 if (contents && !allow_js_access) { |
| 2571 contents->web_contents()->GetController().LoadURL( | 2576 contents->web_contents()->GetController().LoadURL( |
| 2572 target_url, | 2577 target_url, |
| 2573 content::Referrer(), | 2578 content::Referrer(), |
| 2574 ui::PAGE_TRANSITION_LINK, | 2579 ui::PAGE_TRANSITION_LINK, |
| 2575 std::string()); // No extra headers. | 2580 std::string()); // No extra headers. |
| 2576 } | 2581 } |
| 2577 | 2582 |
| 2578 return contents != NULL; | 2583 return contents != NULL; |
| 2579 } | 2584 } |
| OLD | NEW |