OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "views/controls/tabbed_pane/tabbed_pane.h" | 5 #include "views/controls/tabbed_pane/tabbed_pane.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 // TODO(avi): remove when not needed |
| 9 #include "base/utf_string_conversions.h" |
8 #include "ui/base/keycodes/keyboard_codes.h" | 10 #include "ui/base/keycodes/keyboard_codes.h" |
9 #include "views/controls/native/native_view_host.h" | 11 #include "views/controls/native/native_view_host.h" |
10 #include "views/controls/tabbed_pane/native_tabbed_pane_wrapper.h" | 12 #include "views/controls/tabbed_pane/native_tabbed_pane_wrapper.h" |
11 | 13 |
12 namespace views { | 14 namespace views { |
13 | 15 |
14 // static | 16 // static |
15 const char TabbedPane::kViewClassName[] = "views/TabbedPane"; | 17 const char TabbedPane::kViewClassName[] = "views/TabbedPane"; |
16 | 18 |
17 TabbedPane::TabbedPane() : native_tabbed_pane_(NULL), listener_(NULL) { | 19 TabbedPane::TabbedPane() : native_tabbed_pane_(NULL), listener_(NULL) { |
(...skipping 11 matching lines...) Expand all Loading... |
29 native_tabbed_pane_->AddTab(title, contents); | 31 native_tabbed_pane_->AddTab(title, contents); |
30 PreferredSizeChanged(); | 32 PreferredSizeChanged(); |
31 } | 33 } |
32 | 34 |
33 void TabbedPane::AddTabAtIndex(int index, | 35 void TabbedPane::AddTabAtIndex(int index, |
34 const std::wstring& title, | 36 const std::wstring& title, |
35 View* contents, | 37 View* contents, |
36 bool select_if_first_tab) { | 38 bool select_if_first_tab) { |
37 native_tabbed_pane_->AddTabAtIndex(index, title, contents, | 39 native_tabbed_pane_->AddTabAtIndex(index, title, contents, |
38 select_if_first_tab); | 40 select_if_first_tab); |
39 contents->SetAccessibleName(title); | 41 contents->SetAccessibleName(WideToUTF16Hack(title)); |
40 PreferredSizeChanged(); | 42 PreferredSizeChanged(); |
41 } | 43 } |
42 | 44 |
43 int TabbedPane::GetSelectedTabIndex() { | 45 int TabbedPane::GetSelectedTabIndex() { |
44 return native_tabbed_pane_->GetSelectedTabIndex(); | 46 return native_tabbed_pane_->GetSelectedTabIndex(); |
45 } | 47 } |
46 | 48 |
47 View* TabbedPane::GetSelectedTab() { | 49 View* TabbedPane::GetSelectedTab() { |
48 return native_tabbed_pane_->GetSelectedTab(); | 50 return native_tabbed_pane_->GetSelectedTab(); |
49 } | 51 } |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
132 AccessibilityTypes::Role TabbedPane::GetAccessibleRole() { | 134 AccessibilityTypes::Role TabbedPane::GetAccessibleRole() { |
133 return AccessibilityTypes::ROLE_PAGETABLIST; | 135 return AccessibilityTypes::ROLE_PAGETABLIST; |
134 } | 136 } |
135 | 137 |
136 gfx::Size TabbedPane::GetPreferredSize() { | 138 gfx::Size TabbedPane::GetPreferredSize() { |
137 return native_tabbed_pane_ ? | 139 return native_tabbed_pane_ ? |
138 native_tabbed_pane_->GetPreferredSize() : gfx::Size(); | 140 native_tabbed_pane_->GetPreferredSize() : gfx::Size(); |
139 } | 141 } |
140 | 142 |
141 } // namespace views | 143 } // namespace views |
OLD | NEW |