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

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

Issue 2477463003: Replace ui::AXViewState with AXNodeData and AXActionData (Closed)
Patch Set: Full patch including mechanical changes 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) 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/page_action_with_badge_view.h" 5 #include "chrome/browser/ui/views/location_bar/page_action_with_badge_view.h"
6 6
7 #include "chrome/browser/extensions/extension_action.h" 7 #include "chrome/browser/extensions/extension_action.h"
8 #include "chrome/browser/ui/views/location_bar/page_action_image_view.h" 8 #include "chrome/browser/ui/views/location_bar/page_action_image_view.h"
9 #include "ui/accessibility/ax_view_state.h" 9 #include "ui/accessibility/ax_node_data.h"
10 #include "ui/views/layout/fill_layout.h" 10 #include "ui/views/layout/fill_layout.h"
11 11
12 PageActionWithBadgeView::PageActionWithBadgeView( 12 PageActionWithBadgeView::PageActionWithBadgeView(
13 PageActionImageView* image_view) : image_view_(image_view) { 13 PageActionImageView* image_view) : image_view_(image_view) {
14 AddChildView(image_view_); 14 AddChildView(image_view_);
15 SetLayoutManager(new views::FillLayout()); 15 SetLayoutManager(new views::FillLayout());
16 } 16 }
17 17
18 void PageActionWithBadgeView::GetAccessibleState( 18 void PageActionWithBadgeView::GetAccessibleNodeData(ui::AXNodeData* node_data) {
19 ui::AXViewState* state) { 19 node_data->role = ui::AX_ROLE_GROUP;
20 state->role = ui::AX_ROLE_GROUP;
21 } 20 }
22 21
23 gfx::Size PageActionWithBadgeView::GetPreferredSize() const { 22 gfx::Size PageActionWithBadgeView::GetPreferredSize() const {
24 return gfx::Size(ExtensionAction::ActionIconSize(), 23 return gfx::Size(ExtensionAction::ActionIconSize(),
25 ExtensionAction::ActionIconSize()); 24 ExtensionAction::ActionIconSize());
26 } 25 }
27 26
28 void PageActionWithBadgeView::UpdateVisibility(content::WebContents* contents) { 27 void PageActionWithBadgeView::UpdateVisibility(content::WebContents* contents) {
29 image_view_->UpdateVisibility(contents); 28 image_view_->UpdateVisibility(contents);
30 SetVisible(image_view_->visible()); 29 SetVisible(image_view_->visible());
31 } 30 }
32 31
33 const char* PageActionWithBadgeView::GetClassName() const { 32 const char* PageActionWithBadgeView::GetClassName() const {
34 return "PageActionWithBadgeView"; 33 return "PageActionWithBadgeView";
35 } 34 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698