| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 "ui/views/controls/tabbed_pane/native_tabbed_pane_win.h" | 5 #include "ui/views/controls/tabbed_pane/native_tabbed_pane_win.h" |
| 6 | 6 |
| 7 #include <vssym32.h> | 7 #include <vssym32.h> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/stl_util.h" | 10 #include "base/stl_util.h" |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 132 | 132 |
| 133 void NativeTabbedPaneWin::AddTab(const string16& title, View* contents) { | 133 void NativeTabbedPaneWin::AddTab(const string16& title, View* contents) { |
| 134 AddTabAtIndex(static_cast<int>(tab_views_.size()), title, contents, true); | 134 AddTabAtIndex(static_cast<int>(tab_views_.size()), title, contents, true); |
| 135 } | 135 } |
| 136 | 136 |
| 137 void NativeTabbedPaneWin::AddTabAtIndex(int index, | 137 void NativeTabbedPaneWin::AddTabAtIndex(int index, |
| 138 const string16& title, | 138 const string16& title, |
| 139 View* contents, | 139 View* contents, |
| 140 bool select_if_first_tab) { | 140 bool select_if_first_tab) { |
| 141 DCHECK(index <= static_cast<int>(tab_views_.size())); | 141 DCHECK(index <= static_cast<int>(tab_views_.size())); |
| 142 contents->set_parent_owned(false); | 142 contents->set_owned_by_client(); |
| 143 contents->SetVisible(false); | 143 contents->SetVisible(false); |
| 144 tab_views_.insert(tab_views_.begin() + index, contents); | 144 tab_views_.insert(tab_views_.begin() + index, contents); |
| 145 tab_titles_.insert(tab_titles_.begin() + index, title); | 145 tab_titles_.insert(tab_titles_.begin() + index, title); |
| 146 | 146 |
| 147 if (!contents->background()) | 147 if (!contents->background()) |
| 148 contents->set_background(new TabBackground); | 148 contents->set_background(new TabBackground); |
| 149 | 149 |
| 150 if (tab_views_.size() == 1 && select_if_first_tab) | 150 if (tab_views_.size() == 1 && select_if_first_tab) |
| 151 selected_index_ = 0; | 151 selected_index_ = 0; |
| 152 | 152 |
| (...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 398 //////////////////////////////////////////////////////////////////////////////// | 398 //////////////////////////////////////////////////////////////////////////////// |
| 399 // NativeTabbedPaneWrapper, public: | 399 // NativeTabbedPaneWrapper, public: |
| 400 | 400 |
| 401 // static | 401 // static |
| 402 NativeTabbedPaneWrapper* NativeTabbedPaneWrapper::CreateNativeWrapper( | 402 NativeTabbedPaneWrapper* NativeTabbedPaneWrapper::CreateNativeWrapper( |
| 403 TabbedPane* tabbed_pane) { | 403 TabbedPane* tabbed_pane) { |
| 404 return new NativeTabbedPaneWin(tabbed_pane); | 404 return new NativeTabbedPaneWin(tabbed_pane); |
| 405 } | 405 } |
| 406 | 406 |
| 407 } // namespace views | 407 } // namespace views |
| OLD | NEW |