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/tabbed_pane.h" | 5 #include "ui/views/controls/tabbed_pane/tabbed_pane.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "ui/base/accessibility/accessible_view_state.h" | 8 #include "ui/base/accessibility/accessible_view_state.h" |
9 #include "ui/base/keycodes/keyboard_codes.h" | 9 #include "ui/base/keycodes/keyboard_codes.h" |
10 #include "ui/views/controls/native/native_view_host.h" | 10 #include "ui/views/controls/native/native_view_host.h" |
11 #include "ui/views/controls/tabbed_pane/native_tabbed_pane_views.h" | |
11 #include "ui/views/controls/tabbed_pane/native_tabbed_pane_wrapper.h" | 12 #include "ui/views/controls/tabbed_pane/native_tabbed_pane_wrapper.h" |
12 #include "ui/views/controls/tabbed_pane/tabbed_pane_listener.h" | 13 #include "ui/views/controls/tabbed_pane/tabbed_pane_listener.h" |
13 #include "ui/views/widget/widget.h" | 14 #include "ui/views/widget/widget.h" |
14 | 15 |
16 // TODO(markusheintz): This should be removed once the native windows tabbed | |
17 // pane is not used anymore. | |
msw
2012/07/20 23:50:51
ditto optional nit: include bug # and capitalize W
markusheintz_
2012/07/23 12:22:06
Done.
| |
18 #if defined(OS_WIN) && !defined(USE_AURA) | |
19 #include "ui/views/controls/tabbed_pane/native_tabbed_pane_win.h" | |
20 #endif | |
21 | |
15 namespace views { | 22 namespace views { |
16 | 23 |
17 // static | 24 // static |
18 const char TabbedPane::kViewClassName[] = "views/TabbedPane"; | 25 const char TabbedPane::kViewClassName[] = "views/TabbedPane"; |
19 | 26 |
20 TabbedPane::TabbedPane() : native_tabbed_pane_(NULL), listener_(NULL) { | 27 TabbedPane::TabbedPane() : native_tabbed_pane_(NULL), listener_(NULL) { |
21 set_focusable(true); | 28 set_focusable(true); |
29 #if defined(OS_WIN) && !defined(USE_AURA) | |
30 set_use_native_win_control(false); | |
msw
2012/07/20 23:50:51
Set this in the initializer list if it's not terri
markusheintz_
2012/07/23 12:22:06
Done. The coding style looks a bit strange but it
| |
31 #endif | |
22 } | 32 } |
23 | 33 |
24 TabbedPane::~TabbedPane() { | 34 TabbedPane::~TabbedPane() { |
25 } | 35 } |
26 | 36 |
27 int TabbedPane::GetTabCount() { | 37 int TabbedPane::GetTabCount() { |
28 return native_tabbed_pane_->GetTabCount(); | 38 return native_tabbed_pane_->GetTabCount(); |
29 } | 39 } |
30 | 40 |
31 int TabbedPane::GetSelectedTabIndex() { | 41 int TabbedPane::GetSelectedTabIndex() { |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
133 void TabbedPane::OnPaintFocusBorder(gfx::Canvas* canvas) { | 143 void TabbedPane::OnPaintFocusBorder(gfx::Canvas* canvas) { |
134 if (NativeViewHost::kRenderNativeControlFocus) | 144 if (NativeViewHost::kRenderNativeControlFocus) |
135 View::OnPaintFocusBorder(canvas); | 145 View::OnPaintFocusBorder(canvas); |
136 } | 146 } |
137 | 147 |
138 void TabbedPane::GetAccessibleState(ui::AccessibleViewState* state) { | 148 void TabbedPane::GetAccessibleState(ui::AccessibleViewState* state) { |
139 state->role = ui::AccessibilityTypes::ROLE_PAGETABLIST; | 149 state->role = ui::AccessibilityTypes::ROLE_PAGETABLIST; |
140 state->name = accessible_name_; | 150 state->name = accessible_name_; |
141 } | 151 } |
142 | 152 |
153 /////////////////////////////////////////////////////////////////////////////// | |
154 // NativeTabbedPaneWrapper, public | |
155 | |
156 // static | |
157 NativeTabbedPaneWrapper* NativeTabbedPaneWrapper::CreateNativeWrapper( | |
msw
2012/07/20 23:50:51
Make this a static member on TabbedPane now and it
markusheintz_
2012/07/23 12:22:06
True. This static method feels a bit alien in this
msw
2012/07/23 22:55:43
This sgtm, since it's really an internal detail of
| |
158 TabbedPane* tabbed_pane) { | |
159 #if defined(OS_WIN) && !defined(USE_AURA) | |
160 if (tabbed_pane->use_native_win_control()) | |
161 return new NativeTabbedPaneWin(tabbed_pane); | |
162 #endif | |
163 return new NativeTabbedPaneViews(tabbed_pane); | |
164 } | |
165 | |
143 } // namespace views | 166 } // namespace views |
OLD | NEW |