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

Side by Side Diff: chrome/renderer/render_view.cc

Issue 2858049: Chromium plumbing for Device Orientation. (Closed)
Patch Set: Fixes after try bot runs Created 10 years, 4 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
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 25 matching lines...) Expand all
36 #include "chrome/common/pepper_plugin_registry.h" 36 #include "chrome/common/pepper_plugin_registry.h"
37 #include "chrome/common/plugin_group.h" 37 #include "chrome/common/plugin_group.h"
38 #include "chrome/common/render_messages.h" 38 #include "chrome/common/render_messages.h"
39 #include "chrome/common/renderer_preferences.h" 39 #include "chrome/common/renderer_preferences.h"
40 #include "chrome/common/thumbnail_score.h" 40 #include "chrome/common/thumbnail_score.h"
41 #include "chrome/common/url_constants.h" 41 #include "chrome/common/url_constants.h"
42 #include "chrome/common/window_container_type.h" 42 #include "chrome/common/window_container_type.h"
43 #include "chrome/renderer/about_handler.h" 43 #include "chrome/renderer/about_handler.h"
44 #include "chrome/renderer/audio_message_filter.h" 44 #include "chrome/renderer/audio_message_filter.h"
45 #include "chrome/renderer/blocked_plugin.h" 45 #include "chrome/renderer/blocked_plugin.h"
46 #include "chrome/renderer/device_orientation_dispatcher.h"
46 #include "chrome/renderer/devtools_agent.h" 47 #include "chrome/renderer/devtools_agent.h"
47 #include "chrome/renderer/devtools_client.h" 48 #include "chrome/renderer/devtools_client.h"
48 #include "chrome/renderer/extension_groups.h" 49 #include "chrome/renderer/extension_groups.h"
49 #include "chrome/renderer/extensions/event_bindings.h" 50 #include "chrome/renderer/extensions/event_bindings.h"
50 #include "chrome/renderer/extensions/extension_process_bindings.h" 51 #include "chrome/renderer/extensions/extension_process_bindings.h"
51 #include "chrome/renderer/extensions/renderer_extension_bindings.h" 52 #include "chrome/renderer/extensions/renderer_extension_bindings.h"
52 #include "chrome/renderer/geolocation_dispatcher.h" 53 #include "chrome/renderer/geolocation_dispatcher.h"
53 #include "chrome/renderer/localized_error.h" 54 #include "chrome/renderer/localized_error.h"
54 #include "chrome/renderer/media/audio_renderer_impl.h" 55 #include "chrome/renderer/media/audio_renderer_impl.h"
55 #include "chrome/renderer/media/ipc_video_decoder.h" 56 #include "chrome/renderer/media/ipc_video_decoder.h"
(...skipping 591 matching lines...) Expand 10 before | Expand all | Expand 10 after
647 if (notification_provider_->OnMessageReceived(message)) 648 if (notification_provider_->OnMessageReceived(message))
648 return; 649 return;
649 if (geolocation_dispatcher_.get() && 650 if (geolocation_dispatcher_.get() &&
650 geolocation_dispatcher_->OnMessageReceived(message)) { 651 geolocation_dispatcher_->OnMessageReceived(message)) {
651 return; 652 return;
652 } 653 }
653 if (speech_input_dispatcher_.get() && 654 if (speech_input_dispatcher_.get() &&
654 speech_input_dispatcher_->OnMessageReceived(message)) { 655 speech_input_dispatcher_->OnMessageReceived(message)) {
655 return; 656 return;
656 } 657 }
658 if (device_orientation_dispatcher_.get() &&
659 device_orientation_dispatcher_->OnMessageReceived(message)) {
660 return;
661 }
657 662
658 IPC_BEGIN_MESSAGE_MAP(RenderView, message) 663 IPC_BEGIN_MESSAGE_MAP(RenderView, message)
659 IPC_MESSAGE_HANDLER(ViewMsg_CaptureThumbnail, OnCaptureThumbnail) 664 IPC_MESSAGE_HANDLER(ViewMsg_CaptureThumbnail, OnCaptureThumbnail)
660 IPC_MESSAGE_HANDLER(ViewMsg_CaptureSnapshot, OnCaptureSnapshot) 665 IPC_MESSAGE_HANDLER(ViewMsg_CaptureSnapshot, OnCaptureSnapshot)
661 IPC_MESSAGE_HANDLER(ViewMsg_PrintPages, OnPrintPages) 666 IPC_MESSAGE_HANDLER(ViewMsg_PrintPages, OnPrintPages)
662 IPC_MESSAGE_HANDLER(ViewMsg_PrintingDone, OnPrintingDone) 667 IPC_MESSAGE_HANDLER(ViewMsg_PrintingDone, OnPrintingDone)
663 IPC_MESSAGE_HANDLER(ViewMsg_Navigate, OnNavigate) 668 IPC_MESSAGE_HANDLER(ViewMsg_Navigate, OnNavigate)
664 IPC_MESSAGE_HANDLER(ViewMsg_Stop, OnStop) 669 IPC_MESSAGE_HANDLER(ViewMsg_Stop, OnStop)
665 IPC_MESSAGE_HANDLER(ViewMsg_ReloadFrame, OnReloadFrame) 670 IPC_MESSAGE_HANDLER(ViewMsg_ReloadFrame, OnReloadFrame)
666 IPC_MESSAGE_HANDLER(ViewMsg_Undo, OnUndo) 671 IPC_MESSAGE_HANDLER(ViewMsg_Undo, OnUndo)
(...skipping 4726 matching lines...) Expand 10 before | Expand all | Expand 10 after
5393 return geolocation_dispatcher_.get(); 5398 return geolocation_dispatcher_.get();
5394 } 5399 }
5395 5400
5396 WebKit::WebSpeechInputController* RenderView::speechInputController( 5401 WebKit::WebSpeechInputController* RenderView::speechInputController(
5397 WebKit::WebSpeechInputListener* listener) { 5402 WebKit::WebSpeechInputListener* listener) {
5398 if (!speech_input_dispatcher_.get()) 5403 if (!speech_input_dispatcher_.get())
5399 speech_input_dispatcher_.reset(new SpeechInputDispatcher(this, listener)); 5404 speech_input_dispatcher_.reset(new SpeechInputDispatcher(this, listener));
5400 return speech_input_dispatcher_.get(); 5405 return speech_input_dispatcher_.get();
5401 } 5406 }
5402 5407
5408 WebKit::WebDeviceOrientationClient* RenderView::deviceOrientationClient() {
5409 if (!device_orientation_dispatcher_.get())
5410 device_orientation_dispatcher_.reset(new DeviceOrientationDispatcher(this));
5411 return device_orientation_dispatcher_.get();
5412 }
5413
5403 bool RenderView::IsNonLocalTopLevelNavigation( 5414 bool RenderView::IsNonLocalTopLevelNavigation(
5404 const GURL& url, WebKit::WebFrame* frame, WebKit::WebNavigationType type) { 5415 const GURL& url, WebKit::WebFrame* frame, WebKit::WebNavigationType type) {
5405 // Must be a top level frame. 5416 // Must be a top level frame.
5406 if (frame->parent() != NULL) 5417 if (frame->parent() != NULL)
5407 return false; 5418 return false;
5408 5419
5409 // Navigations initiated within Webkit are not sent out to the external host 5420 // Navigations initiated within Webkit are not sent out to the external host
5410 // in the following cases. 5421 // in the following cases.
5411 // 1. The url scheme or the frame url scheme is not http/https 5422 // 1. The url scheme or the frame url scheme is not http/https
5412 // 2. The origin of the url and the frame is the same in which case the 5423 // 2. The origin of the url and the frame is the same in which case the
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
5445 // the origins of the two domains are different. This can be treated as a 5456 // the origins of the two domains are different. This can be treated as a
5446 // top level navigation and routed back to the host. 5457 // top level navigation and routed back to the host.
5447 WebKit::WebFrame* opener = frame->opener(); 5458 WebKit::WebFrame* opener = frame->opener();
5448 if (opener) { 5459 if (opener) {
5449 if (url.GetOrigin() != GURL(opener->url()).GetOrigin()) 5460 if (url.GetOrigin() != GURL(opener->url()).GetOrigin())
5450 return true; 5461 return true;
5451 } 5462 }
5452 } 5463 }
5453 return false; 5464 return false;
5454 } 5465 }
OLDNEW
« no previous file with comments | « chrome/renderer/render_view.h ('k') | chrome/test/data/device_orientation/device_orientation_test.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698