| 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 1508 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1519 chrome::AddWebContents(this, source, new_contents, disposition, initial_rect, | 1519 chrome::AddWebContents(this, source, new_contents, disposition, initial_rect, |
| 1520 user_gesture, was_blocked); | 1520 user_gesture, was_blocked); |
| 1521 } | 1521 } |
| 1522 | 1522 |
| 1523 void Browser::ActivateContents(WebContents* contents) { | 1523 void Browser::ActivateContents(WebContents* contents) { |
| 1524 tab_strip_model_->ActivateTabAt( | 1524 tab_strip_model_->ActivateTabAt( |
| 1525 tab_strip_model_->GetIndexOfWebContents(contents), false); | 1525 tab_strip_model_->GetIndexOfWebContents(contents), false); |
| 1526 window_->Activate(); | 1526 window_->Activate(); |
| 1527 } | 1527 } |
| 1528 | 1528 |
| 1529 void Browser::DeactivateContents(WebContents* contents) { | |
| 1530 window_->Deactivate(); | |
| 1531 } | |
| 1532 | |
| 1533 void Browser::LoadingStateChanged(WebContents* source, | 1529 void Browser::LoadingStateChanged(WebContents* source, |
| 1534 bool to_different_document) { | 1530 bool to_different_document) { |
| 1535 window_->UpdateLoadingAnimations(tab_strip_model_->TabsAreLoading()); | 1531 window_->UpdateLoadingAnimations(tab_strip_model_->TabsAreLoading()); |
| 1536 window_->UpdateTitleBar(); | 1532 window_->UpdateTitleBar(); |
| 1537 | 1533 |
| 1538 WebContents* selected_contents = tab_strip_model_->GetActiveWebContents(); | 1534 WebContents* selected_contents = tab_strip_model_->GetActiveWebContents(); |
| 1539 if (source == selected_contents) { | 1535 if (source == selected_contents) { |
| 1540 bool is_loading = source->IsLoading() && to_different_document; | 1536 bool is_loading = source->IsLoading() && to_different_document; |
| 1541 command_controller_->LoadingStateChanged(is_loading, false); | 1537 command_controller_->LoadingStateChanged(is_loading, false); |
| 1542 if (GetStatusBubble()) { | 1538 if (GetStatusBubble()) { |
| (...skipping 1160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2703 if (contents && !allow_js_access) { | 2699 if (contents && !allow_js_access) { |
| 2704 contents->web_contents()->GetController().LoadURL( | 2700 contents->web_contents()->GetController().LoadURL( |
| 2705 target_url, | 2701 target_url, |
| 2706 content::Referrer(), | 2702 content::Referrer(), |
| 2707 ui::PAGE_TRANSITION_LINK, | 2703 ui::PAGE_TRANSITION_LINK, |
| 2708 std::string()); // No extra headers. | 2704 std::string()); // No extra headers. |
| 2709 } | 2705 } |
| 2710 | 2706 |
| 2711 return contents != NULL; | 2707 return contents != NULL; |
| 2712 } | 2708 } |
| OLD | NEW |