OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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/xp_frame.h" | 5 #include "chrome/browser/xp_frame.h" |
6 | 6 |
7 #include <windows.h> | 7 #include <windows.h> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/gfx/native_theme.h" | 10 #include "base/gfx/native_theme.h" |
(...skipping 2444 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2455 void XPFrame::SetIsOffTheRecord(bool value) { | 2455 void XPFrame::SetIsOffTheRecord(bool value) { |
2456 is_off_the_record_ = value; | 2456 is_off_the_record_ = value; |
2457 } | 2457 } |
2458 | 2458 |
2459 void XPFrame::DestroyBrowser() { | 2459 void XPFrame::DestroyBrowser() { |
2460 // TODO(beng): (Cleanup) tidy this up, just fixing the build red for now. | 2460 // TODO(beng): (Cleanup) tidy this up, just fixing the build red for now. |
2461 // Need to do this first, before the browser_ is deleted and we can't remove | 2461 // Need to do this first, before the browser_ is deleted and we can't remove |
2462 // the tabstrip from the model's observer list because the model was | 2462 // the tabstrip from the model's observer list because the model was |
2463 // destroyed with browser_. | 2463 // destroyed with browser_. |
2464 if (browser_) { | 2464 if (browser_) { |
| 2465 if (bookmark_bar_view_.get() && bookmark_bar_view_->GetParent()) { |
| 2466 // The bookmark bar should not be parented by the time we get here. |
| 2467 // If you hit this NOTREACHED file a bug with the trace. |
| 2468 NOTREACHED(); |
| 2469 bookmark_bar_view_->GetParent()->RemoveChildView(bookmark_bar_view_.get())
; |
| 2470 } |
| 2471 |
| 2472 // Explicitly delete the BookmarkBarView now. That way we don't have to |
| 2473 // worry about the BookmarkBarView potentially outliving the Browser & |
| 2474 // Profile. |
| 2475 bookmark_bar_view_.reset(NULL); |
| 2476 |
2465 browser_->tabstrip_model()->RemoveObserver(tabstrip_); | 2477 browser_->tabstrip_model()->RemoveObserver(tabstrip_); |
2466 delete browser_; | 2478 delete browser_; |
2467 browser_ = NULL; | 2479 browser_ = NULL; |
2468 } | 2480 } |
2469 } | 2481 } |
2470 | 2482 |
2471 void XPFrame::ShelfVisibilityChangedImpl(TabContents* current_tab) { | 2483 void XPFrame::ShelfVisibilityChangedImpl(TabContents* current_tab) { |
2472 // Coalesce layouts. | 2484 // Coalesce layouts. |
2473 bool changed = false; | 2485 bool changed = false; |
2474 | 2486 |
(...skipping 15 matching lines...) Expand all Loading... |
2490 | 2502 |
2491 // Only do a layout if the current contents is non-null. We assume that if the | 2503 // Only do a layout if the current contents is non-null. We assume that if the |
2492 // contents is NULL, we're either being destroyed, or ShowTabContents is going | 2504 // contents is NULL, we're either being destroyed, or ShowTabContents is going |
2493 // to be invoked with a non-null TabContents again so that there is no need | 2505 // to be invoked with a non-null TabContents again so that there is no need |
2494 // in doing a layout now (and would result in extra work/invalidation on | 2506 // in doing a layout now (and would result in extra work/invalidation on |
2495 // tab switches). | 2507 // tab switches). |
2496 if (changed && current_tab) | 2508 if (changed && current_tab) |
2497 Layout(); | 2509 Layout(); |
2498 } | 2510 } |
2499 | 2511 |
OLD | NEW |