OLD | NEW |
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 3039 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3050 } | 3050 } |
3051 | 3051 |
3052 void WebViewImpl::performMediaPlayerAction(const WebMediaPlayerAction& action, | 3052 void WebViewImpl::performMediaPlayerAction(const WebMediaPlayerAction& action, |
3053 const WebPoint& location) | 3053 const WebPoint& location) |
3054 { | 3054 { |
3055 HitTestResult result = hitTestResultForWindowPos(location); | 3055 HitTestResult result = hitTestResultForWindowPos(location); |
3056 RefPtr<Node> node = result.innerNonSharedNode(); | 3056 RefPtr<Node> node = result.innerNonSharedNode(); |
3057 if (!isHTMLVideoElement(*node) && !isHTMLAudioElement(*node)) | 3057 if (!isHTMLVideoElement(*node) && !isHTMLAudioElement(*node)) |
3058 return; | 3058 return; |
3059 | 3059 |
3060 RefPtr<HTMLMediaElement> mediaElement = | 3060 RefPtrWillBeRawPtr<HTMLMediaElement> mediaElement = |
3061 static_pointer_cast<HTMLMediaElement>(node); | 3061 static_cast<HTMLMediaElement*>(node.get()); |
3062 switch (action.type) { | 3062 switch (action.type) { |
3063 case WebMediaPlayerAction::Play: | 3063 case WebMediaPlayerAction::Play: |
3064 if (action.enable) | 3064 if (action.enable) |
3065 mediaElement->play(); | 3065 mediaElement->play(); |
3066 else | 3066 else |
3067 mediaElement->pause(); | 3067 mediaElement->pause(); |
3068 break; | 3068 break; |
3069 case WebMediaPlayerAction::Mute: | 3069 case WebMediaPlayerAction::Mute: |
3070 mediaElement->setMuted(action.enable); | 3070 mediaElement->setMuted(action.enable); |
3071 break; | 3071 break; |
(...skipping 1003 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4075 const PageScaleConstraints& constraints = m_pageScaleConstraintsSet.pageDefi
nedConstraints(); | 4075 const PageScaleConstraints& constraints = m_pageScaleConstraintsSet.pageDefi
nedConstraints(); |
4076 | 4076 |
4077 if (!mainFrameImpl() || !mainFrameImpl()->frameView()) | 4077 if (!mainFrameImpl() || !mainFrameImpl()->frameView()) |
4078 return false; | 4078 return false; |
4079 | 4079 |
4080 return mainFrameImpl()->frameView()->layoutSize().width() == m_size.width | 4080 return mainFrameImpl()->frameView()->layoutSize().width() == m_size.width |
4081 || (constraints.minimumScale == constraints.maximumScale && constraints.
minimumScale != -1); | 4081 || (constraints.minimumScale == constraints.maximumScale && constraints.
minimumScale != -1); |
4082 } | 4082 } |
4083 | 4083 |
4084 } // namespace blink | 4084 } // namespace blink |
OLD | NEW |