| 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 429 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 440 // Notify PDM that this is a first run. | 440 // Notify PDM that this is a first run. |
| 441 ImportAutofillDataWin( | 441 ImportAutofillDataWin( |
| 442 autofill::PersonalDataManagerFactory::GetForProfile(profile_)); | 442 autofill::PersonalDataManagerFactory::GetForProfile(profile_)); |
| 443 #endif // defined(OS_WIN) | 443 #endif // defined(OS_WIN) |
| 444 } | 444 } |
| 445 | 445 |
| 446 fullscreen_controller_.reset(new FullscreenController(this)); | 446 fullscreen_controller_.reset(new FullscreenController(this)); |
| 447 } | 447 } |
| 448 | 448 |
| 449 Browser::~Browser() { | 449 Browser::~Browser() { |
| 450 // Stop observing notifications before continuing with destruction. Profile | |
| 451 // destruction will unload extensions and reentrant calls to Browser:: should | |
| 452 // be avoided while it is being torn down. | |
| 453 registrar_.RemoveAll(); | |
| 454 | |
| 455 // The tab strip should not have any tabs at this point. | 450 // The tab strip should not have any tabs at this point. |
| 456 DCHECK(tab_strip_model_->empty()); | 451 DCHECK(tab_strip_model_->empty()); |
| 457 tab_strip_model_->RemoveObserver(this); | 452 tab_strip_model_->RemoveObserver(this); |
| 458 | 453 |
| 459 // Destroy the BrowserCommandController before removing the browser, so that | 454 // Destroy the BrowserCommandController before removing the browser, so that |
| 460 // it doesn't act on any notifications that are sent as a result of removing | 455 // it doesn't act on any notifications that are sent as a result of removing |
| 461 // the browser. | 456 // the browser. |
| 462 command_controller_.reset(); | 457 command_controller_.reset(); |
| 463 BrowserList::RemoveBrowser(this); | 458 BrowserList::RemoveBrowser(this); |
| 464 | 459 |
| (...skipping 1956 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2421 if (contents && !allow_js_access) { | 2416 if (contents && !allow_js_access) { |
| 2422 contents->web_contents()->GetController().LoadURL( | 2417 contents->web_contents()->GetController().LoadURL( |
| 2423 target_url, | 2418 target_url, |
| 2424 content::Referrer(), | 2419 content::Referrer(), |
| 2425 content::PAGE_TRANSITION_LINK, | 2420 content::PAGE_TRANSITION_LINK, |
| 2426 std::string()); // No extra headers. | 2421 std::string()); // No extra headers. |
| 2427 } | 2422 } |
| 2428 | 2423 |
| 2429 return contents != NULL; | 2424 return contents != NULL; |
| 2430 } | 2425 } |
| OLD | NEW |