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

Side by Side Diff: chrome/browser/ui/views/infobars/infobar_container_view.cc

Issue 2477463003: Replace ui::AXViewState with AXNodeData and AXActionData (Closed)
Patch Set: Fix test Created 4 years, 1 month 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/infobars/infobar_container_view.h" 5 #include "chrome/browser/ui/views/infobars/infobar_container_view.h"
6 6
7 #include "chrome/browser/ui/infobar_container_delegate.h" 7 #include "chrome/browser/ui/infobar_container_delegate.h"
8 #include "chrome/browser/ui/view_ids.h" 8 #include "chrome/browser/ui/view_ids.h"
9 #include "chrome/browser/ui/views/infobars/infobar_view.h" 9 #include "chrome/browser/ui/views/infobars/infobar_view.h"
10 #include "chrome/grit/generated_resources.h" 10 #include "chrome/grit/generated_resources.h"
11 #include "ui/accessibility/ax_view_state.h" 11 #include "ui/accessibility/ax_node_data.h"
12 #include "ui/base/l10n/l10n_util.h" 12 #include "ui/base/l10n/l10n_util.h"
13 #include "ui/gfx/canvas.h" 13 #include "ui/gfx/canvas.h"
14 #include "ui/gfx/skia_util.h" 14 #include "ui/gfx/skia_util.h"
15 #include "ui/views/view_targeter.h" 15 #include "ui/views/view_targeter.h"
16 16
17 namespace { 17 namespace {
18 18
19 // The content shadow is drawn in two stages. A darker, shorter shadow is 19 // The content shadow is drawn in two stages. A darker, shorter shadow is
20 // blended with a taller, lighter shadow. The heights are in dp. 20 // blended with a taller, lighter shadow. The heights are in dp.
21 const int kSmallShadowHeight = 1; 21 const int kSmallShadowHeight = 1;
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 // |content_shadow_|). 108 // |content_shadow_|).
109 if (i == child_count() - 2) 109 if (i == child_count() - 2)
110 child_height -= InfoBarContainerDelegate::kSeparatorLineHeight; 110 child_height -= InfoBarContainerDelegate::kSeparatorLineHeight;
111 child->SetBounds(0, top, width(), child_height); 111 child->SetBounds(0, top, width(), child_height);
112 top += child_height; 112 top += child_height;
113 } 113 }
114 114
115 content_shadow_->SetBounds(0, top, width(), kLargeShadowHeight); 115 content_shadow_->SetBounds(0, top, width(), kLargeShadowHeight);
116 } 116 }
117 117
118 void InfoBarContainerView::GetAccessibleState(ui::AXViewState* state) { 118 void InfoBarContainerView::GetAccessibleNodeData(ui::AXNodeData* node_data) {
119 state->role = ui::AX_ROLE_GROUP; 119 node_data->role = ui::AX_ROLE_GROUP;
120 state->name = l10n_util::GetStringUTF16(IDS_ACCNAME_INFOBAR_CONTAINER); 120 node_data->SetName(l10n_util::GetStringUTF8(IDS_ACCNAME_INFOBAR_CONTAINER));
121 } 121 }
122 122
123 void InfoBarContainerView::PlatformSpecificAddInfoBar( 123 void InfoBarContainerView::PlatformSpecificAddInfoBar(
124 infobars::InfoBar* infobar, 124 infobars::InfoBar* infobar,
125 size_t position) { 125 size_t position) {
126 AddChildViewAt(static_cast<InfoBarView*>(infobar), 126 AddChildViewAt(static_cast<InfoBarView*>(infobar),
127 static_cast<int>(position)); 127 static_cast<int>(position));
128 } 128 }
129 129
130 void InfoBarContainerView::PlatformSpecificRemoveInfoBar( 130 void InfoBarContainerView::PlatformSpecificRemoveInfoBar(
131 infobars::InfoBar* infobar) { 131 infobars::InfoBar* infobar) {
132 RemoveChildView(static_cast<InfoBarView*>(infobar)); 132 RemoveChildView(static_cast<InfoBarView*>(infobar));
133 } 133 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/infobars/infobar_container_view.h ('k') | chrome/browser/ui/views/infobars/infobar_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698