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

Unified Diff: chrome/browser/ui/views/location_bar/location_bar_view.cc

Issue 23441024: Implement put_accvalue for textfields and location bar. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 7 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/views/location_bar/location_bar_view.cc
diff --git a/chrome/browser/ui/views/location_bar/location_bar_view.cc b/chrome/browser/ui/views/location_bar/location_bar_view.cc
index 4b2dbd2e88f0ae63b660051489ca93acfe3f9197..36317632bf741c484039f6d5c5b32745b7929818 100644
--- a/chrome/browser/ui/views/location_bar/location_bar_view.cc
+++ b/chrome/browser/ui/views/location_bar/location_bar_view.cc
@@ -1300,6 +1300,11 @@ void LocationBarView::PaintPageActionBackgrounds(gfx::Canvas* canvas) {
}
}
+void LocationBarView::AccessibilitySetValue(const string16& new_value) {
+ location_entry_->SetUserText(new_value);
+ location_entry_->SelectAll(false);
msw 2013/08/31 20:22:36 This does not clear the selection as the Accessibi
dmazzoni 2013/09/03 20:20:11 Done.
+}
+
const char* LocationBarView::GetClassName() const {
return kViewClassName;
}
@@ -1341,6 +1346,9 @@ void LocationBarView::GetAccessibleState(ui::AccessibleViewState* state) {
location_entry_->GetSelectionBounds(&entry_start, &entry_end);
state->selection_start = entry_start;
state->selection_end = entry_end;
+
+ state->set_value_callback = base::Bind(
+ &LocationBarView::AccessibilitySetValue, base::Unretained(this));
msw 2013/08/31 20:22:36 base::Unretained is probably not correct here, I t
dmazzoni 2013/09/03 20:20:11 I don't think we need to bind to location_entry_,
msw 2013/09/03 21:06:57 Binding to a LocationBarView WeakPtr is just as go
}
bool LocationBarView::HasFocus() const {

Powered by Google App Engine
This is Rietveld 408576698