OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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/tab_contents/tab_contents.h" | 5 #include "chrome/browser/tab_contents/tab_contents.h" |
6 | 6 |
7 #include "base/file_version_info.h" | 7 #include "base/file_version_info.h" |
8 #include "base/process_util.h" | 8 #include "base/process_util.h" |
9 #include "base/string16.h" | 9 #include "base/string16.h" |
10 #include "base/time.h" | 10 #include "base/time.h" |
(...skipping 1137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1148 load_state_host_.clear(); | 1148 load_state_host_.clear(); |
1149 } | 1149 } |
1150 | 1150 |
1151 render_manager_.SetIsLoading(is_loading); | 1151 render_manager_.SetIsLoading(is_loading); |
1152 | 1152 |
1153 is_loading_ = is_loading; | 1153 is_loading_ = is_loading; |
1154 waiting_for_response_ = is_loading; | 1154 waiting_for_response_ = is_loading; |
1155 | 1155 |
1156 if (delegate_) | 1156 if (delegate_) |
1157 delegate_->LoadingStateChanged(this); | 1157 delegate_->LoadingStateChanged(this); |
| 1158 NotifyNavigationStateChanged(INVALIDATE_LOAD); |
1158 | 1159 |
1159 NotificationType type = is_loading ? NotificationType::LOAD_START : | 1160 NotificationType type = is_loading ? NotificationType::LOAD_START : |
1160 NotificationType::LOAD_STOP; | 1161 NotificationType::LOAD_STOP; |
1161 NotificationDetails det = NotificationService::NoDetails();; | 1162 NotificationDetails det = NotificationService::NoDetails();; |
1162 if (details) | 1163 if (details) |
1163 det = Details<LoadNotificationDetails>(details); | 1164 det = Details<LoadNotificationDetails>(details); |
1164 NotificationService::current()->Notify(type, | 1165 NotificationService::current()->Notify(type, |
1165 Source<NavigationController>(&controller_), | 1166 Source<NavigationController>(&controller_), |
1166 det); | 1167 det); |
1167 } | 1168 } |
(...skipping 599 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1767 // Ignore this if it comes from a RenderViewHost that we aren't showing. | 1768 // Ignore this if it comes from a RenderViewHost that we aren't showing. |
1768 if (delegate() && rvh == render_view_host()) | 1769 if (delegate() && rvh == render_view_host()) |
1769 delegate()->CloseContents(this); | 1770 delegate()->CloseContents(this); |
1770 } | 1771 } |
1771 | 1772 |
1772 void TabContents::RequestMove(const gfx::Rect& new_bounds) { | 1773 void TabContents::RequestMove(const gfx::Rect& new_bounds) { |
1773 if (delegate() && delegate()->IsPopup(this)) | 1774 if (delegate() && delegate()->IsPopup(this)) |
1774 delegate()->MoveContents(this, new_bounds); | 1775 delegate()->MoveContents(this, new_bounds); |
1775 } | 1776 } |
1776 | 1777 |
1777 void TabContents::DidStartLoading(RenderViewHost* rvh, int32 page_id) { | 1778 void TabContents::DidStartLoading(RenderViewHost* rvh) { |
1778 SetIsLoading(true, NULL); | 1779 SetIsLoading(true, NULL); |
1779 } | 1780 } |
1780 | 1781 |
1781 void TabContents::DidStopLoading(RenderViewHost* rvh, int32 page_id) { | 1782 void TabContents::DidStopLoading(RenderViewHost* rvh) { |
1782 scoped_ptr<LoadNotificationDetails> details; | 1783 scoped_ptr<LoadNotificationDetails> details; |
1783 | 1784 |
1784 NavigationEntry* entry = controller_.GetActiveEntry(); | 1785 NavigationEntry* entry = controller_.GetActiveEntry(); |
1785 // An entry may not exist for a stop when loading an initial blank page or | 1786 // An entry may not exist for a stop when loading an initial blank page or |
1786 // if an iframe injected by script into a blank page finishes loading. | 1787 // if an iframe injected by script into a blank page finishes loading. |
1787 if (entry) { | 1788 if (entry) { |
1788 scoped_ptr<base::ProcessMetrics> metrics( | 1789 scoped_ptr<base::ProcessMetrics> metrics( |
1789 base::ProcessMetrics::CreateProcessMetrics( | 1790 base::ProcessMetrics::CreateProcessMetrics( |
1790 process()->process().handle())); | 1791 process()->process().handle())); |
1791 | 1792 |
(...skipping 639 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2431 NavigationController::LoadCommittedDetails& committed_details = | 2432 NavigationController::LoadCommittedDetails& committed_details = |
2432 *(Details<NavigationController::LoadCommittedDetails>(details).ptr()); | 2433 *(Details<NavigationController::LoadCommittedDetails>(details).ptr()); |
2433 ExpireInfoBars(committed_details); | 2434 ExpireInfoBars(committed_details); |
2434 break; | 2435 break; |
2435 } | 2436 } |
2436 | 2437 |
2437 default: | 2438 default: |
2438 NOTREACHED(); | 2439 NOTREACHED(); |
2439 } | 2440 } |
2440 } | 2441 } |
OLD | NEW |