OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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 <windows.h> | 8 #include <windows.h> |
9 #include <shellapi.h> | 9 #include <shellapi.h> |
10 #endif // defined(OS_WIN) | 10 #endif // defined(OS_WIN) |
(...skipping 464 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
475 #endif | 475 #endif |
476 | 476 |
477 profile_pref_registrar_.RemoveAll(); | 477 profile_pref_registrar_.RemoveAll(); |
478 | 478 |
479 encoding_auto_detect_.Destroy(); | 479 encoding_auto_detect_.Destroy(); |
480 | 480 |
481 // Destroy BrowserExtensionWindowController before the incognito profile | 481 // Destroy BrowserExtensionWindowController before the incognito profile |
482 // is destroyed to make sure the chrome.windows.onRemoved event is sent. | 482 // is destroyed to make sure the chrome.windows.onRemoved event is sent. |
483 extension_window_controller_.reset(); | 483 extension_window_controller_.reset(); |
484 | 484 |
| 485 // Destroy BrowserInstantController before the incongnito profile is destroyed |
| 486 // because the InstantController destructor depends on this profile. |
| 487 instant_controller_.reset(); |
| 488 |
485 if (profile_->IsOffTheRecord() && | 489 if (profile_->IsOffTheRecord() && |
486 !BrowserList::IsOffTheRecordSessionActiveForProfile(profile_)) { | 490 !BrowserList::IsOffTheRecordSessionActiveForProfile(profile_)) { |
487 // An incognito profile is no longer needed, this indirectly frees | 491 // An incognito profile is no longer needed, this indirectly frees |
488 // its cache and cookies once it gets destroyed at the appropriate time. | 492 // its cache and cookies once it gets destroyed at the appropriate time. |
489 ProfileDestroyer::DestroyProfileWhenAppropriate(profile_); | 493 ProfileDestroyer::DestroyProfileWhenAppropriate(profile_); |
490 } | 494 } |
491 | 495 |
492 // There may be pending file dialogs, we need to tell them that we've gone | 496 // There may be pending file dialogs, we need to tell them that we've gone |
493 // away so they don't try and call back to us. | 497 // away so they don't try and call back to us. |
494 if (select_file_dialog_.get()) | 498 if (select_file_dialog_.get()) |
(...skipping 1714 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2209 if (contents && !allow_js_access) { | 2213 if (contents && !allow_js_access) { |
2210 contents->web_contents()->GetController().LoadURL( | 2214 contents->web_contents()->GetController().LoadURL( |
2211 target_url, | 2215 target_url, |
2212 content::Referrer(), | 2216 content::Referrer(), |
2213 content::PAGE_TRANSITION_LINK, | 2217 content::PAGE_TRANSITION_LINK, |
2214 std::string()); // No extra headers. | 2218 std::string()); // No extra headers. |
2215 } | 2219 } |
2216 | 2220 |
2217 return contents != NULL; | 2221 return contents != NULL; |
2218 } | 2222 } |
OLD | NEW |