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

Side by Side Diff: third_party/WebKit/Source/core/dom/Document.cpp

Issue 2810593002: Set plugin focus by implementing HTMLPlugInElement::SetFocused. (Closed)
Patch Set: HTMLFrameOwnerElement::SetFocused rather than Node::SetFocused 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 * (C) 2006 Alexey Proskuryakov (ap@webkit.org) 5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org)
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All
7 * rights reserved. 7 * rights reserved.
8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. 8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved.
9 * (http://www.torchmobile.com/) 9 * (http://www.torchmobile.com/)
10 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved. 10 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved.
(...skipping 4069 matching lines...) Expand 10 before | Expand all | Expand 10 after
4080 old_focused_element->DispatchFocusOutEvent(EventTypeNames::DOMFocusOut, 4080 old_focused_element->DispatchFocusOutEvent(EventTypeNames::DOMFocusOut,
4081 new_focused_element, 4081 new_focused_element,
4082 params.source_capabilities); 4082 params.source_capabilities);
4083 4083
4084 if (focused_element_) { 4084 if (focused_element_) {
4085 // handler shifted focus 4085 // handler shifted focus
4086 focus_change_blocked = true; 4086 focus_change_blocked = true;
4087 new_focused_element = nullptr; 4087 new_focused_element = nullptr;
4088 } 4088 }
4089 } 4089 }
4090
4091 if (IsHTMLPlugInElement(old_focused_element)) {
4092 if (PluginView* plugin =
4093 ToHTMLPlugInElement(old_focused_element)->Plugin())
4094 plugin->SetFocused(false, params.type);
4095 }
4096 } 4090 }
4097 4091
4098 if (new_focused_element) 4092 if (new_focused_element)
4099 UpdateStyleAndLayoutTreeForNode(new_focused_element); 4093 UpdateStyleAndLayoutTreeForNode(new_focused_element);
4100 if (new_focused_element && new_focused_element->IsFocusable()) { 4094 if (new_focused_element && new_focused_element->IsFocusable()) {
4101 if (IsRootEditableElement(*new_focused_element) && 4095 if (IsRootEditableElement(*new_focused_element) &&
4102 !AcceptsEditingFocus(*new_focused_element)) { 4096 !AcceptsEditingFocus(*new_focused_element)) {
4103 // delegate blocks focus change 4097 // delegate blocks focus change
4104 focus_change_blocked = true; 4098 focus_change_blocked = true;
4105 goto SetFocusedElementDone; 4099 goto SetFocusedElementDone;
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
4150 4144
4151 if (focused_element_ != new_focused_element) { 4145 if (focused_element_ != new_focused_element) {
4152 // handler shifted focus 4146 // handler shifted focus
4153 focus_change_blocked = true; 4147 focus_change_blocked = true;
4154 goto SetFocusedElementDone; 4148 goto SetFocusedElementDone;
4155 } 4149 }
4156 } 4150 }
4157 4151
4158 if (IsRootEditableElement(*focused_element_)) 4152 if (IsRootEditableElement(*focused_element_))
4159 GetFrame()->GetSpellChecker().DidBeginEditing(focused_element_.Get()); 4153 GetFrame()->GetSpellChecker().DidBeginEditing(focused_element_.Get());
4160
4161 if (IsHTMLPlugInElement(focused_element_)) {
4162 if (PluginView* plugin = ToHTMLPlugInElement(focused_element_)->Plugin())
4163 plugin->SetFocused(true, params.type);
4164 }
4165 } 4154 }
4166 4155
4167 if (!focus_change_blocked && focused_element_) { 4156 if (!focus_change_blocked && focused_element_) {
4168 // Create the AXObject cache in a focus change because Chromium relies on 4157 // Create the AXObject cache in a focus change because Chromium relies on
4169 // it. 4158 // it.
4170 if (AXObjectCache* cache = AxObjectCache()) 4159 if (AXObjectCache* cache = AxObjectCache())
4171 cache->HandleFocusedUIElementChanged(old_focused_element, 4160 cache->HandleFocusedUIElementChanged(old_focused_element,
4172 new_focused_element); 4161 new_focused_element);
4173 } 4162 }
4174 4163
(...skipping 2485 matching lines...) Expand 10 before | Expand all | Expand 10 after
6660 } 6649 }
6661 6650
6662 void showLiveDocumentInstances() { 6651 void showLiveDocumentInstances() {
6663 WeakDocumentSet& set = liveDocumentSet(); 6652 WeakDocumentSet& set = liveDocumentSet();
6664 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); 6653 fprintf(stderr, "There are %u documents currently alive:\n", set.size());
6665 for (blink::Document* document : set) 6654 for (blink::Document* document : set)
6666 fprintf(stderr, "- Document %p URL: %s\n", document, 6655 fprintf(stderr, "- Document %p URL: %s\n", document,
6667 document->Url().GetString().Utf8().Data()); 6656 document->Url().GetString().Utf8().Data());
6668 } 6657 }
6669 #endif 6658 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698