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

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

Issue 2649823002: [ScreenOrientation] Merge ScreenOrientation into ScreenOrientationProvider. (Closed)
Patch Set: Address comments from mlamouri@ Created 3 years, 10 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 835 matching lines...) Expand 10 before | Expand all | Expand 10 after
922 const { 921 const {
923 if (auto widget_host = GetFullscreenRenderWidgetHost()) 922 if (auto widget_host = GetFullscreenRenderWidgetHost())
924 return widget_host->GetView(); 923 return widget_host->GetView();
925 return nullptr; 924 return nullptr;
926 } 925 }
927 926
928 WebContentsView* WebContentsImpl::GetView() const { 927 WebContentsView* WebContentsImpl::GetView() const {
929 return view_.get(); 928 return view_.get();
930 } 929 }
931 930
931 ScreenOrientationProvider* WebContentsImpl::GetScreenOrientationProvider()
932 const {
933 return screen_orientation_provider_.get();
934 }
935
932 SkColor WebContentsImpl::GetThemeColor() const { 936 SkColor WebContentsImpl::GetThemeColor() const {
933 return theme_color_; 937 return theme_color_;
934 } 938 }
935 939
936 void WebContentsImpl::SetAccessibilityMode(AccessibilityMode mode) { 940 void WebContentsImpl::SetAccessibilityMode(AccessibilityMode mode) {
937 if (mode == accessibility_mode_) 941 if (mode == accessibility_mode_)
938 return; 942 return;
939 943
940 // Don't allow accessibility to be enabled for WebContents that are never 944 // Don't allow accessibility to be enabled for WebContents that are never
941 // visible, like background pages. 945 // visible, like background pages.
(...skipping 640 matching lines...) Expand 10 before | Expand all | Expand 10 after
1582 1586
1583 #if BUILDFLAG(ENABLE_PLUGINS) 1587 #if BUILDFLAG(ENABLE_PLUGINS)
1584 plugin_content_origin_whitelist_.reset( 1588 plugin_content_origin_whitelist_.reset(
1585 new PluginContentOriginWhitelist(this)); 1589 new PluginContentOriginWhitelist(this));
1586 #endif 1590 #endif
1587 1591
1588 registrar_.Add(this, 1592 registrar_.Add(this,
1589 NOTIFICATION_RENDER_WIDGET_HOST_DESTROYED, 1593 NOTIFICATION_RENDER_WIDGET_HOST_DESTROYED,
1590 NotificationService::AllBrowserContextsAndSources()); 1594 NotificationService::AllBrowserContextsAndSources());
1591 1595
1592 screen_orientation_.reset(new ScreenOrientation(this)); 1596 screen_orientation_provider_.reset(new ScreenOrientationProvider(this));
1593 1597
1594 manifest_manager_host_.reset(new ManifestManagerHost(this)); 1598 manifest_manager_host_.reset(new ManifestManagerHost(this));
1595 1599
1596 #if defined(OS_ANDROID) 1600 #if defined(OS_ANDROID)
1597 date_time_chooser_.reset(new DateTimeChooserAndroid()); 1601 date_time_chooser_.reset(new DateTimeChooserAndroid());
1598 #endif 1602 #endif
1599 1603
1600 // BrowserPluginGuest::Init needs to be called after this WebContents has 1604 // BrowserPluginGuest::Init needs to be called after this WebContents has
1601 // a RenderWidgetHostViewGuest. That is, |view_->CreateView| above. 1605 // a RenderWidgetHostViewGuest. That is, |view_->CreateView| above.
1602 if (browser_plugin_guest_) 1606 if (browser_plugin_guest_)
(...skipping 828 matching lines...) Expand 10 before | Expand all | Expand 10 after
2431 2435
2432 device::GeolocationServiceContext* 2436 device::GeolocationServiceContext*
2433 WebContentsImpl::GetGeolocationServiceContext() { 2437 WebContentsImpl::GetGeolocationServiceContext() {
2434 return geolocation_service_context_.get(); 2438 return geolocation_service_context_.get();
2435 } 2439 }
2436 2440
2437 device::WakeLockServiceContext* WebContentsImpl::GetWakeLockServiceContext() { 2441 device::WakeLockServiceContext* WebContentsImpl::GetWakeLockServiceContext() {
2438 return wake_lock_service_context_.get(); 2442 return wake_lock_service_context_.get();
2439 } 2443 }
2440 2444
2441 ScreenOrientationProvider* WebContentsImpl::GetScreenOrientationProvider() {
2442 return screen_orientation_.get()->GetScreenOrientationProvider();
2443 }
2444
2445 void WebContentsImpl::OnShowValidationMessage( 2445 void WebContentsImpl::OnShowValidationMessage(
2446 RenderViewHostImpl* source, 2446 RenderViewHostImpl* source,
2447 const gfx::Rect& anchor_in_root_view, 2447 const gfx::Rect& anchor_in_root_view,
2448 const base::string16& main_text, 2448 const base::string16& main_text,
2449 const base::string16& sub_text) { 2449 const base::string16& sub_text) {
2450 // TODO(nick): Should we consider |source| here or pass it to the delegate? 2450 // TODO(nick): Should we consider |source| here or pass it to the delegate?
2451 if (delegate_) 2451 if (delegate_)
2452 delegate_->ShowValidationMessage( 2452 delegate_->ShowValidationMessage(
2453 this, anchor_in_root_view, main_text, sub_text); 2453 this, anchor_in_root_view, main_text, sub_text);
2454 } 2454 }
(...skipping 2953 matching lines...) Expand 10 before | Expand all | Expand 10 after
5408 GetMainFrame()->AddMessageToConsole( 5408 GetMainFrame()->AddMessageToConsole(
5409 content::CONSOLE_MESSAGE_LEVEL_WARNING, 5409 content::CONSOLE_MESSAGE_LEVEL_WARNING,
5410 base::StringPrintf("This site does not have a valid SSL " 5410 base::StringPrintf("This site does not have a valid SSL "
5411 "certificate! Without SSL, your site's and " 5411 "certificate! Without SSL, your site's and "
5412 "visitors' data is vulnerable to theft and " 5412 "visitors' data is vulnerable to theft and "
5413 "tampering. Get a valid SSL certificate before" 5413 "tampering. Get a valid SSL certificate before"
5414 " releasing your website to the public.")); 5414 " releasing your website to the public."));
5415 } 5415 }
5416 5416
5417 } // namespace content 5417 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698