| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 <shellapi.h> | 8 #include <shellapi.h> |
| 9 #include <windows.h> | 9 #include <windows.h> |
| 10 #endif // OS_WIN | 10 #endif // OS_WIN |
| (...skipping 4183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4194 // TODO(ojan): We should add a call to browser_shutdown::OnShutdownStarting | 4194 // TODO(ojan): We should add a call to browser_shutdown::OnShutdownStarting |
| 4195 // somewhere around here so that we have accurate measurements of shutdown | 4195 // somewhere around here so that we have accurate measurements of shutdown |
| 4196 // time. | 4196 // time. |
| 4197 // TODO(ojan): We can probably fire all the unload events in parallel and | 4197 // TODO(ojan): We can probably fire all the unload events in parallel and |
| 4198 // get a perf benefit from that in the cases where the tab hangs in it's | 4198 // get a perf benefit from that in the cases where the tab hangs in it's |
| 4199 // unload handler or takes a long time to page in. | 4199 // unload handler or takes a long time to page in. |
| 4200 TabContents* tab = *(tabs_needing_unload_fired_.begin()); | 4200 TabContents* tab = *(tabs_needing_unload_fired_.begin()); |
| 4201 // Null check render_view_host here as this gets called on a PostTask and | 4201 // Null check render_view_host here as this gets called on a PostTask and |
| 4202 // the tab's render_view_host may have been nulled out. | 4202 // the tab's render_view_host may have been nulled out. |
| 4203 if (tab->render_view_host()) { | 4203 if (tab->render_view_host()) { |
| 4204 tab->render_view_host()->ClosePage(false, -1, -1); | 4204 tab->render_view_host()->ClosePage(); |
| 4205 } else { | 4205 } else { |
| 4206 ClearUnloadState(tab, true); | 4206 ClearUnloadState(tab, true); |
| 4207 } | 4207 } |
| 4208 } else { | 4208 } else { |
| 4209 NOTREACHED(); | 4209 NOTREACHED(); |
| 4210 } | 4210 } |
| 4211 } | 4211 } |
| 4212 | 4212 |
| 4213 bool Browser::HasCompletedUnloadProcessing() const { | 4213 bool Browser::HasCompletedUnloadProcessing() const { |
| 4214 return is_attempting_to_close_browser_ && | 4214 return is_attempting_to_close_browser_ && |
| (...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4601 TabContents* current_tab = GetSelectedTabContents(); | 4601 TabContents* current_tab = GetSelectedTabContents(); |
| 4602 if (current_tab) { | 4602 if (current_tab) { |
| 4603 content_restrictions = current_tab->content_restrictions(); | 4603 content_restrictions = current_tab->content_restrictions(); |
| 4604 NavigationEntry* active_entry = current_tab->controller().GetActiveEntry(); | 4604 NavigationEntry* active_entry = current_tab->controller().GetActiveEntry(); |
| 4605 // See comment in UpdateCommandsForTabState about why we call url(). | 4605 // See comment in UpdateCommandsForTabState about why we call url(). |
| 4606 if (!SavePackage::IsSavableURL(active_entry ? active_entry->url() : GURL())) | 4606 if (!SavePackage::IsSavableURL(active_entry ? active_entry->url() : GURL())) |
| 4607 content_restrictions |= CONTENT_RESTRICTION_SAVE; | 4607 content_restrictions |= CONTENT_RESTRICTION_SAVE; |
| 4608 } | 4608 } |
| 4609 return content_restrictions; | 4609 return content_restrictions; |
| 4610 } | 4610 } |
| OLD | NEW |