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

Side by Side Diff: chrome/browser/views/location_bar_view.cc

Issue 174252: Adds support and exposure of additional accessibility roles. Includes naming ... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 4 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) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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/views/location_bar_view.h" 5 #include "chrome/browser/views/location_bar_view.h"
6 6
7 #if defined(OS_LINUX) 7 #if defined(OS_LINUX)
8 #include <gtk/gtk.h> 8 #include <gtk/gtk.h>
9 #endif 9 #endif
10 10
(...skipping 681 matching lines...) Expand 10 before | Expand all | Expand 10 after
692 if (event.IsRightMouseButton()) 692 if (event.IsRightMouseButton())
693 flags |= MK_RBUTTON; 693 flags |= MK_RBUTTON;
694 694
695 gfx::Point screen_point(event.location()); 695 gfx::Point screen_point(event.location());
696 ConvertPointToScreen(this, &screen_point); 696 ConvertPointToScreen(this, &screen_point);
697 697
698 location_entry_->HandleExternalMsg(msg, flags, screen_point.ToPOINT()); 698 location_entry_->HandleExternalMsg(msg, flags, screen_point.ToPOINT());
699 } 699 }
700 #endif 700 #endif
701 701
702 bool LocationBarView::GetAccessibleName(std::wstring* name) {
703 DCHECK(name);
704
705 if (!accessible_name_.empty()) {
706 (*name).assign(accessible_name_);
sky 2009/08/21 21:33:39 name->assign
707 return true;
708 }
709 return false;
710 }
711
702 bool LocationBarView::GetAccessibleRole(AccessibilityTypes::Role* role) { 712 bool LocationBarView::GetAccessibleRole(AccessibilityTypes::Role* role) {
703 DCHECK(role); 713 DCHECK(role);
704 714
705 *role = AccessibilityTypes::ROLE_GROUPING; 715 *role = AccessibilityTypes::ROLE_GROUPING;
706 return true; 716 return true;
707 } 717 }
708 718
719 void LocationBarView::SetAccessibleName(const std::wstring& name) {
720 accessible_name_.assign(name);
721 }
722
709 // SelectedKeywordView ------------------------------------------------------- 723 // SelectedKeywordView -------------------------------------------------------
710 724
711 // The background is drawn using ImagePainter3. This is the left/center/right 725 // The background is drawn using ImagePainter3. This is the left/center/right
712 // image names. 726 // image names.
713 static const int kBorderImages[] = { 727 static const int kBorderImages[] = {
714 IDR_LOCATION_BAR_SELECTED_KEYWORD_BACKGROUND_L, 728 IDR_LOCATION_BAR_SELECTED_KEYWORD_BACKGROUND_L,
715 IDR_LOCATION_BAR_SELECTED_KEYWORD_BACKGROUND_C, 729 IDR_LOCATION_BAR_SELECTED_KEYWORD_BACKGROUND_C,
716 IDR_LOCATION_BAR_SELECTED_KEYWORD_BACKGROUND_R }; 730 IDR_LOCATION_BAR_SELECTED_KEYWORD_BACKGROUND_R };
717 731
718 // Insets around the label. 732 // Insets around the label.
(...skipping 666 matching lines...) Expand 10 before | Expand all | Expand 10 after
1385 } 1399 }
1386 1400
1387 int LocationBarView::PageActionVisibleCount() { 1401 int LocationBarView::PageActionVisibleCount() {
1388 int result = 0; 1402 int result = 0;
1389 for (size_t i = 0; i < page_action_image_views_.size(); i++) { 1403 for (size_t i = 0; i < page_action_image_views_.size(); i++) {
1390 if (page_action_image_views_[i]->IsVisible()) 1404 if (page_action_image_views_[i]->IsVisible())
1391 ++result; 1405 ++result;
1392 } 1406 }
1393 return result; 1407 return result;
1394 } 1408 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698