| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "content/renderer/render_view_impl.h" | 5 #include "content/renderer/render_view_impl.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <cmath> | 8 #include <cmath> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 1915 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1926 scoped_ptr<media::FilterCollection> collection( | 1926 scoped_ptr<media::FilterCollection> collection( |
| 1927 new media::FilterCollection()); | 1927 new media::FilterCollection()); |
| 1928 | 1928 |
| 1929 // Add in any custom filter factories first. | 1929 // Add in any custom filter factories first. |
| 1930 const CommandLine* cmd_line = CommandLine::ForCurrentProcess(); | 1930 const CommandLine* cmd_line = CommandLine::ForCurrentProcess(); |
| 1931 if (!cmd_line->HasSwitch(switches::kDisableAudio)) { | 1931 if (!cmd_line->HasSwitch(switches::kDisableAudio)) { |
| 1932 // Add the chrome specific audio renderer. | 1932 // Add the chrome specific audio renderer. |
| 1933 collection->AddAudioRenderer(new AudioRendererImpl()); | 1933 collection->AddAudioRenderer(new AudioRendererImpl()); |
| 1934 } | 1934 } |
| 1935 | 1935 |
| 1936 scoped_ptr<webkit_media::WebMediaPlayerImpl> result( | 1936 scoped_ptr<webkit_media::WebMediaPlayerImpl> result; |
| 1937 new webkit_media::WebMediaPlayerImpl(client, | 1937 if (content::GetContentClient()->renderer() |
| 1938 AsWeakPtr(), | 1938 ->ShouldOverrideCreateWebMediaPlayer(this)) { |
| 1939 collection.release(), | 1939 webkit_media::WebMediaPlayerImpl* result_ptr; |
| 1940 message_loop_factory.release(), | 1940 content::GetContentClient()->renderer()->OverrideCreateWebMediaPlayer( |
| 1941 media_stream_impl_.get(), | 1941 this, client, AsWeakPtr(), collection.release(), |
| 1942 new RenderMediaLog())); | 1942 message_loop_factory.release(), media_stream_impl_.get(), |
| 1943 new RenderMediaLog(), &result_ptr); |
| 1944 DCHECK(result_ptr); |
| 1945 result.reset(result_ptr); |
| 1946 } else { |
| 1947 result.reset(new webkit_media::WebMediaPlayerImpl(client, AsWeakPtr(), |
| 1948 collection.release(), message_loop_factory.release(), |
| 1949 media_stream_impl_.get(), new RenderMediaLog())); |
| 1950 } |
| 1951 DCHECK(result.get()); |
| 1952 |
| 1943 if (!result->Initialize(frame, | 1953 if (!result->Initialize(frame, |
| 1944 cmd_line->HasSwitch(switches::kSimpleDataSource))) { | 1954 cmd_line->HasSwitch(switches::kSimpleDataSource))) { |
| 1945 return NULL; | 1955 return NULL; |
| 1946 } | 1956 } |
| 1947 return result.release(); | 1957 return result.release(); |
| 1948 } | 1958 } |
| 1949 | 1959 |
| 1950 WebApplicationCacheHost* RenderViewImpl::createApplicationCacheHost( | 1960 WebApplicationCacheHost* RenderViewImpl::createApplicationCacheHost( |
| 1951 WebFrame* frame, WebApplicationCacheHostClient* client) { | 1961 WebFrame* frame, WebApplicationCacheHostClient* client) { |
| 1952 return new RendererWebApplicationCacheHostImpl( | 1962 return new RendererWebApplicationCacheHostImpl( |
| (...skipping 2808 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4761 return !!RenderThreadImpl::current()->compositor_thread(); | 4771 return !!RenderThreadImpl::current()->compositor_thread(); |
| 4762 } | 4772 } |
| 4763 | 4773 |
| 4764 void RenderViewImpl::OnJavaBridgeInit( | 4774 void RenderViewImpl::OnJavaBridgeInit( |
| 4765 const IPC::ChannelHandle& channel_handle) { | 4775 const IPC::ChannelHandle& channel_handle) { |
| 4766 DCHECK(!java_bridge_dispatcher_.get()); | 4776 DCHECK(!java_bridge_dispatcher_.get()); |
| 4767 #if defined(ENABLE_JAVA_BRIDGE) | 4777 #if defined(ENABLE_JAVA_BRIDGE) |
| 4768 java_bridge_dispatcher_.reset(new JavaBridgeDispatcher(this, channel_handle)); | 4778 java_bridge_dispatcher_.reset(new JavaBridgeDispatcher(this, channel_handle)); |
| 4769 #endif | 4779 #endif |
| 4770 } | 4780 } |
| OLD | NEW |