| 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" |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 } | 65 } |
| 66 | 66 |
| 67 gfx::Size TabbedPane::GetPreferredSize() { | 67 gfx::Size TabbedPane::GetPreferredSize() { |
| 68 return native_tabbed_pane_ ? | 68 return native_tabbed_pane_ ? |
| 69 native_tabbed_pane_->GetPreferredSize() : gfx::Size(); | 69 native_tabbed_pane_->GetPreferredSize() : gfx::Size(); |
| 70 } | 70 } |
| 71 | 71 |
| 72 void TabbedPane::LoadAccelerators() { | 72 void TabbedPane::LoadAccelerators() { |
| 73 // Ctrl+Shift+Tab | 73 // Ctrl+Shift+Tab |
| 74 AddAccelerator(ui::Accelerator(ui::VKEY_TAB, | 74 AddAccelerator(ui::Accelerator(ui::VKEY_TAB, |
| 75 ui::EF_CONTROL_DOWN | ui::EF_SHIFT_DOWN)); | 75 ui::EF_CONTROL_DOWN | ui::EF_SHIFT_DOWN, |
| 76 ui::ET_KEY_PRESSED)); |
| 76 // Ctrl+Tab | 77 // Ctrl+Tab |
| 77 AddAccelerator(ui::Accelerator(ui::VKEY_TAB, ui::EF_CONTROL_DOWN)); | 78 AddAccelerator(ui::Accelerator(ui::VKEY_TAB, |
| 79 ui::EF_CONTROL_DOWN, |
| 80 ui::ET_KEY_PRESSED)); |
| 78 } | 81 } |
| 79 | 82 |
| 80 void TabbedPane::Layout() { | 83 void TabbedPane::Layout() { |
| 81 if (native_tabbed_pane_) | 84 if (native_tabbed_pane_) |
| 82 native_tabbed_pane_->GetView()->SetBounds(0, 0, width(), height()); | 85 native_tabbed_pane_->GetView()->SetBounds(0, 0, width(), height()); |
| 83 } | 86 } |
| 84 | 87 |
| 85 void TabbedPane::ViewHierarchyChanged(bool is_add, View* parent, View* child) { | 88 void TabbedPane::ViewHierarchyChanged(bool is_add, View* parent, View* child) { |
| 86 if (is_add && !native_tabbed_pane_) { | 89 if (is_add && !native_tabbed_pane_) { |
| 87 // The native wrapper's lifetime will be managed by the view hierarchy after | 90 // The native wrapper's lifetime will be managed by the view hierarchy after |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 if (NativeViewHost::kRenderNativeControlFocus) | 137 if (NativeViewHost::kRenderNativeControlFocus) |
| 135 View::OnPaintFocusBorder(canvas); | 138 View::OnPaintFocusBorder(canvas); |
| 136 } | 139 } |
| 137 | 140 |
| 138 void TabbedPane::GetAccessibleState(ui::AccessibleViewState* state) { | 141 void TabbedPane::GetAccessibleState(ui::AccessibleViewState* state) { |
| 139 state->role = ui::AccessibilityTypes::ROLE_PAGETABLIST; | 142 state->role = ui::AccessibilityTypes::ROLE_PAGETABLIST; |
| 140 state->name = accessible_name_; | 143 state->name = accessible_name_; |
| 141 } | 144 } |
| 142 | 145 |
| 143 } // namespace views | 146 } // namespace views |
| OLD | NEW |