| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 "app/l10n_util.h" | 7 #include "app/l10n_util.h" |
| 8 #include "app/resource_bundle.h" | 8 #include "app/resource_bundle.h" |
| 9 #include "base/file_version_info.h" | 9 #include "base/file_version_info.h" |
| 10 #include "base/process_util.h" | 10 #include "base/process_util.h" |
| (...skipping 880 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 891 } | 891 } |
| 892 | 892 |
| 893 void TabContents::OnStartDownload(DownloadItem* download) { | 893 void TabContents::OnStartDownload(DownloadItem* download) { |
| 894 DCHECK(download); | 894 DCHECK(download); |
| 895 | 895 |
| 896 // Download in a constrained popup is shown in the tab that opened it. | 896 // Download in a constrained popup is shown in the tab that opened it. |
| 897 TabContents* tab_contents = delegate()->GetConstrainingContents(this); | 897 TabContents* tab_contents = delegate()->GetConstrainingContents(this); |
| 898 | 898 |
| 899 if (tab_contents && tab_contents->delegate()) | 899 if (tab_contents && tab_contents->delegate()) |
| 900 tab_contents->delegate()->OnStartDownload(download); | 900 tab_contents->delegate()->OnStartDownload(download); |
| 901 |
| 902 // Update the URL display. |
| 903 // If the download is caused by typing in a downloadable URL, e.g., |
| 904 // http://example.com/somefile.zip, into the omnibox, the previous URL |
| 905 // will reappear. |
| 906 if (delegate()) |
| 907 delegate()->NavigationStateChanged(this, TabContents::INVALIDATE_URL); |
| 901 } | 908 } |
| 902 | 909 |
| 903 void TabContents::WillClose(ConstrainedWindow* window) { | 910 void TabContents::WillClose(ConstrainedWindow* window) { |
| 904 ConstrainedWindowList::iterator it = | 911 ConstrainedWindowList::iterator it = |
| 905 find(child_windows_.begin(), child_windows_.end(), window); | 912 find(child_windows_.begin(), child_windows_.end(), window); |
| 906 if (it != child_windows_.end()) | 913 if (it != child_windows_.end()) |
| 907 child_windows_.erase(it); | 914 child_windows_.erase(it); |
| 908 } | 915 } |
| 909 | 916 |
| 910 void TabContents::WillCloseBlockedPopupContainer( | 917 void TabContents::WillCloseBlockedPopupContainer( |
| (...skipping 1423 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2334 NavigationController::LoadCommittedDetails& committed_details = | 2341 NavigationController::LoadCommittedDetails& committed_details = |
| 2335 *(Details<NavigationController::LoadCommittedDetails>(details).ptr()); | 2342 *(Details<NavigationController::LoadCommittedDetails>(details).ptr()); |
| 2336 ExpireInfoBars(committed_details); | 2343 ExpireInfoBars(committed_details); |
| 2337 break; | 2344 break; |
| 2338 } | 2345 } |
| 2339 | 2346 |
| 2340 default: | 2347 default: |
| 2341 NOTREACHED(); | 2348 NOTREACHED(); |
| 2342 } | 2349 } |
| 2343 } | 2350 } |
| OLD | NEW |