| 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/views/tabbed_pane.h" | 5 #include "chrome/views/tabbed_pane.h" |
| 6 | 6 |
| 7 #include <vssym32.h> | 7 #include <vssym32.h> |
| 8 | 8 |
| 9 #include "base/gfx/native_theme.h" | 9 #include "base/gfx/native_theme.h" |
| 10 #include "base/gfx/skia_utils.h" | 10 #include "base/gfx/skia_utils.h" |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 // That was the last tab. Remove the contents. | 113 // That was the last tab. Remove the contents. |
| 114 content_window_->GetRootView()->RemoveAllChildViews(false); | 114 content_window_->GetRootView()->RemoveAllChildViews(false); |
| 115 } | 115 } |
| 116 } | 116 } |
| 117 TabCtrl_DeleteItem(tab_control_, index); | 117 TabCtrl_DeleteItem(tab_control_, index); |
| 118 | 118 |
| 119 // The removed tab may have made the contents window bigger. | 119 // The removed tab may have made the contents window bigger. |
| 120 ResizeContents(tab_control_); | 120 ResizeContents(tab_control_); |
| 121 | 121 |
| 122 std::vector<View*>::iterator iter = tab_views_.begin() + index; | 122 std::vector<View*>::iterator iter = tab_views_.begin() + index; |
| 123 View* removed_tab = *iter; |
| 123 tab_views_.erase(iter); | 124 tab_views_.erase(iter); |
| 124 | 125 |
| 125 return *iter; | 126 return removed_tab; |
| 126 } | 127 } |
| 127 | 128 |
| 128 void TabbedPane::SelectTabAt(int index) { | 129 void TabbedPane::SelectTabAt(int index) { |
| 129 DCHECK(index < static_cast<int>(tab_views_.size())); | 130 DCHECK(index < static_cast<int>(tab_views_.size())); |
| 130 TabCtrl_SetCurSel(tab_control_, index); | 131 TabCtrl_SetCurSel(tab_control_, index); |
| 131 DoSelectTabAt(index); | 132 DoSelectTabAt(index); |
| 132 } | 133 } |
| 133 | 134 |
| 134 int TabbedPane::GetTabCount() { | 135 int TabbedPane::GetTabCount() { |
| 135 return TabCtrl_GetItemCount(tab_control_); | 136 return TabCtrl_GetItemCount(tab_control_); |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 244 if (!GetClientRect(tab_control, &content_bounds)) | 245 if (!GetClientRect(tab_control, &content_bounds)) |
| 245 return; | 246 return; |
| 246 TabCtrl_AdjustRect(tab_control, FALSE, &content_bounds); | 247 TabCtrl_AdjustRect(tab_control, FALSE, &content_bounds); |
| 247 content_window_->MoveWindow(content_bounds.left, content_bounds.top, | 248 content_window_->MoveWindow(content_bounds.left, content_bounds.top, |
| 248 content_bounds.Width(), content_bounds.Height(), | 249 content_bounds.Width(), content_bounds.Height(), |
| 249 TRUE); | 250 TRUE); |
| 250 } | 251 } |
| 251 | 252 |
| 252 } // namespace views | 253 } // namespace views |
| 253 | 254 |
| OLD | NEW |