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

Side by Side Diff: third_party/WebKit/Source/core/html/shadow/DateTimeFieldElement.cpp

Issue 2810593002: Set plugin focus by implementing HTMLPlugInElement::SetFocused. (Closed)
Patch Set: fix comments Created 3 years, 8 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 return; 124 return;
125 } 125 }
126 126
127 if (key == "Backspace" || key == "Delete") { 127 if (key == "Backspace" || key == "Delete") {
128 keyboard_event->SetDefaultHandled(); 128 keyboard_event->SetDefaultHandled();
129 SetEmptyValue(kDispatchEvent); 129 SetEmptyValue(kDispatchEvent);
130 return; 130 return;
131 } 131 }
132 } 132 }
133 133
134 void DateTimeFieldElement::SetFocused(bool value) { 134 void DateTimeFieldElement::SetFocused(bool value, WebFocusType focus_type) {
135 if (field_owner_) 135 if (field_owner_) {
136 value ? field_owner_->DidFocusOnField() : field_owner_->DidBlurFromField(); 136 if (value) {
137 ContainerNode::SetFocused(value); 137 field_owner_->DidFocusOnField(focus_type);
138 } else {
139 field_owner_->DidBlurFromField(focus_type);
140 }
141 }
142
143 ContainerNode::SetFocused(value, focus_type);
138 } 144 }
139 145
140 void DateTimeFieldElement::FocusOnNextField() { 146 void DateTimeFieldElement::FocusOnNextField() {
141 if (!field_owner_) 147 if (!field_owner_)
142 return; 148 return;
143 field_owner_->FocusOnNextField(*this); 149 field_owner_->FocusOnNextField(*this);
144 } 150 }
145 151
146 void DateTimeFieldElement::Initialize(const AtomicString& pseudo, 152 void DateTimeFieldElement::Initialize(const AtomicString& pseudo,
147 const String& ax_help_text, 153 const String& ax_help_text,
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
219 225
220 if (event_behavior == kDispatchEvent && field_owner_) 226 if (event_behavior == kDispatchEvent && field_owner_)
221 field_owner_->FieldValueChanged(); 227 field_owner_->FieldValueChanged();
222 } 228 }
223 229
224 int DateTimeFieldElement::ValueForARIAValueNow() const { 230 int DateTimeFieldElement::ValueForARIAValueNow() const {
225 return ValueAsInteger(); 231 return ValueAsInteger();
226 } 232 }
227 233
228 } // namespace blink 234 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698