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

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

Issue 2412163003: views: add selection change animation to TabbedPane (Closed)
Patch Set: nits fixed Created 4 years, 2 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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"
11 #include "ui/accessibility/ax_view_state.h" 11 #include "ui/accessibility/ax_view_state.h"
12 #include "ui/base/default_style.h" 12 #include "ui/base/default_style.h"
13 #include "ui/base/material_design/material_design_controller.h" 13 #include "ui/base/material_design/material_design_controller.h"
14 #include "ui/base/resource/resource_bundle.h" 14 #include "ui/base/resource/resource_bundle.h"
15 #include "ui/events/keycodes/keyboard_codes.h" 15 #include "ui/events/keycodes/keyboard_codes.h"
16 #include "ui/gfx/animation/animation_delegate.h"
17 #include "ui/gfx/animation/linear_animation.h"
18 #include "ui/gfx/animation/tween.h"
16 #include "ui/gfx/canvas.h" 19 #include "ui/gfx/canvas.h"
17 #include "ui/gfx/font_list.h" 20 #include "ui/gfx/font_list.h"
18 #include "ui/native_theme/native_theme.h" 21 #include "ui/native_theme/native_theme.h"
19 #include "ui/views/border.h" 22 #include "ui/views/border.h"
20 #include "ui/views/controls/label.h" 23 #include "ui/views/controls/label.h"
21 #include "ui/views/controls/tabbed_pane/tabbed_pane_listener.h" 24 #include "ui/views/controls/tabbed_pane/tabbed_pane_listener.h"
22 #include "ui/views/layout/box_layout.h" 25 #include "ui/views/layout/box_layout.h"
23 #include "ui/views/layout/fill_layout.h" 26 #include "ui/views/layout/fill_layout.h"
24 #include "ui/views/layout/layout_manager.h" 27 #include "ui/views/layout/layout_manager.h"
25 #include "ui/views/widget/widget.h" 28 #include "ui/views/widget/widget.h"
(...skipping 25 matching lines...) Expand all
51 class MdTab : public Tab { 54 class MdTab : public Tab {
52 public: 55 public:
53 MdTab(TabbedPane* tabbed_pane, const base::string16& title, View* contents); 56 MdTab(TabbedPane* tabbed_pane, const base::string16& title, View* contents);
54 ~MdTab() override; 57 ~MdTab() override;
55 58
56 // Overridden from Tab: 59 // Overridden from Tab:
57 void OnStateChanged() override; 60 void OnStateChanged() override;
58 61
59 // Overridden from View: 62 // Overridden from View:
60 gfx::Size GetPreferredSize() const override; 63 gfx::Size GetPreferredSize() const override;
61 void OnPaintBorder(gfx::Canvas* canvas) override; 64 void OnFocus() override;
65 void OnBlur() override;
62 66
63 private: 67 private:
64 DISALLOW_COPY_AND_ASSIGN(MdTab); 68 DISALLOW_COPY_AND_ASSIGN(MdTab);
65 }; 69 };
66 70
67 // The tab strip shown above the tab contents. 71 // The tab strip shown above the tab contents.
68 class TabStrip : public View { 72 class TabStrip : public View {
69 public: 73 public:
70 // Internal class name. 74 // Internal class name.
71 static const char kViewClassName[]; 75 static const char kViewClassName[];
72 76
73 TabStrip(); 77 TabStrip();
74 ~TabStrip() override; 78 ~TabStrip() override;
75 79
80 // Called by TabStrip when the selected tab changes. This function is only
81 // called if |from_tab| is not null, i.e., there was a previously selected
82 // tab.
83 virtual void OnSelectedTabChanged(Tab* from_tab, Tab* to_tab);
84
76 // Overridden from View: 85 // Overridden from View:
77 const char* GetClassName() const override; 86 const char* GetClassName() const override;
78 void OnPaintBorder(gfx::Canvas* canvas) override; 87 void OnPaintBorder(gfx::Canvas* canvas) override;
79 88
80 Tab* GetSelectedTab() const; 89 Tab* GetSelectedTab() const;
81 Tab* GetTabAtDeltaFromSelected(int delta) const; 90 Tab* GetTabAtDeltaFromSelected(int delta) const;
82 Tab* GetTabAtIndex(int index) const; 91 Tab* GetTabAtIndex(int index) const;
83 int GetSelectedTabIndex() const; 92 int GetSelectedTabIndex() const;
84 93
85 private: 94 private:
86 DISALLOW_COPY_AND_ASSIGN(TabStrip); 95 DISALLOW_COPY_AND_ASSIGN(TabStrip);
87 }; 96 };
88 97
89 // A subclass of TabStrip that implements the Harmony visual styling. This 98 // A subclass of TabStrip that implements the Harmony visual styling. This
90 // class uses a BoxLayout to position tabs. 99 // class uses a BoxLayout to position tabs.
91 class MdTabStrip : public TabStrip { 100 class MdTabStrip : public TabStrip, public gfx::AnimationDelegate {
92 public: 101 public:
93 MdTabStrip(); 102 MdTabStrip();
94 ~MdTabStrip() override; 103 ~MdTabStrip() override;
95 104
105 // Overridden from TabStrip:
106 void OnSelectedTabChanged(Tab* from_tab, Tab* to_tab) override;
107
96 // Overridden from View: 108 // Overridden from View:
97 void OnPaintBorder(gfx::Canvas* canvas) override; 109 void OnPaintBorder(gfx::Canvas* canvas) override;
98 110
111 // Overridden from AnimationDelegate:
112 void AnimationProgressed(const gfx::Animation* animation) override;
113 void AnimationEnded(const gfx::Animation* animation) override;
114
99 private: 115 private:
116 // Animations for expanding and contracting the selection bar. When changing
117 // selections, the selection bar first grows to encompass both the old and new
118 // selections, then shrinks to encompass only the new selection. The rates of
119 // expansion and contraction each follow the cubic bezier curves used in
120 // gfx::Tween; see MdTabStrip::OnPaintBorder for details.
121 std::unique_ptr<gfx::LinearAnimation> expand_animation_;
122 std::unique_ptr<gfx::LinearAnimation> contract_animation_;
123
124 // The x-coordinate ranges of the old selection and the new selection.
125 gfx::Range animating_from_;
126 gfx::Range animating_to_;
127
100 DISALLOW_COPY_AND_ASSIGN(MdTabStrip); 128 DISALLOW_COPY_AND_ASSIGN(MdTabStrip);
101 }; 129 };
102 130
103 // static 131 // static
104 const char Tab::kViewClassName[] = "Tab"; 132 const char Tab::kViewClassName[] = "Tab";
105 133
106 Tab::Tab(TabbedPane* tabbed_pane, const base::string16& title, View* contents) 134 Tab::Tab(TabbedPane* tabbed_pane, const base::string16& title, View* contents)
107 : tabbed_pane_(tabbed_pane), 135 : tabbed_pane_(tabbed_pane),
108 title_(new Label( 136 title_(new Label(
109 title, 137 title,
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
231 ui::KeyboardCode key = event.key_code(); 259 ui::KeyboardCode key = event.key_code();
232 if (key != ui::VKEY_LEFT && key != ui::VKEY_RIGHT) 260 if (key != ui::VKEY_LEFT && key != ui::VKEY_RIGHT)
233 return false; 261 return false;
234 return tabbed_pane_->MoveSelectionBy(key == ui::VKEY_RIGHT ? 1 : -1); 262 return tabbed_pane_->MoveSelectionBy(key == ui::VKEY_RIGHT ? 1 : -1);
235 } 263 }
236 264
237 MdTab::MdTab(TabbedPane* tabbed_pane, 265 MdTab::MdTab(TabbedPane* tabbed_pane,
238 const base::string16& title, 266 const base::string16& title,
239 View* contents) 267 View* contents)
240 : Tab(tabbed_pane, title, contents) { 268 : Tab(tabbed_pane, title, contents) {
269 const int kBorderThickness = 2;
270 SetBorder(Border::CreateEmptyBorder(gfx::Insets(kBorderThickness)));
241 OnStateChanged(); 271 OnStateChanged();
242 } 272 }
243 273
244 MdTab::~MdTab() {} 274 MdTab::~MdTab() {}
245 275
246 void MdTab::OnStateChanged() { 276 void MdTab::OnStateChanged() {
247 ui::NativeTheme* theme = GetNativeTheme(); 277 ui::NativeTheme* theme = GetNativeTheme();
248 278
249 SkColor font_color = selected() 279 SkColor font_color = selected()
250 ? theme->GetSystemColor(ui::NativeTheme::kColorId_ProminentButtonColor) 280 ? theme->GetSystemColor(ui::NativeTheme::kColorId_ProminentButtonColor)
251 : theme->GetSystemColor(ui::NativeTheme::kColorId_ButtonEnabledColor); 281 : theme->GetSystemColor(ui::NativeTheme::kColorId_ButtonEnabledColor);
252 title()->SetEnabledColor(font_color); 282 title()->SetEnabledColor(font_color);
253 283
254 gfx::Font::Weight font_weight = gfx::Font::Weight::MEDIUM; 284 gfx::Font::Weight font_weight = gfx::Font::Weight::MEDIUM;
255 #if defined(OS_WIN) 285 #if defined(OS_WIN)
256 if (selected()) 286 if (selected())
257 font_weight = gfx::Font::Weight::BOLD; 287 font_weight = gfx::Font::Weight::BOLD;
258 #endif 288 #endif
259 289
260 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); 290 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();
261 title()->SetFontList(rb.GetFontListWithDelta(ui::kLabelFontSizeDelta, 291 title()->SetFontList(rb.GetFontListWithDelta(ui::kLabelFontSizeDelta,
262 gfx::Font::NORMAL, font_weight)); 292 gfx::Font::NORMAL, font_weight));
263 } 293 }
264 294
265 void MdTab::OnPaintBorder(gfx::Canvas* canvas) {
266 const int kBorderStrokeWidth = 2;
267 if (!HasFocus()) {
268 SkColor color = GetNativeTheme()->GetSystemColor(
269 selected() ? ui::NativeTheme::kColorId_FocusedBorderColor
270 : ui::NativeTheme::kColorId_UnfocusedBorderColor);
271 int thickness = selected() ? kBorderStrokeWidth : kBorderStrokeWidth / 2;
272 canvas->FillRect(gfx::Rect(0, height() - thickness, width(), thickness),
273 color);
274 return;
275 }
276
277 // TODO(ellyjones): should this 0x66 be part of NativeTheme somehow?
278 SkColor base_color = GetNativeTheme()->GetSystemColor(
279 ui::NativeTheme::kColorId_FocusedBorderColor);
280 SkColor light_color = SkColorSetA(base_color, 0x66);
281
282 SkPaint paint;
283 paint.setColor(light_color);
284 paint.setStyle(SkPaint::kStroke_Style);
285 paint.setStrokeWidth(kBorderStrokeWidth);
286
287 gfx::RectF bounds = gfx::RectF(GetLocalBounds());
288 bounds.Inset(gfx::Insets(kBorderStrokeWidth / 2.f));
289
290 // Draw the lighter-colored stroke first, then draw the heavier stroke over
291 // the bottom of it. This is fine because the heavier stroke has 1.0 alpha, so
292 // the lighter stroke won't show through.
293 canvas->DrawRect(bounds, paint);
294 canvas->FillRect(
295 gfx::Rect(0, height() - kBorderStrokeWidth, width(), kBorderStrokeWidth),
296 base_color);
297 }
298
299 gfx::Size MdTab::GetPreferredSize() const { 295 gfx::Size MdTab::GetPreferredSize() const {
300 return gfx::Size(Tab::GetPreferredSize().width(), kHarmonyTabStripTabHeight); 296 return gfx::Size(Tab::GetPreferredSize().width(), kHarmonyTabStripTabHeight);
301 } 297 }
302 298
299 void MdTab::OnFocus() {
300 SetBorder(Border::CreateSolidBorder(
301 GetInsets().top(),
302 SkColorSetA(GetNativeTheme()->GetSystemColor(
303 ui::NativeTheme::kColorId_FocusedBorderColor),
304 0x66)));
305 SchedulePaint();
306 }
307
308 void MdTab::OnBlur() {
309 SetBorder(Border::CreateEmptyBorder(GetInsets()));
310 SchedulePaint();
311 }
312
303 // static 313 // static
304 const char TabStrip::kViewClassName[] = "TabStrip"; 314 const char TabStrip::kViewClassName[] = "TabStrip";
305 315
306 TabStrip::TabStrip() { 316 TabStrip::TabStrip() {
307 const int kTabStripLeadingEdgePadding = 9; 317 const int kTabStripLeadingEdgePadding = 9;
308 BoxLayout* layout = 318 BoxLayout* layout =
309 new BoxLayout(BoxLayout::kHorizontal, kTabStripLeadingEdgePadding, 0, 0); 319 new BoxLayout(BoxLayout::kHorizontal, kTabStripLeadingEdgePadding, 0, 0);
310 layout->set_main_axis_alignment(BoxLayout::MAIN_AXIS_ALIGNMENT_START); 320 layout->set_main_axis_alignment(BoxLayout::MAIN_AXIS_ALIGNMENT_START);
311 layout->set_cross_axis_alignment(BoxLayout::CROSS_AXIS_ALIGNMENT_END); 321 layout->set_cross_axis_alignment(BoxLayout::CROSS_AXIS_ALIGNMENT_END);
312 layout->SetDefaultFlex(0); 322 layout->SetDefaultFlex(0);
313 SetLayoutManager(layout); 323 SetLayoutManager(layout);
314 } 324 }
315 325
316 TabStrip::~TabStrip() {} 326 TabStrip::~TabStrip() {}
317 327
328 void TabStrip::OnSelectedTabChanged(Tab* from_tab, Tab* to_tab) {}
329
318 const char* TabStrip::GetClassName() const { 330 const char* TabStrip::GetClassName() const {
319 return kViewClassName; 331 return kViewClassName;
320 } 332 }
321 333
322 void TabStrip::OnPaintBorder(gfx::Canvas* canvas) { 334 void TabStrip::OnPaintBorder(gfx::Canvas* canvas) {
323 SkPaint paint; 335 SkPaint paint;
324 paint.setColor(kTabBorderColor); 336 paint.setColor(kTabBorderColor);
325 paint.setStrokeWidth(kTabBorderThickness); 337 paint.setStrokeWidth(kTabBorderThickness);
326 SkScalar line_y = SkIntToScalar(height()) - (kTabBorderThickness / 2); 338 SkScalar line_y = SkIntToScalar(height()) - (kTabBorderThickness / 2);
327 SkScalar line_end = SkIntToScalar(width()); 339 SkScalar line_end = SkIntToScalar(width());
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
374 return GetTabAtIndex(index); 386 return GetTabAtIndex(index);
375 } 387 }
376 388
377 MdTabStrip::MdTabStrip() { 389 MdTabStrip::MdTabStrip() {
378 BoxLayout* layout = 390 BoxLayout* layout =
379 new BoxLayout(BoxLayout::kHorizontal, 0, kHarmonyTabStripVerticalPad, 0); 391 new BoxLayout(BoxLayout::kHorizontal, 0, kHarmonyTabStripVerticalPad, 0);
380 layout->set_main_axis_alignment(BoxLayout::MAIN_AXIS_ALIGNMENT_CENTER); 392 layout->set_main_axis_alignment(BoxLayout::MAIN_AXIS_ALIGNMENT_CENTER);
381 layout->set_cross_axis_alignment(BoxLayout::CROSS_AXIS_ALIGNMENT_STRETCH); 393 layout->set_cross_axis_alignment(BoxLayout::CROSS_AXIS_ALIGNMENT_STRETCH);
382 layout->SetDefaultFlex(1); 394 layout->SetDefaultFlex(1);
383 SetLayoutManager(layout); 395 SetLayoutManager(layout);
396
397 // These durations are taken from the Paper Tabs source:
398 // https://github.com/PolymerElements/paper-tabs/blob/master/paper-tabs.html
399 // See |selectionBar.expand| and |selectionBar.contract|.
400 const int kExpandAnimationDurationMs = 150;
401 expand_animation_.reset(new gfx::LinearAnimation(this));
402 expand_animation_->SetDuration(kExpandAnimationDurationMs);
403
404 const int kContractAnimationDurationMs = 180;
405 contract_animation_.reset(new gfx::LinearAnimation(this));
406 contract_animation_->SetDuration(kContractAnimationDurationMs);
384 } 407 }
385 408
386 MdTabStrip::~MdTabStrip() {} 409 MdTabStrip::~MdTabStrip() {}
387 410
388 // The tab strip "border" is drawn as part of the tabs. 411 void MdTabStrip::OnSelectedTabChanged(Tab* from_tab, Tab* to_tab) {
389 void MdTabStrip::OnPaintBorder(gfx::Canvas* canvas) {} 412 DCHECK(!from_tab->selected());
413 DCHECK(to_tab->selected());
414
415 animating_from_ =
416 gfx::Range(from_tab->x(), from_tab->x() + from_tab->width());
417 animating_to_ = gfx::Range(to_tab->x(), to_tab->x() + to_tab->width());
418
419 contract_animation_->Stop();
420 expand_animation_->Start();
421 }
422
423 void MdTabStrip::OnPaintBorder(gfx::Canvas* canvas) {
424 int max_y = child_at(0)->y() + child_at(0)->height();
425 const int kUnselectedBorderThickness = 1;
426 const int kSelectedBorderThickness = 2;
427
428 // First, draw the unselected border across the TabStrip's entire width. The
429 // area underneath the selected tab will be overdrawn later.
430 canvas->FillRect(gfx::Rect(0, max_y - kUnselectedBorderThickness, width(),
431 kUnselectedBorderThickness),
432 GetNativeTheme()->GetSystemColor(
433 ui::NativeTheme::kColorId_UnfocusedBorderColor));
434
435 int min_x = 0;
436 int max_x = 0;
437
438 // Now, figure out the range to draw the selection marker underneath. There
439 // are three states here:
440 // 1) Expand animation is running: use FAST_OUT_LINEAR_IN to grow the
441 // selection marker until it encompasses both the previously selected tab
442 // and the currently selected tab;
443 // 2) Contract animation is running: use LINEAR_OUT_SLOW_IN to shrink the
444 // selection marker until it encompasses only the currently selected tab;
445 // 3) No animations running: the selection marker is only under the currently
446 // selected tab.
447 Tab* tab = GetSelectedTab();
448 if (!tab)
449 return;
450 if (expand_animation_->is_animating()) {
451 bool animating_left = animating_to_.start() < animating_from_.start();
452 double anim_value = gfx::Tween::CalculateValue(
453 gfx::Tween::FAST_OUT_LINEAR_IN, expand_animation_->GetCurrentValue());
454
455 if (animating_left) {
456 min_x = gfx::Tween::IntValueBetween(anim_value, animating_from_.start(),
457 animating_to_.start());
458 max_x = animating_from_.end();
459 } else {
460 min_x = animating_from_.start();
461 max_x = gfx::Tween::IntValueBetween(anim_value, animating_from_.end(),
462 animating_to_.end());
463 }
464 } else if (contract_animation_->is_animating()) {
465 bool animating_left = animating_to_.start() < animating_from_.start();
466 double anim_value = gfx::Tween::CalculateValue(
467 gfx::Tween::LINEAR_OUT_SLOW_IN, contract_animation_->GetCurrentValue());
468 if (animating_left) {
469 min_x = animating_to_.start();
470 max_x = gfx::Tween::IntValueBetween(anim_value, animating_from_.end(),
471 animating_to_.end());
472 } else {
473 min_x = gfx::Tween::IntValueBetween(anim_value, animating_from_.start(),
474 animating_to_.start());
475 max_x = animating_to_.end();
476 }
477 } else if (tab) {
478 min_x = tab->x();
479 max_x = tab->x() + tab->width();
480 }
481
482 DCHECK(min_x != max_x);
483 // Draw over the unselected border from above.
484 canvas->FillRect(gfx::Rect(min_x, max_y - kSelectedBorderThickness,
485 max_x - min_x, kSelectedBorderThickness),
486 GetNativeTheme()->GetSystemColor(
487 ui::NativeTheme::kColorId_FocusedBorderColor));
488 }
489
490 void MdTabStrip::AnimationProgressed(const gfx::Animation* animation) {
491 SchedulePaint();
492 }
493
494 void MdTabStrip::AnimationEnded(const gfx::Animation* animation) {
495 if (animation == expand_animation_.get())
496 contract_animation_->Start();
497 }
390 498
391 TabbedPane::TabbedPane() 499 TabbedPane::TabbedPane()
392 : listener_(NULL), 500 : listener_(NULL),
393 tab_strip_(ui::MaterialDesignController::IsSecondaryUiMaterial() 501 tab_strip_(ui::MaterialDesignController::IsSecondaryUiMaterial()
394 ? new MdTabStrip 502 ? new MdTabStrip
395 : new TabStrip), 503 : new TabStrip),
396 contents_(new View()) { 504 contents_(new View()) {
397 AddChildView(tab_strip_); 505 AddChildView(tab_strip_);
398 AddChildView(contents_); 506 AddChildView(contents_);
399 } 507 }
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
434 void TabbedPane::SelectTab(Tab* new_selected_tab) { 542 void TabbedPane::SelectTab(Tab* new_selected_tab) {
435 Tab* old_selected_tab = tab_strip_->GetSelectedTab(); 543 Tab* old_selected_tab = tab_strip_->GetSelectedTab();
436 if (old_selected_tab == new_selected_tab) 544 if (old_selected_tab == new_selected_tab)
437 return; 545 return;
438 546
439 new_selected_tab->SetSelected(true); 547 new_selected_tab->SetSelected(true);
440 if (old_selected_tab) { 548 if (old_selected_tab) {
441 if (old_selected_tab->HasFocus()) 549 if (old_selected_tab->HasFocus())
442 new_selected_tab->RequestFocus(); 550 new_selected_tab->RequestFocus();
443 old_selected_tab->SetSelected(false); 551 old_selected_tab->SetSelected(false);
552 tab_strip_->OnSelectedTabChanged(old_selected_tab, new_selected_tab);
444 } 553 }
445 tab_strip_->SchedulePaint(); 554 tab_strip_->SchedulePaint();
446 555
447 FocusManager* focus_manager = new_selected_tab->contents()->GetFocusManager(); 556 FocusManager* focus_manager = new_selected_tab->contents()->GetFocusManager();
448 if (focus_manager) { 557 if (focus_manager) {
449 const View* focused_view = focus_manager->GetFocusedView(); 558 const View* focused_view = focus_manager->GetFocusedView();
450 if (focused_view && contents_->Contains(focused_view) && 559 if (focused_view && contents_->Contains(focused_view) &&
451 !new_selected_tab->contents()->Contains(focused_view)) 560 !new_selected_tab->contents()->Contains(focused_view))
452 focus_manager->SetFocusedView(new_selected_tab->contents()); 561 focus_manager->SetFocusedView(new_selected_tab->contents());
453 } 562 }
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
512 621
513 View* TabbedPane::GetSelectedTabContentView() { 622 View* TabbedPane::GetSelectedTabContentView() {
514 return GetSelectedTab() ? GetSelectedTab()->contents() : nullptr; 623 return GetSelectedTab() ? GetSelectedTab()->contents() : nullptr;
515 } 624 }
516 625
517 void TabbedPane::GetAccessibleState(ui::AXViewState* state) { 626 void TabbedPane::GetAccessibleState(ui::AXViewState* state) {
518 state->role = ui::AX_ROLE_TAB_LIST; 627 state->role = ui::AX_ROLE_TAB_LIST;
519 } 628 }
520 629
521 } // namespace views 630 } // namespace views
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698