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

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

Issue 1389093002: Make sure plugin element is focused in PluginDocument. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/web/tests/WebPluginContainerTest.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006, 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2008 Apple 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 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 frame->loader().dispatchDocumentElementAvailable(); 96 frame->loader().dispatchDocumentElementAvailable();
97 97
98 RefPtrWillBeRawPtr<HTMLBodyElement> body = HTMLBodyElement::create(*document ()); 98 RefPtrWillBeRawPtr<HTMLBodyElement> body = HTMLBodyElement::create(*document ());
99 body->setAttribute(styleAttr, "background-color: rgb(38,38,38); height: 100% ; width: 100%; overflow: hidden; margin: 0"); 99 body->setAttribute(styleAttr, "background-color: rgb(38,38,38); height: 100% ; width: 100%; overflow: hidden; margin: 0");
100 rootElement->appendChild(body); 100 rootElement->appendChild(body);
101 101
102 m_embedElement = HTMLEmbedElement::create(*document()); 102 m_embedElement = HTMLEmbedElement::create(*document());
103 m_embedElement->setAttribute(widthAttr, "100%"); 103 m_embedElement->setAttribute(widthAttr, "100%");
104 m_embedElement->setAttribute(heightAttr, "100%"); 104 m_embedElement->setAttribute(heightAttr, "100%");
105 m_embedElement->setAttribute(nameAttr, "plugin"); 105 m_embedElement->setAttribute(nameAttr, "plugin");
106 m_embedElement->setAttribute(idAttr, "plugin");
106 m_embedElement->setAttribute(srcAttr, AtomicString(document()->url().string( ))); 107 m_embedElement->setAttribute(srcAttr, AtomicString(document()->url().string( )));
107 m_embedElement->setAttribute(typeAttr, document()->loader()->mimeType()); 108 m_embedElement->setAttribute(typeAttr, document()->loader()->mimeType());
108 body->appendChild(m_embedElement); 109 body->appendChild(m_embedElement);
109 110
110 toPluginDocument(document())->setPluginNode(m_embedElement.get()); 111 toPluginDocument(document())->setPluginNode(m_embedElement.get());
112 m_embedElement->focus();
111 113
112 document()->updateLayout(); 114 document()->updateLayout();
113 115
114 // We need the plugin to load synchronously so we can get the PluginView 116 // We need the plugin to load synchronously so we can get the PluginView
115 // below so flush the layout tasks now instead of waiting on the timer. 117 // below so flush the layout tasks now instead of waiting on the timer.
116 frame->view()->flushAnyPendingPostLayoutTasks(); 118 frame->view()->flushAnyPendingPostLayoutTasks();
117 119
118 if (PluginView* view = pluginView()) 120 if (PluginView* view = pluginView())
119 view->didReceiveResponse(document()->loader()->response()); 121 view->didReceiveResponse(document()->loader()->response());
120 } 122 }
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
185 HTMLDocument::detach(context); 187 HTMLDocument::detach(context);
186 } 188 }
187 189
188 DEFINE_TRACE(PluginDocument) 190 DEFINE_TRACE(PluginDocument)
189 { 191 {
190 visitor->trace(m_pluginNode); 192 visitor->trace(m_pluginNode);
191 HTMLDocument::trace(visitor); 193 HTMLDocument::trace(visitor);
192 } 194 }
193 195
194 } 196 }
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/web/tests/WebPluginContainerTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698