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

Side by Side Diff: content/browser/web_contents/web_contents_impl.cc

Issue 2391883006: Mojo-ify implementation of screen orientation locking/unlocking. (Closed)
Patch Set: Moved enum mojo definition to content/common due to dependency issue Created 4 years, 2 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/browser/web_contents/web_contents_impl.h" 5 #include "content/browser/web_contents/web_contents_impl.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <cmath> 9 #include <cmath>
10 #include <utility> 10 #include <utility>
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 #include "content/browser/media/session/media_session.h" 62 #include "content/browser/media/session/media_session.h"
63 #include "content/browser/message_port_message_filter.h" 63 #include "content/browser/message_port_message_filter.h"
64 #include "content/browser/plugin_content_origin_whitelist.h" 64 #include "content/browser/plugin_content_origin_whitelist.h"
65 #include "content/browser/renderer_host/render_process_host_impl.h" 65 #include "content/browser/renderer_host/render_process_host_impl.h"
66 #include "content/browser/renderer_host/render_view_host_delegate_view.h" 66 #include "content/browser/renderer_host/render_view_host_delegate_view.h"
67 #include "content/browser/renderer_host/render_view_host_impl.h" 67 #include "content/browser/renderer_host/render_view_host_impl.h"
68 #include "content/browser/renderer_host/render_widget_host_impl.h" 68 #include "content/browser/renderer_host/render_widget_host_impl.h"
69 #include "content/browser/renderer_host/render_widget_host_input_event_router.h" 69 #include "content/browser/renderer_host/render_widget_host_input_event_router.h"
70 #include "content/browser/renderer_host/render_widget_host_view_base.h" 70 #include "content/browser/renderer_host/render_widget_host_view_base.h"
71 #include "content/browser/renderer_host/text_input_manager.h" 71 #include "content/browser/renderer_host/text_input_manager.h"
72 #include "content/browser/screen_orientation/screen_orientation_dispatcher_host_ impl.h"
73 #include "content/browser/site_instance_impl.h" 72 #include "content/browser/site_instance_impl.h"
74 #include "content/browser/web_contents/web_contents_view_child_frame.h" 73 #include "content/browser/web_contents/web_contents_view_child_frame.h"
75 #include "content/browser/web_contents/web_contents_view_guest.h" 74 #include "content/browser/web_contents/web_contents_view_guest.h"
76 #include "content/browser/webui/generic_handler.h" 75 #include "content/browser/webui/generic_handler.h"
77 #include "content/browser/webui/web_ui_controller_factory_registry.h" 76 #include "content/browser/webui/web_ui_controller_factory_registry.h"
78 #include "content/browser/webui/web_ui_impl.h" 77 #include "content/browser/webui/web_ui_impl.h"
79 #include "content/common/browser_plugin/browser_plugin_constants.h" 78 #include "content/common/browser_plugin/browser_plugin_constants.h"
80 #include "content/common/browser_plugin/browser_plugin_messages.h" 79 #include "content/common/browser_plugin/browser_plugin_messages.h"
81 #include "content/common/frame_messages.h" 80 #include "content/common/frame_messages.h"
82 #include "content/common/input_messages.h" 81 #include "content/common/input_messages.h"
(...skipping 12 matching lines...) Expand all
95 #include "content/public/browser/guest_mode.h" 94 #include "content/public/browser/guest_mode.h"
96 #include "content/public/browser/invalidate_type.h" 95 #include "content/public/browser/invalidate_type.h"
97 #include "content/public/browser/javascript_dialog_manager.h" 96 #include "content/public/browser/javascript_dialog_manager.h"
98 #include "content/public/browser/load_notification_details.h" 97 #include "content/public/browser/load_notification_details.h"
99 #include "content/public/browser/navigation_details.h" 98 #include "content/public/browser/navigation_details.h"
100 #include "content/public/browser/notification_details.h" 99 #include "content/public/browser/notification_details.h"
101 #include "content/public/browser/notification_service.h" 100 #include "content/public/browser/notification_service.h"
102 #include "content/public/browser/notification_types.h" 101 #include "content/public/browser/notification_types.h"
103 #include "content/public/browser/render_widget_host_iterator.h" 102 #include "content/public/browser/render_widget_host_iterator.h"
104 #include "content/public/browser/resource_request_details.h" 103 #include "content/public/browser/resource_request_details.h"
105 #include "content/public/browser/screen_orientation_dispatcher_host.h" 104 #include "content/public/browser/screen_orientation_provider.h"
106 #include "content/public/browser/security_style_explanations.h" 105 #include "content/public/browser/security_style_explanations.h"
107 #include "content/public/browser/storage_partition.h" 106 #include "content/public/browser/storage_partition.h"
108 #include "content/public/browser/user_metrics.h" 107 #include "content/public/browser/user_metrics.h"
109 #include "content/public/browser/web_contents_binding_set.h" 108 #include "content/public/browser/web_contents_binding_set.h"
110 #include "content/public/browser/web_contents_delegate.h" 109 #include "content/public/browser/web_contents_delegate.h"
111 #include "content/public/common/bindings_policy.h" 110 #include "content/public/common/bindings_policy.h"
112 #include "content/public/common/browser_side_navigation_policy.h" 111 #include "content/public/common/browser_side_navigation_policy.h"
113 #include "content/public/common/child_process_host.h" 112 #include "content/public/common/child_process_host.h"
114 #include "content/public/common/content_constants.h" 113 #include "content/public/common/content_constants.h"
115 #include "content/public/common/content_switches.h" 114 #include "content/public/common/content_switches.h"
(...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after
458 #else 457 #else
459 media_web_contents_observer_.reset(new MediaWebContentsObserver(this)); 458 media_web_contents_observer_.reset(new MediaWebContentsObserver(this));
460 #endif 459 #endif
461 #if defined (ENABLE_PLUGINS) 460 #if defined (ENABLE_PLUGINS)
462 pepper_playback_observer_.reset(new PepperPlaybackObserver(this)); 461 pepper_playback_observer_.reset(new PepperPlaybackObserver(this));
463 #endif 462 #endif
464 loader_io_thread_notifier_.reset(new LoaderIOThreadNotifier(this)); 463 loader_io_thread_notifier_.reset(new LoaderIOThreadNotifier(this));
465 wake_lock_service_context_.reset(new device::WakeLockServiceContext( 464 wake_lock_service_context_.reset(new device::WakeLockServiceContext(
466 BrowserThread::GetTaskRunnerForThread(BrowserThread::FILE), 465 BrowserThread::GetTaskRunnerForThread(BrowserThread::FILE),
467 base::Bind(&WebContentsImpl::GetNativeView, base::Unretained(this)))); 466 base::Bind(&WebContentsImpl::GetNativeView, base::Unretained(this))));
467 screen_orientation_provider_.reset(new ScreenOrientationProvider(this));
468 } 468 }
469 469
470 WebContentsImpl::~WebContentsImpl() { 470 WebContentsImpl::~WebContentsImpl() {
471 is_being_destroyed_ = true; 471 is_being_destroyed_ = true;
472 472
473 rwh_input_event_router_.reset(); 473 rwh_input_event_router_.reset();
474 474
475 for (auto& entry : binding_sets_) 475 for (auto& entry : binding_sets_)
476 entry.second->CloseAllBindings(); 476 entry.second->CloseAllBindings();
477 477
(...skipping 1128 matching lines...) Expand 10 before | Expand all | Expand 10 after
1606 1606
1607 #if defined(ENABLE_PLUGINS) 1607 #if defined(ENABLE_PLUGINS)
1608 plugin_content_origin_whitelist_.reset( 1608 plugin_content_origin_whitelist_.reset(
1609 new PluginContentOriginWhitelist(this)); 1609 new PluginContentOriginWhitelist(this));
1610 #endif 1610 #endif
1611 1611
1612 registrar_.Add(this, 1612 registrar_.Add(this,
1613 NOTIFICATION_RENDER_WIDGET_HOST_DESTROYED, 1613 NOTIFICATION_RENDER_WIDGET_HOST_DESTROYED,
1614 NotificationService::AllBrowserContextsAndSources()); 1614 NotificationService::AllBrowserContextsAndSources());
1615 1615
1616 screen_orientation_dispatcher_host_.reset(
1617 new ScreenOrientationDispatcherHostImpl(this));
1618
1619 manifest_manager_host_.reset(new ManifestManagerHost(this)); 1616 manifest_manager_host_.reset(new ManifestManagerHost(this));
1620 1617
1621 #if defined(OS_ANDROID) 1618 #if defined(OS_ANDROID)
1622 date_time_chooser_.reset(new DateTimeChooserAndroid()); 1619 date_time_chooser_.reset(new DateTimeChooserAndroid());
1623 #endif 1620 #endif
1624 1621
1625 // BrowserPluginGuest::Init needs to be called after this WebContents has 1622 // BrowserPluginGuest::Init needs to be called after this WebContents has
1626 // a RenderWidgetHostViewGuest. That is, |view_->CreateView| above. 1623 // a RenderWidgetHostViewGuest. That is, |view_->CreateView| above.
1627 if (browser_plugin_guest_) 1624 if (browser_plugin_guest_)
1628 browser_plugin_guest_->Init(); 1625 browser_plugin_guest_->Init();
(...skipping 792 matching lines...) Expand 10 before | Expand all | Expand 10 after
2421 2418
2422 device::GeolocationServiceContext* 2419 device::GeolocationServiceContext*
2423 WebContentsImpl::GetGeolocationServiceContext() { 2420 WebContentsImpl::GetGeolocationServiceContext() {
2424 return geolocation_service_context_.get(); 2421 return geolocation_service_context_.get();
2425 } 2422 }
2426 2423
2427 device::WakeLockServiceContext* WebContentsImpl::GetWakeLockServiceContext() { 2424 device::WakeLockServiceContext* WebContentsImpl::GetWakeLockServiceContext() {
2428 return wake_lock_service_context_.get(); 2425 return wake_lock_service_context_.get();
2429 } 2426 }
2430 2427
2428 ScreenOrientationProvider* WebContentsImpl::GetScreenOrientationProvider() {
2429 return screen_orientation_provider_.get();
2430 }
2431
2431 void WebContentsImpl::OnShowValidationMessage( 2432 void WebContentsImpl::OnShowValidationMessage(
2432 const gfx::Rect& anchor_in_root_view, 2433 const gfx::Rect& anchor_in_root_view,
2433 const base::string16& main_text, 2434 const base::string16& main_text,
2434 const base::string16& sub_text) { 2435 const base::string16& sub_text) {
2435 if (delegate_) 2436 if (delegate_)
2436 delegate_->ShowValidationMessage( 2437 delegate_->ShowValidationMessage(
2437 this, anchor_in_root_view, main_text, sub_text); 2438 this, anchor_in_root_view, main_text, sub_text);
2438 } 2439 }
2439 2440
2440 void WebContentsImpl::OnHideValidationMessage() { 2441 void WebContentsImpl::OnHideValidationMessage() {
(...skipping 2814 matching lines...) Expand 10 before | Expand all | Expand 10 after
5255 dialog_manager_ = dialog_manager; 5256 dialog_manager_ = dialog_manager;
5256 } 5257 }
5257 5258
5258 void WebContentsImpl::RemoveBindingSet(const std::string& interface_name) { 5259 void WebContentsImpl::RemoveBindingSet(const std::string& interface_name) {
5259 auto it = binding_sets_.find(interface_name); 5260 auto it = binding_sets_.find(interface_name);
5260 if (it != binding_sets_.end()) 5261 if (it != binding_sets_.end())
5261 binding_sets_.erase(it); 5262 binding_sets_.erase(it);
5262 } 5263 }
5263 5264
5264 } // namespace content 5265 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698