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/vista_frame.h" | 5 #include "chrome/browser/vista_frame.h" |
6 | 6 |
7 #include <windows.h> | 7 #include <windows.h> |
8 #include <atlbase.h> | 8 #include <atlbase.h> |
9 #include <atlapp.h> | 9 #include <atlapp.h> |
10 #include <atltheme.h> | 10 #include <atltheme.h> |
(...skipping 1558 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1569 TabContentsContainerView* VistaFrame::GetTabContentsContainer() { | 1569 TabContentsContainerView* VistaFrame::GetTabContentsContainer() { |
1570 return tab_contents_container_; | 1570 return tab_contents_container_; |
1571 } | 1571 } |
1572 | 1572 |
1573 void VistaFrame::DestroyBrowser() { | 1573 void VistaFrame::DestroyBrowser() { |
1574 // TODO(beng): (Cleanup) tidy this up, just fixing the build red for now. | 1574 // TODO(beng): (Cleanup) tidy this up, just fixing the build red for now. |
1575 // Need to do this first, before the browser_ is deleted and we can't remove | 1575 // Need to do this first, before the browser_ is deleted and we can't remove |
1576 // the tabstrip from the model's observer list because the model was | 1576 // the tabstrip from the model's observer list because the model was |
1577 // destroyed with browser_. | 1577 // destroyed with browser_. |
1578 if (browser_) { | 1578 if (browser_) { |
| 1579 if (bookmark_bar_view_.get() && bookmark_bar_view_->GetParent()) { |
| 1580 // The bookmark bar should not be parented by the time we get here. |
| 1581 // If you hit this NOTREACHED file a bug with the trace. |
| 1582 NOTREACHED(); |
| 1583 bookmark_bar_view_->GetParent()->RemoveChildView(bookmark_bar_view_.get())
; |
| 1584 } |
| 1585 |
| 1586 // Explicitly delete the BookmarkBarView now. That way we don't have to |
| 1587 // worry about the BookmarkBarView potentially outliving the Browser & |
| 1588 // Profile. |
| 1589 bookmark_bar_view_.reset(NULL); |
| 1590 |
1579 browser_->tabstrip_model()->RemoveObserver(tabstrip_); | 1591 browser_->tabstrip_model()->RemoveObserver(tabstrip_); |
1580 delete browser_; | 1592 delete browser_; |
1581 browser_ = NULL; | 1593 browser_ = NULL; |
1582 } | 1594 } |
1583 } | 1595 } |
1584 | 1596 |
1585 void VistaFrame::ShelfVisibilityChangedImpl(TabContents* current_tab) { | 1597 void VistaFrame::ShelfVisibilityChangedImpl(TabContents* current_tab) { |
1586 // Coalesce layouts. | 1598 // Coalesce layouts. |
1587 bool changed = false; | 1599 bool changed = false; |
1588 | 1600 |
(...skipping 14 matching lines...) Expand all Loading... |
1603 &active_bookmark_bar_); | 1615 &active_bookmark_bar_); |
1604 | 1616 |
1605 // Only do a layout if the current contents is non-null. We assume that if the | 1617 // Only do a layout if the current contents is non-null. We assume that if the |
1606 // contents is NULL, we're either being destroyed, or ShowTabContents is going | 1618 // contents is NULL, we're either being destroyed, or ShowTabContents is going |
1607 // to be invoked with a non-null TabContents again so that there is no need | 1619 // to be invoked with a non-null TabContents again so that there is no need |
1608 // in doing a layout now (and would result in extra work/invalidation on | 1620 // in doing a layout now (and would result in extra work/invalidation on |
1609 // tab switches). | 1621 // tab switches). |
1610 if (changed && current_tab) | 1622 if (changed && current_tab) |
1611 Layout(); | 1623 Layout(); |
1612 } | 1624 } |
1613 | |
OLD | NEW |