| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 "chrome/renderer/render_view.h" | 5 #include "chrome/renderer/render_view.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 395 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 406 OnDisassociateFromPopupCount) | 406 OnDisassociateFromPopupCount) |
| 407 IPC_MESSAGE_HANDLER(ViewMsg_AutofillSuggestions, | 407 IPC_MESSAGE_HANDLER(ViewMsg_AutofillSuggestions, |
| 408 OnReceivedAutofillSuggestions) | 408 OnReceivedAutofillSuggestions) |
| 409 IPC_MESSAGE_HANDLER(ViewMsg_PopupNotificationVisiblityChanged, | 409 IPC_MESSAGE_HANDLER(ViewMsg_PopupNotificationVisiblityChanged, |
| 410 OnPopupNotificationVisiblityChanged) | 410 OnPopupNotificationVisiblityChanged) |
| 411 IPC_MESSAGE_HANDLER(ViewMsg_RequestAudioPacket, OnRequestAudioPacket) | 411 IPC_MESSAGE_HANDLER(ViewMsg_RequestAudioPacket, OnRequestAudioPacket) |
| 412 IPC_MESSAGE_HANDLER(ViewMsg_NotifyAudioStreamCreated, OnAudioStreamCreated) | 412 IPC_MESSAGE_HANDLER(ViewMsg_NotifyAudioStreamCreated, OnAudioStreamCreated) |
| 413 IPC_MESSAGE_HANDLER(ViewMsg_NotifyAudioStreamStateChanged, | 413 IPC_MESSAGE_HANDLER(ViewMsg_NotifyAudioStreamStateChanged, |
| 414 OnAudioStreamStateChanged) | 414 OnAudioStreamStateChanged) |
| 415 IPC_MESSAGE_HANDLER(ViewMsg_NotifyAudioStreamVolume, OnAudioStreamVolume) | 415 IPC_MESSAGE_HANDLER(ViewMsg_NotifyAudioStreamVolume, OnAudioStreamVolume) |
| 416 IPC_MESSAGE_HANDLER(ViewMsg_MoveOrResizeStarted, OnMoveOrResizeStarted) |
| 416 | 417 |
| 417 // Have the super handle all other messages. | 418 // Have the super handle all other messages. |
| 418 IPC_MESSAGE_UNHANDLED(RenderWidget::OnMessageReceived(message)) | 419 IPC_MESSAGE_UNHANDLED(RenderWidget::OnMessageReceived(message)) |
| 419 IPC_END_MESSAGE_MAP() | 420 IPC_END_MESSAGE_MAP() |
| 420 } | 421 } |
| 421 | 422 |
| 422 // Got a response from the browser after the renderer decided to create a new | 423 // Got a response from the browser after the renderer decided to create a new |
| 423 // view. | 424 // view. |
| 424 void RenderView::OnCreatingNewAck(gfx::NativeViewId parent) { | 425 void RenderView::OnCreatingNewAck(gfx::NativeViewId parent) { |
| 425 CompleteInit(parent); | 426 CompleteInit(parent); |
| (...skipping 2473 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2899 | 2900 |
| 2900 void RenderView::OnAudioStreamVolume(int stream_id, double left, double right) { | 2901 void RenderView::OnAudioStreamVolume(int stream_id, double left, double right) { |
| 2901 AudioRendererImpl* audio_renderer = audio_renderers_.Lookup(stream_id); | 2902 AudioRendererImpl* audio_renderer = audio_renderers_.Lookup(stream_id); |
| 2902 if (!audio_renderer) { | 2903 if (!audio_renderer) { |
| 2903 NOTREACHED(); | 2904 NOTREACHED(); |
| 2904 return; | 2905 return; |
| 2905 } | 2906 } |
| 2906 audio_renderer->OnVolume(left, right); | 2907 audio_renderer->OnVolume(left, right); |
| 2907 } | 2908 } |
| 2908 | 2909 |
| 2910 void RenderView::OnMoveOrResizeStarted() { |
| 2911 if (webview()) |
| 2912 webview()->HideAutofillPopup(); |
| 2913 } |
| 2914 |
| 2909 int32 RenderView::CreateAudioStream(AudioRendererImpl* audio_renderer, | 2915 int32 RenderView::CreateAudioStream(AudioRendererImpl* audio_renderer, |
| 2910 AudioManager::Format format, int channels, | 2916 AudioManager::Format format, int channels, |
| 2911 int sample_rate, int bits_per_sample, | 2917 int sample_rate, int bits_per_sample, |
| 2912 size_t packet_size) { | 2918 size_t packet_size) { |
| 2913 // TODO(hclam): make sure this method is called on render thread. | 2919 // TODO(hclam): make sure this method is called on render thread. |
| 2914 // Loop through the map and make sure there's no renderer already in the map. | 2920 // Loop through the map and make sure there's no renderer already in the map. |
| 2915 for (IDMap<AudioRendererImpl>::const_iterator iter = audio_renderers_.begin(); | 2921 for (IDMap<AudioRendererImpl>::const_iterator iter = audio_renderers_.begin(); |
| 2916 iter != audio_renderers_.end(); ++iter) { | 2922 iter != audio_renderers_.end(); ++iter) { |
| 2917 DCHECK(iter->second != audio_renderer); | 2923 DCHECK(iter->second != audio_renderer); |
| 2918 } | 2924 } |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2951 // TODO(hclam): make sure this method is called on render thread. | 2957 // TODO(hclam): make sure this method is called on render thread. |
| 2952 DCHECK(audio_renderers_.Lookup(stream_id) != NULL); | 2958 DCHECK(audio_renderers_.Lookup(stream_id) != NULL); |
| 2953 Send(new ViewHostMsg_GetAudioVolume(routing_id_, stream_id)); | 2959 Send(new ViewHostMsg_GetAudioVolume(routing_id_, stream_id)); |
| 2954 } | 2960 } |
| 2955 | 2961 |
| 2956 void RenderView::SetAudioVolume(int stream_id, double left, double right) { | 2962 void RenderView::SetAudioVolume(int stream_id, double left, double right) { |
| 2957 // TODO(hclam): make sure this method is called on render thread. | 2963 // TODO(hclam): make sure this method is called on render thread. |
| 2958 DCHECK(audio_renderers_.Lookup(stream_id) != NULL); | 2964 DCHECK(audio_renderers_.Lookup(stream_id) != NULL); |
| 2959 Send(new ViewHostMsg_SetAudioVolume(routing_id_, stream_id, left, right)); | 2965 Send(new ViewHostMsg_SetAudioVolume(routing_id_, stream_id, left, right)); |
| 2960 } | 2966 } |
| 2967 |
| 2968 void RenderView::OnResize(const gfx::Size& new_size, |
| 2969 const gfx::Rect& resizer_rect) { |
| 2970 if (webview()) |
| 2971 webview()->HideAutofillPopup(); |
| 2972 RenderWidget::OnResize(new_size, resizer_rect); |
| 2973 } |
| OLD | NEW |