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

Side by Side Diff: chrome/browser/ui/views/location_bar/location_bar_container.cc

Issue 10949005: Fix toolbar keyboard accessibility on Views (alternative impl). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix test on linux_chromeos Created 8 years, 3 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 | Annotate | Revision Log
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 "chrome/browser/ui/views/location_bar/location_bar_container.h" 5 #include "chrome/browser/ui/views/location_bar/location_bar_container.h"
6 6
7 #include "chrome/browser/ui/views/location_bar/location_bar_view.h" 7 #include "chrome/browser/ui/views/location_bar/location_bar_view.h"
8 #include "chrome/browser/ui/webui/instant_ui.h" 8 #include "chrome/browser/ui/webui/instant_ui.h"
9 #include "ui/base/events/event.h" 9 #include "ui/base/events/event.h"
10 #include "ui/views/accessible_pane_view.h"
10 #include "ui/views/background.h" 11 #include "ui/views/background.h"
11 12
12 namespace { 13 namespace {
13 14
14 // Duration of the animations used by this class (AnimateTo()). 15 // Duration of the animations used by this class (AnimateTo()).
15 const int kAnimationDuration = 180; 16 const int kAnimationDuration = 180;
16 17
17 } 18 }
18 19
19 LocationBarContainer::LocationBarContainer(views::View* parent, 20 LocationBarContainer::LocationBarContainer(
20 bool instant_extended_api_enabled) 21 views::View* parent,
22 views::AccessiblePaneView* accessible_pane_view,
23 bool instant_extended_api_enabled)
21 : animator_(parent), 24 : animator_(parent),
22 view_parent_(NULL), 25 view_parent_(NULL),
23 location_bar_view_(NULL), 26 location_bar_view_(NULL),
24 native_view_host_(NULL), 27 native_view_host_(NULL),
25 in_toolbar_(true), 28 in_toolbar_(true),
29 accessible_pane_view_(accessible_pane_view),
26 instant_extended_api_enabled_(instant_extended_api_enabled) { 30 instant_extended_api_enabled_(instant_extended_api_enabled) {
27 parent->AddChildView(this); 31 parent->AddChildView(this);
28 animator_.set_tween_type(ui::Tween::EASE_IN_OUT); 32 animator_.set_tween_type(ui::Tween::EASE_IN_OUT);
29 PlatformInit(); 33 PlatformInit();
30 if (instant_extended_api_enabled) { 34 if (instant_extended_api_enabled) {
31 view_parent_->set_background( 35 view_parent_->set_background(
32 views::Background::CreateSolidBackground(GetBackgroundColor())); 36 views::Background::CreateSolidBackground(GetBackgroundColor()));
33 } 37 }
34 } 38 }
35 39
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 bool LocationBarContainer::SkipDefaultKeyEventProcessing( 80 bool LocationBarContainer::SkipDefaultKeyEventProcessing(
77 const ui::KeyEvent& event) { 81 const ui::KeyEvent& event) {
78 return location_bar_view_->SkipDefaultKeyEventProcessing(event); 82 return location_bar_view_->SkipDefaultKeyEventProcessing(event);
79 } 83 }
80 84
81 void LocationBarContainer::GetAccessibleState( 85 void LocationBarContainer::GetAccessibleState(
82 ui::AccessibleViewState* state) { 86 ui::AccessibleViewState* state) {
83 location_bar_view_->GetAccessibleState(state); 87 location_bar_view_->GetAccessibleState(state);
84 } 88 }
85 89
90 views::FocusTraversable* LocationBarContainer::GetPaneFocusTraversable() {
91 // Use the accessible pane view that this belongs to for focus searching.
92 return accessible_pane_view_->GetPaneFocusTraversable();
93 }
94
86 void LocationBarContainer::OnBoundsAnimatorDone( 95 void LocationBarContainer::OnBoundsAnimatorDone(
87 views::BoundsAnimator* animator) { 96 views::BoundsAnimator* animator) {
88 SetInToolbar(true); 97 SetInToolbar(true);
89 } 98 }
90 99
91 // static 100 // static
92 int LocationBarContainer::GetAnimationDuration() { 101 int LocationBarContainer::GetAnimationDuration() {
93 return kAnimationDuration * InstantUI::GetSlowAnimationScaleFactor(); 102 return kAnimationDuration * InstantUI::GetSlowAnimationScaleFactor();
94 } 103 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/location_bar/location_bar_container.h ('k') | chrome/browser/ui/views/toolbar_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698