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

Side by Side Diff: Source/web/WebViewImpl.cpp

Issue 18205009: Introduce isHTMLVideoElement and toHTMLVideoElement (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 5 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 | « Source/web/ContextMenuClientImpl.cpp ('k') | no next file » | 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) 2011, 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2011, 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 are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 #include "core/dom/KeyboardEvent.h" 95 #include "core/dom/KeyboardEvent.h"
96 #include "core/dom/NodeRenderStyle.h" 96 #include "core/dom/NodeRenderStyle.h"
97 #include "core/dom/Text.h" 97 #include "core/dom/Text.h"
98 #include "core/dom/WheelEvent.h" 98 #include "core/dom/WheelEvent.h"
99 #include "core/editing/Editor.h" 99 #include "core/editing/Editor.h"
100 #include "core/editing/FrameSelection.h" 100 #include "core/editing/FrameSelection.h"
101 #include "core/editing/TextIterator.h" 101 #include "core/editing/TextIterator.h"
102 #include "core/html/HTMLInputElement.h" 102 #include "core/html/HTMLInputElement.h"
103 #include "core/html/HTMLMediaElement.h" 103 #include "core/html/HTMLMediaElement.h"
104 #include "core/html/HTMLTextAreaElement.h" 104 #include "core/html/HTMLTextAreaElement.h"
105 #include "core/html/HTMLVideoElement.h"
105 #include "core/inspector/InspectorController.h" 106 #include "core/inspector/InspectorController.h"
106 #include "core/inspector/InspectorInstrumentation.h" 107 #include "core/inspector/InspectorInstrumentation.h"
107 #include "core/loader/DocumentLoader.h" 108 #include "core/loader/DocumentLoader.h"
108 #include "core/loader/FrameLoader.h" 109 #include "core/loader/FrameLoader.h"
109 #include "core/loader/UniqueIdentifier.h" 110 #include "core/loader/UniqueIdentifier.h"
110 #include "core/page/Chrome.h" 111 #include "core/page/Chrome.h"
111 #include "core/page/ContextMenuController.h" 112 #include "core/page/ContextMenuController.h"
112 #include "core/page/DragController.h" 113 #include "core/page/DragController.h"
113 #include "core/page/DragSession.h" 114 #include "core/page/DragSession.h"
114 #include "core/page/EventHandler.h" 115 #include "core/page/EventHandler.h"
(...skipping 3054 matching lines...) Expand 10 before | Expand all | Expand 10 after
3169 return; 3170 return;
3170 3171
3171 frame->view()->setFixedLayoutSize(layoutSize); 3172 frame->view()->setFixedLayoutSize(layoutSize);
3172 } 3173 }
3173 3174
3174 void WebViewImpl::performMediaPlayerAction(const WebMediaPlayerAction& action, 3175 void WebViewImpl::performMediaPlayerAction(const WebMediaPlayerAction& action,
3175 const WebPoint& location) 3176 const WebPoint& location)
3176 { 3177 {
3177 HitTestResult result = hitTestResultForWindowPos(location); 3178 HitTestResult result = hitTestResultForWindowPos(location);
3178 RefPtr<Node> node = result.innerNonSharedNode(); 3179 RefPtr<Node> node = result.innerNonSharedNode();
3179 if (!node->hasTagName(HTMLNames::videoTag) && !node->hasTagName(HTMLNames::a udioTag)) 3180 if (!isHTMLVideoElement(node.get()) && !node->hasTagName(HTMLNames::audioTag ))
3180 return; 3181 return;
3181 3182
3182 RefPtr<HTMLMediaElement> mediaElement = 3183 RefPtr<HTMLMediaElement> mediaElement =
3183 static_pointer_cast<HTMLMediaElement>(node); 3184 static_pointer_cast<HTMLMediaElement>(node);
3184 switch (action.type) { 3185 switch (action.type) {
3185 case WebMediaPlayerAction::Play: 3186 case WebMediaPlayerAction::Play:
3186 if (action.enable) 3187 if (action.enable)
3187 mediaElement->play(); 3188 mediaElement->play();
3188 else 3189 else
3189 mediaElement->pause(); 3190 mediaElement->pause();
(...skipping 973 matching lines...) Expand 10 before | Expand all | Expand 10 after
4163 } 4164 }
4164 4165
4165 bool WebViewImpl::shouldDisableDesktopWorkarounds() 4166 bool WebViewImpl::shouldDisableDesktopWorkarounds()
4166 { 4167 {
4167 ViewportArguments arguments = mainFrameImpl()->frame()->document()->viewport Arguments(); 4168 ViewportArguments arguments = mainFrameImpl()->frame()->document()->viewport Arguments();
4168 return arguments.width == ViewportArguments::ValueDeviceWidth || !arguments. userZoom 4169 return arguments.width == ViewportArguments::ValueDeviceWidth || !arguments. userZoom
4169 || (arguments.minZoom == arguments.maxZoom && arguments.minZoom != Viewp ortArguments::ValueAuto); 4170 || (arguments.minZoom == arguments.maxZoom && arguments.minZoom != Viewp ortArguments::ValueAuto);
4170 } 4171 }
4171 4172
4172 } // namespace WebKit 4173 } // namespace WebKit
OLDNEW
« no previous file with comments | « Source/web/ContextMenuClientImpl.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698