| 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 4164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4175 // TODO(ojan): We should add a call to browser_shutdown::OnShutdownStarting | 4175 // TODO(ojan): We should add a call to browser_shutdown::OnShutdownStarting |
| 4176 // somewhere around here so that we have accurate measurements of shutdown | 4176 // somewhere around here so that we have accurate measurements of shutdown |
| 4177 // time. | 4177 // time. |
| 4178 // TODO(ojan): We can probably fire all the unload events in parallel and | 4178 // TODO(ojan): We can probably fire all the unload events in parallel and |
| 4179 // get a perf benefit from that in the cases where the tab hangs in it's | 4179 // get a perf benefit from that in the cases where the tab hangs in it's |
| 4180 // unload handler or takes a long time to page in. | 4180 // unload handler or takes a long time to page in. |
| 4181 TabContents* tab = *(tabs_needing_unload_fired_.begin()); | 4181 TabContents* tab = *(tabs_needing_unload_fired_.begin()); |
| 4182 // Null check render_view_host here as this gets called on a PostTask and | 4182 // Null check render_view_host here as this gets called on a PostTask and |
| 4183 // the tab's render_view_host may have been nulled out. | 4183 // the tab's render_view_host may have been nulled out. |
| 4184 if (tab->render_view_host()) { | 4184 if (tab->render_view_host()) { |
| 4185 tab->render_view_host()->ClosePage(false, -1, -1); | 4185 tab->render_view_host()->ClosePage(); |
| 4186 } else { | 4186 } else { |
| 4187 ClearUnloadState(tab, true); | 4187 ClearUnloadState(tab, true); |
| 4188 } | 4188 } |
| 4189 } else { | 4189 } else { |
| 4190 NOTREACHED(); | 4190 NOTREACHED(); |
| 4191 } | 4191 } |
| 4192 } | 4192 } |
| 4193 | 4193 |
| 4194 bool Browser::HasCompletedUnloadProcessing() const { | 4194 bool Browser::HasCompletedUnloadProcessing() const { |
| 4195 return is_attempting_to_close_browser_ && | 4195 return is_attempting_to_close_browser_ && |
| (...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4582 TabContents* current_tab = GetSelectedTabContents(); | 4582 TabContents* current_tab = GetSelectedTabContents(); |
| 4583 if (current_tab) { | 4583 if (current_tab) { |
| 4584 content_restrictions = current_tab->content_restrictions(); | 4584 content_restrictions = current_tab->content_restrictions(); |
| 4585 NavigationEntry* active_entry = current_tab->controller().GetActiveEntry(); | 4585 NavigationEntry* active_entry = current_tab->controller().GetActiveEntry(); |
| 4586 // See comment in UpdateCommandsForTabState about why we call url(). | 4586 // See comment in UpdateCommandsForTabState about why we call url(). |
| 4587 if (!SavePackage::IsSavableURL(active_entry ? active_entry->url() : GURL())) | 4587 if (!SavePackage::IsSavableURL(active_entry ? active_entry->url() : GURL())) |
| 4588 content_restrictions |= CONTENT_RESTRICTION_SAVE; | 4588 content_restrictions |= CONTENT_RESTRICTION_SAVE; |
| 4589 } | 4589 } |
| 4590 return content_restrictions; | 4590 return content_restrictions; |
| 4591 } | 4591 } |
| OLD | NEW |