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/browser.h" | 5 #include "chrome/browser/browser.h" |
6 | 6 |
7 #include <windows.h> | 7 #include <windows.h> |
8 #include <shellapi.h> | 8 #include <shellapi.h> |
9 | 9 |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 1097 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1108 } else if (!tabs_needing_unload_fired_.empty()) { | 1108 } else if (!tabs_needing_unload_fired_.empty()) { |
1109 // We've finished firing all beforeunload events and can proceed with unload | 1109 // We've finished firing all beforeunload events and can proceed with unload |
1110 // events. | 1110 // events. |
1111 // TODO(ojan): We should add a call to browser_shutdown::OnShutdownStarting | 1111 // TODO(ojan): We should add a call to browser_shutdown::OnShutdownStarting |
1112 // somewhere around here so that we have accurate measurements of shutdown | 1112 // somewhere around here so that we have accurate measurements of shutdown |
1113 // time. | 1113 // time. |
1114 // TODO(ojan): We can probably fire all the unload events in parallel and | 1114 // TODO(ojan): We can probably fire all the unload events in parallel and |
1115 // get a perf benefit from that in the cases where the tab hangs in it's | 1115 // get a perf benefit from that in the cases where the tab hangs in it's |
1116 // unload handler or takes a long time to page in. | 1116 // unload handler or takes a long time to page in. |
1117 TabContents* tab = tabs_needing_unload_fired_.back(); | 1117 TabContents* tab = tabs_needing_unload_fired_.back(); |
1118 tab->AsWebContents()->FirePageUnload(); | 1118 tab->AsWebContents()->render_view_host()->FirePageUnload(); |
1119 } else { | 1119 } else { |
1120 NOTREACHED(); | 1120 NOTREACHED(); |
1121 } | 1121 } |
1122 } | 1122 } |
1123 | 1123 |
1124 bool Browser::HasCompletedUnloadProcessing() { | 1124 bool Browser::HasCompletedUnloadProcessing() { |
1125 return is_attempting_to_close_browser_ && | 1125 return is_attempting_to_close_browser_ && |
1126 tabs_needing_before_unload_fired_.empty() && | 1126 tabs_needing_before_unload_fired_.empty() && |
1127 tabs_needing_unload_fired_.empty(); | 1127 tabs_needing_unload_fired_.empty(); |
1128 } | 1128 } |
(...skipping 726 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1855 void Browser::FormatTitleForDisplay(std::wstring* title) { | 1855 void Browser::FormatTitleForDisplay(std::wstring* title) { |
1856 size_t current_index = 0; | 1856 size_t current_index = 0; |
1857 size_t match_index; | 1857 size_t match_index; |
1858 while ((match_index = title->find(L'\n', current_index)) != | 1858 while ((match_index = title->find(L'\n', current_index)) != |
1859 std::wstring::npos) { | 1859 std::wstring::npos) { |
1860 title->replace(match_index, 1, L""); | 1860 title->replace(match_index, 1, L""); |
1861 current_index = match_index; | 1861 current_index = match_index; |
1862 } | 1862 } |
1863 } | 1863 } |
1864 | 1864 |
OLD | NEW |