| 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/views/frame/browser_view.h" | 5 #include "chrome/browser/ui/views/frame/browser_view.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/auto_reset.h" | 9 #include "base/auto_reset.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 1423 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1434 return contents_web_view_; | 1434 return contents_web_view_; |
| 1435 } | 1435 } |
| 1436 | 1436 |
| 1437 ToolbarView* BrowserView::GetToolbarView() const { | 1437 ToolbarView* BrowserView::GetToolbarView() const { |
| 1438 return toolbar_; | 1438 return toolbar_; |
| 1439 } | 1439 } |
| 1440 | 1440 |
| 1441 /////////////////////////////////////////////////////////////////////////////// | 1441 /////////////////////////////////////////////////////////////////////////////// |
| 1442 // BrowserView, TabStripModelObserver implementation: | 1442 // BrowserView, TabStripModelObserver implementation: |
| 1443 | 1443 |
| 1444 void BrowserView::TabDetachedAt(WebContents* contents, int index) { | 1444 void BrowserView::TabDetachedAt(WebContents* contents, |
| 1445 int index, |
| 1446 bool closing_all) { |
| 1445 // We use index here rather than comparing |contents| because by this time | 1447 // We use index here rather than comparing |contents| because by this time |
| 1446 // the model has already removed |contents| from its list, so | 1448 // the model has already removed |contents| from its list, so |
| 1447 // browser_->GetActiveWebContents() will return NULL or something else. | 1449 // browser_->GetActiveWebContents() will return NULL or something else. |
| 1448 if (index == browser_->tab_strip_model()->active_index()) { | 1450 if (index == browser_->tab_strip_model()->active_index()) { |
| 1449 // We need to reset the current tab contents to NULL before it gets | 1451 // We need to reset the current tab contents to NULL before it gets |
| 1450 // freed. This is because the focus manager performs some operations | 1452 // freed. This is because the focus manager performs some operations |
| 1451 // on the selected WebContents when it is removed. | 1453 // on the selected WebContents when it is removed. |
| 1452 contents_web_view_->SetWebContents(NULL); | 1454 contents_web_view_->SetWebContents(NULL); |
| 1453 infobar_container_->ChangeInfoBarService(NULL); | 1455 infobar_container_->ChangeInfoBarService(NULL); |
| 1454 UpdateDevToolsForContents(NULL); | 1456 UpdateDevToolsForContents(NULL); |
| (...skipping 1321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2776 // The +1 in the next line creates a 1-px gap between icon and arrow tip. | 2778 // The +1 in the next line creates a 1-px gap between icon and arrow tip. |
| 2777 gfx::Point icon_bottom(0, location_icon_view->GetImageBounds().bottom() - | 2779 gfx::Point icon_bottom(0, location_icon_view->GetImageBounds().bottom() - |
| 2778 LocationBarView::kIconInternalPadding + 1); | 2780 LocationBarView::kIconInternalPadding + 1); |
| 2779 ConvertPointToTarget(location_icon_view, this, &icon_bottom); | 2781 ConvertPointToTarget(location_icon_view, this, &icon_bottom); |
| 2780 gfx::Point infobar_top(0, infobar_container_->GetVerticalOverlap(NULL)); | 2782 gfx::Point infobar_top(0, infobar_container_->GetVerticalOverlap(NULL)); |
| 2781 ConvertPointToTarget(infobar_container_, this, &infobar_top); | 2783 ConvertPointToTarget(infobar_container_, this, &infobar_top); |
| 2782 top_arrow_height = infobar_top.y() - icon_bottom.y(); | 2784 top_arrow_height = infobar_top.y() - icon_bottom.y(); |
| 2783 } | 2785 } |
| 2784 return top_arrow_height; | 2786 return top_arrow_height; |
| 2785 } | 2787 } |
| OLD | NEW |