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

Side by Side Diff: third_party/WebKit/Source/core/html/TextControlElement.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) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2001 Dirk Mueller (mueller@kde.org) 4 * (C) 2001 Dirk Mueller (mueller@kde.org)
5 * Copyright (C) 2004, 2005, 2006, 2007 Apple Inc. All rights reserved. 5 * Copyright (C) 2004, 2005, 2006, 2007 Apple Inc. All rights reserved.
6 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) 6 * (C) 2006 Alexey Proskuryakov (ap@nypop.com)
7 * 7 *
8 * This library is free software; you can redistribute it and/or 8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public 9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
205 << "setValueBeforeFirstUserEditIfNotSet should be called beforehand."; 205 << "setValueBeforeFirstUserEditIfNotSet should be called beforehand.";
206 String non_null_value = value.IsNull() ? g_empty_string : value; 206 String non_null_value = value.IsNull() ? g_empty_string : value;
207 if (value_before_first_user_edit_ == non_null_value) 207 if (value_before_first_user_edit_ == non_null_value)
208 ClearValueBeforeFirstUserEdit(); 208 ClearValueBeforeFirstUserEdit();
209 } 209 }
210 210
211 void TextControlElement::ClearValueBeforeFirstUserEdit() { 211 void TextControlElement::ClearValueBeforeFirstUserEdit() {
212 value_before_first_user_edit_ = String(); 212 value_before_first_user_edit_ = String();
213 } 213 }
214 214
215 void TextControlElement::SetFocused(bool flag) { 215 void TextControlElement::SetFocused(bool flag, WebFocusType focus_type) {
216 HTMLFormControlElementWithState::SetFocused(flag); 216 HTMLFormControlElementWithState::SetFocused(flag, focus_type);
217 217
218 if (!flag) 218 if (!flag)
219 DispatchFormControlChangeEvent(); 219 DispatchFormControlChangeEvent();
220 } 220 }
221 221
222 void TextControlElement::DispatchFormControlChangeEvent() { 222 void TextControlElement::DispatchFormControlChangeEvent() {
223 if (!value_before_first_user_edit_.IsNull() && 223 if (!value_before_first_user_edit_.IsNull() &&
224 !EqualIgnoringNullity(value_before_first_user_edit_, value())) { 224 !EqualIgnoringNullity(value_before_first_user_edit_, value())) {
225 ClearValueBeforeFirstUserEdit(); 225 ClearValueBeforeFirstUserEdit();
226 DispatchChangeEvent(); 226 DispatchChangeEvent();
(...skipping 731 matching lines...) Expand 10 before | Expand all | Expand 10 after
958 958
959 void TextControlElement::CopyNonAttributePropertiesFromElement( 959 void TextControlElement::CopyNonAttributePropertiesFromElement(
960 const Element& source) { 960 const Element& source) {
961 const TextControlElement& source_element = 961 const TextControlElement& source_element =
962 static_cast<const TextControlElement&>(source); 962 static_cast<const TextControlElement&>(source);
963 last_change_was_user_edit_ = source_element.last_change_was_user_edit_; 963 last_change_was_user_edit_ = source_element.last_change_was_user_edit_;
964 HTMLFormControlElement::CopyNonAttributePropertiesFromElement(source); 964 HTMLFormControlElement::CopyNonAttributePropertiesFromElement(source);
965 } 965 }
966 966
967 } // namespace blink 967 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698