Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(304)

Side by Side Diff: ui/views/controls/tabbed_pane/tabbed_pane.cc

Issue 1894383002: MacViews: Implement Full Keyboard Access. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@SetFocusBehavior
Patch Set: Rebased Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 "base/macros.h" 8 #include "base/macros.h"
9 #include "third_party/skia/include/core/SkPaint.h" 9 #include "third_party/skia/include/core/SkPaint.h"
10 #include "third_party/skia/include/core/SkPath.h" 10 #include "third_party/skia/include/core/SkPath.h"
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after
270 } else { 270 } else {
271 canvas->sk_canvas()->drawLine(0, line_y, line_end, line_y, paint); 271 canvas->sk_canvas()->drawLine(0, line_y, line_end, line_y, paint);
272 } 272 }
273 } 273 }
274 274
275 TabbedPane::TabbedPane() 275 TabbedPane::TabbedPane()
276 : listener_(NULL), 276 : listener_(NULL),
277 tab_strip_(new TabStrip(this)), 277 tab_strip_(new TabStrip(this)),
278 contents_(new View()), 278 contents_(new View()),
279 selected_tab_index_(-1) { 279 selected_tab_index_(-1) {
280 #if defined(OS_MACOSX)
281 SetFocusBehavior(FocusBehavior::ACCESSIBLE_ONLY);
282 #else
280 SetFocusBehavior(FocusBehavior::ALWAYS); 283 SetFocusBehavior(FocusBehavior::ALWAYS);
284 #endif
285
281 AddChildView(tab_strip_); 286 AddChildView(tab_strip_);
282 AddChildView(contents_); 287 AddChildView(contents_);
283 } 288 }
284 289
285 TabbedPane::~TabbedPane() {} 290 TabbedPane::~TabbedPane() {}
286 291
287 int TabbedPane::GetTabCount() { 292 int TabbedPane::GetTabCount() {
288 DCHECK_EQ(tab_strip_->child_count(), contents_->child_count()); 293 DCHECK_EQ(tab_strip_->child_count(), contents_->child_count());
289 return contents_->child_count(); 294 return contents_->child_count();
290 } 295 }
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
401 selected_tab->NotifyAccessibilityEvent( 406 selected_tab->NotifyAccessibilityEvent(
402 ui::AX_EVENT_FOCUS, true); 407 ui::AX_EVENT_FOCUS, true);
403 } 408 }
404 } 409 }
405 410
406 void TabbedPane::GetAccessibleState(ui::AXViewState* state) { 411 void TabbedPane::GetAccessibleState(ui::AXViewState* state) {
407 state->role = ui::AX_ROLE_TAB_LIST; 412 state->role = ui::AX_ROLE_TAB_LIST;
408 } 413 }
409 414
410 } // namespace views 415 } // namespace views
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698