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

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

Issue 2649823002: [ScreenOrientation] Merge ScreenOrientation into ScreenOrientationProvider. (Closed)
Patch Set: Fix tests Created 3 years, 11 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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 #include "content/browser/media/session/media_session_impl.h" 66 #include "content/browser/media/session/media_session_impl.h"
67 #include "content/browser/message_port_message_filter.h" 67 #include "content/browser/message_port_message_filter.h"
68 #include "content/browser/plugin_content_origin_whitelist.h" 68 #include "content/browser/plugin_content_origin_whitelist.h"
69 #include "content/browser/renderer_host/render_process_host_impl.h" 69 #include "content/browser/renderer_host/render_process_host_impl.h"
70 #include "content/browser/renderer_host/render_view_host_delegate_view.h" 70 #include "content/browser/renderer_host/render_view_host_delegate_view.h"
71 #include "content/browser/renderer_host/render_view_host_impl.h" 71 #include "content/browser/renderer_host/render_view_host_impl.h"
72 #include "content/browser/renderer_host/render_widget_host_impl.h" 72 #include "content/browser/renderer_host/render_widget_host_impl.h"
73 #include "content/browser/renderer_host/render_widget_host_input_event_router.h" 73 #include "content/browser/renderer_host/render_widget_host_input_event_router.h"
74 #include "content/browser/renderer_host/render_widget_host_view_base.h" 74 #include "content/browser/renderer_host/render_widget_host_view_base.h"
75 #include "content/browser/renderer_host/text_input_manager.h" 75 #include "content/browser/renderer_host/text_input_manager.h"
76 #include "content/browser/screen_orientation/screen_orientation.h"
77 #include "content/browser/site_instance_impl.h" 76 #include "content/browser/site_instance_impl.h"
78 #include "content/browser/web_contents/web_contents_view_child_frame.h" 77 #include "content/browser/web_contents/web_contents_view_child_frame.h"
79 #include "content/browser/web_contents/web_contents_view_guest.h" 78 #include "content/browser/web_contents/web_contents_view_guest.h"
80 #include "content/browser/webui/generic_handler.h" 79 #include "content/browser/webui/generic_handler.h"
81 #include "content/browser/webui/web_ui_controller_factory_registry.h" 80 #include "content/browser/webui/web_ui_controller_factory_registry.h"
82 #include "content/browser/webui/web_ui_impl.h" 81 #include "content/browser/webui/web_ui_impl.h"
83 #include "content/common/browser_plugin/browser_plugin_constants.h" 82 #include "content/common/browser_plugin/browser_plugin_constants.h"
84 #include "content/common/browser_plugin/browser_plugin_messages.h" 83 #include "content/common/browser_plugin/browser_plugin_messages.h"
85 #include "content/common/drag_messages.h" 84 #include "content/common/drag_messages.h"
86 #include "content/common/frame_messages.h" 85 #include "content/common/frame_messages.h"
(...skipping 832 matching lines...) Expand 10 before | Expand all | Expand 10 after
919 const { 918 const {
920 if (auto widget_host = GetFullscreenRenderWidgetHost()) 919 if (auto widget_host = GetFullscreenRenderWidgetHost())
921 return widget_host->GetView(); 920 return widget_host->GetView();
922 return nullptr; 921 return nullptr;
923 } 922 }
924 923
925 WebContentsView* WebContentsImpl::GetView() const { 924 WebContentsView* WebContentsImpl::GetView() const {
926 return view_.get(); 925 return view_.get();
927 } 926 }
928 927
928 ScreenOrientationProvider* WebContentsImpl::GetScreenOrientationProvider()
929 const {
mlamouri (slow - plz ping) 2017/01/28 02:17:51 curiosity (not the spaceship): is `git cl format`
leonhsl(Using Gerrit) 2017/02/04 03:13:45 Yeah this is produced by 'git cl format'. I change
930 return screen_orientation_provider_.get();
931 }
932
929 SkColor WebContentsImpl::GetThemeColor() const { 933 SkColor WebContentsImpl::GetThemeColor() const {
930 return theme_color_; 934 return theme_color_;
931 } 935 }
932 936
933 void WebContentsImpl::SetAccessibilityMode(AccessibilityMode mode) { 937 void WebContentsImpl::SetAccessibilityMode(AccessibilityMode mode) {
934 if (mode == accessibility_mode_) 938 if (mode == accessibility_mode_)
935 return; 939 return;
936 940
937 // Don't allow accessibility to be enabled for WebContents that are never 941 // Don't allow accessibility to be enabled for WebContents that are never
938 // visible, like background pages. 942 // visible, like background pages.
(...skipping 640 matching lines...) Expand 10 before | Expand all | Expand 10 after
1579 1583
1580 #if BUILDFLAG(ENABLE_PLUGINS) 1584 #if BUILDFLAG(ENABLE_PLUGINS)
1581 plugin_content_origin_whitelist_.reset( 1585 plugin_content_origin_whitelist_.reset(
1582 new PluginContentOriginWhitelist(this)); 1586 new PluginContentOriginWhitelist(this));
1583 #endif 1587 #endif
1584 1588
1585 registrar_.Add(this, 1589 registrar_.Add(this,
1586 NOTIFICATION_RENDER_WIDGET_HOST_DESTROYED, 1590 NOTIFICATION_RENDER_WIDGET_HOST_DESTROYED,
1587 NotificationService::AllBrowserContextsAndSources()); 1591 NotificationService::AllBrowserContextsAndSources());
1588 1592
1589 screen_orientation_.reset(new ScreenOrientation(this)); 1593 screen_orientation_provider_.reset(new ScreenOrientationProvider(this));
1590 1594
1591 manifest_manager_host_.reset(new ManifestManagerHost(this)); 1595 manifest_manager_host_.reset(new ManifestManagerHost(this));
1592 1596
1593 #if defined(OS_ANDROID) 1597 #if defined(OS_ANDROID)
1594 date_time_chooser_.reset(new DateTimeChooserAndroid()); 1598 date_time_chooser_.reset(new DateTimeChooserAndroid());
1595 #endif 1599 #endif
1596 1600
1597 // BrowserPluginGuest::Init needs to be called after this WebContents has 1601 // BrowserPluginGuest::Init needs to be called after this WebContents has
1598 // a RenderWidgetHostViewGuest. That is, |view_->CreateView| above. 1602 // a RenderWidgetHostViewGuest. That is, |view_->CreateView| above.
1599 if (browser_plugin_guest_) 1603 if (browser_plugin_guest_)
(...skipping 822 matching lines...) Expand 10 before | Expand all | Expand 10 after
2422 2426
2423 device::GeolocationServiceContext* 2427 device::GeolocationServiceContext*
2424 WebContentsImpl::GetGeolocationServiceContext() { 2428 WebContentsImpl::GetGeolocationServiceContext() {
2425 return geolocation_service_context_.get(); 2429 return geolocation_service_context_.get();
2426 } 2430 }
2427 2431
2428 device::WakeLockServiceContext* WebContentsImpl::GetWakeLockServiceContext() { 2432 device::WakeLockServiceContext* WebContentsImpl::GetWakeLockServiceContext() {
2429 return wake_lock_service_context_.get(); 2433 return wake_lock_service_context_.get();
2430 } 2434 }
2431 2435
2432 ScreenOrientationProvider* WebContentsImpl::GetScreenOrientationProvider() {
2433 return screen_orientation_.get()->GetScreenOrientationProvider();
2434 }
2435
2436 void WebContentsImpl::OnShowValidationMessage( 2436 void WebContentsImpl::OnShowValidationMessage(
2437 RenderViewHostImpl* source, 2437 RenderViewHostImpl* source,
2438 const gfx::Rect& anchor_in_root_view, 2438 const gfx::Rect& anchor_in_root_view,
2439 const base::string16& main_text, 2439 const base::string16& main_text,
2440 const base::string16& sub_text) { 2440 const base::string16& sub_text) {
2441 // TODO(nick): Should we consider |source| here or pass it to the delegate? 2441 // TODO(nick): Should we consider |source| here or pass it to the delegate?
2442 if (delegate_) 2442 if (delegate_)
2443 delegate_->ShowValidationMessage( 2443 delegate_->ShowValidationMessage(
2444 this, anchor_in_root_view, main_text, sub_text); 2444 this, anchor_in_root_view, main_text, sub_text);
2445 } 2445 }
(...skipping 2973 matching lines...) Expand 10 before | Expand all | Expand 10 after
5419 GetMainFrame()->AddMessageToConsole( 5419 GetMainFrame()->AddMessageToConsole(
5420 content::CONSOLE_MESSAGE_LEVEL_WARNING, 5420 content::CONSOLE_MESSAGE_LEVEL_WARNING,
5421 base::StringPrintf("This site does not have a valid SSL " 5421 base::StringPrintf("This site does not have a valid SSL "
5422 "certificate! Without SSL, your site's and " 5422 "certificate! Without SSL, your site's and "
5423 "visitors' data is vulnerable to theft and " 5423 "visitors' data is vulnerable to theft and "
5424 "tampering. Get a valid SSL certificate before" 5424 "tampering. Get a valid SSL certificate before"
5425 " releasing your website to the public.")); 5425 " releasing your website to the public."));
5426 } 5426 }
5427 5427
5428 } // namespace content 5428 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698