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