| 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/accessibility/ax_view_state.h" | 8 #include "ui/accessibility/ax_view_state.h" |
| 9 #include "ui/base/resource/resource_bundle.h" | 9 #include "ui/base/resource/resource_bundle.h" |
| 10 #include "ui/events/keycodes/keyboard_codes.h" | 10 #include "ui/events/keycodes/keyboard_codes.h" |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 | 102 |
| 103 Tab::~Tab() {} | 103 Tab::~Tab() {} |
| 104 | 104 |
| 105 void Tab::SetSelected(bool selected) { | 105 void Tab::SetSelected(bool selected) { |
| 106 contents_->SetVisible(selected); | 106 contents_->SetVisible(selected); |
| 107 SetState(selected ? TAB_ACTIVE : TAB_INACTIVE); | 107 SetState(selected ? TAB_ACTIVE : TAB_INACTIVE); |
| 108 } | 108 } |
| 109 | 109 |
| 110 bool Tab::OnMousePressed(const ui::MouseEvent& event) { | 110 bool Tab::OnMousePressed(const ui::MouseEvent& event) { |
| 111 if (event.IsOnlyLeftMouseButton() && | 111 if (event.IsOnlyLeftMouseButton() && |
| 112 GetLocalBounds().Contains(event.location())) | 112 GetLocalBounds().Contains(gfx::ToFlooredPoint(event.location()))) |
| 113 tabbed_pane_->SelectTab(this); | 113 tabbed_pane_->SelectTab(this); |
| 114 return true; | 114 return true; |
| 115 } | 115 } |
| 116 | 116 |
| 117 void Tab::OnMouseEntered(const ui::MouseEvent& event) { | 117 void Tab::OnMouseEntered(const ui::MouseEvent& event) { |
| 118 SetState(selected() ? TAB_ACTIVE : TAB_HOVERED); | 118 SetState(selected() ? TAB_ACTIVE : TAB_HOVERED); |
| 119 } | 119 } |
| 120 | 120 |
| 121 void Tab::OnMouseExited(const ui::MouseEvent& event) { | 121 void Tab::OnMouseExited(const ui::MouseEvent& event) { |
| 122 SetState(selected() ? TAB_ACTIVE : TAB_INACTIVE); | 122 SetState(selected() ? TAB_ACTIVE : TAB_INACTIVE); |
| (...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 366 selected_tab->NotifyAccessibilityEvent( | 366 selected_tab->NotifyAccessibilityEvent( |
| 367 ui::AX_EVENT_FOCUS, true); | 367 ui::AX_EVENT_FOCUS, true); |
| 368 } | 368 } |
| 369 } | 369 } |
| 370 | 370 |
| 371 void TabbedPane::GetAccessibleState(ui::AXViewState* state) { | 371 void TabbedPane::GetAccessibleState(ui::AXViewState* state) { |
| 372 state->role = ui::AX_ROLE_TAB_LIST; | 372 state->role = ui::AX_ROLE_TAB_LIST; |
| 373 } | 373 } |
| 374 | 374 |
| 375 } // namespace views | 375 } // namespace views |
| OLD | NEW |