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 4066 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4077 // TODO(ojan): We should add a call to browser_shutdown::OnShutdownStarting | 4077 // TODO(ojan): We should add a call to browser_shutdown::OnShutdownStarting |
4078 // somewhere around here so that we have accurate measurements of shutdown | 4078 // somewhere around here so that we have accurate measurements of shutdown |
4079 // time. | 4079 // time. |
4080 // TODO(ojan): We can probably fire all the unload events in parallel and | 4080 // TODO(ojan): We can probably fire all the unload events in parallel and |
4081 // get a perf benefit from that in the cases where the tab hangs in it's | 4081 // get a perf benefit from that in the cases where the tab hangs in it's |
4082 // unload handler or takes a long time to page in. | 4082 // unload handler or takes a long time to page in. |
4083 TabContents* tab = *(tabs_needing_unload_fired_.begin()); | 4083 TabContents* tab = *(tabs_needing_unload_fired_.begin()); |
4084 // Null check render_view_host here as this gets called on a PostTask and | 4084 // Null check render_view_host here as this gets called on a PostTask and |
4085 // the tab's render_view_host may have been nulled out. | 4085 // the tab's render_view_host may have been nulled out. |
4086 if (tab->render_view_host()) { | 4086 if (tab->render_view_host()) { |
4087 tab->render_view_host()->ClosePage(false, -1, -1); | 4087 tab->render_view_host()->ClosePage(); |
4088 } else { | 4088 } else { |
4089 ClearUnloadState(tab, true); | 4089 ClearUnloadState(tab, true); |
4090 } | 4090 } |
4091 } else { | 4091 } else { |
4092 NOTREACHED(); | 4092 NOTREACHED(); |
4093 } | 4093 } |
4094 } | 4094 } |
4095 | 4095 |
4096 bool Browser::HasCompletedUnloadProcessing() const { | 4096 bool Browser::HasCompletedUnloadProcessing() const { |
4097 return is_attempting_to_close_browser_ && | 4097 return is_attempting_to_close_browser_ && |
(...skipping 393 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4491 TabContents* current_tab = GetSelectedTabContents(); | 4491 TabContents* current_tab = GetSelectedTabContents(); |
4492 if (current_tab) { | 4492 if (current_tab) { |
4493 content_restrictions = current_tab->content_restrictions(); | 4493 content_restrictions = current_tab->content_restrictions(); |
4494 NavigationEntry* active_entry = current_tab->controller().GetActiveEntry(); | 4494 NavigationEntry* active_entry = current_tab->controller().GetActiveEntry(); |
4495 // See comment in UpdateCommandsForTabState about why we call url(). | 4495 // See comment in UpdateCommandsForTabState about why we call url(). |
4496 if (!SavePackage::IsSavableURL(active_entry ? active_entry->url() : GURL())) | 4496 if (!SavePackage::IsSavableURL(active_entry ? active_entry->url() : GURL())) |
4497 content_restrictions |= CONTENT_RESTRICTION_SAVE; | 4497 content_restrictions |= CONTENT_RESTRICTION_SAVE; |
4498 } | 4498 } |
4499 return content_restrictions; | 4499 return content_restrictions; |
4500 } | 4500 } |
OLD | NEW |