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

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

Issue 628773003: Partially convert geolocation IPC to Mojo. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Response to review Created 6 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 <utility> 7 #include <utility>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/debug/trace_event.h" 10 #include "base/debug/trace_event.h"
(...skipping 18 matching lines...) Expand all
29 #include "content/browser/download/download_stats.h" 29 #include "content/browser/download/download_stats.h"
30 #include "content/browser/download/mhtml_generation_manager.h" 30 #include "content/browser/download/mhtml_generation_manager.h"
31 #include "content/browser/download/save_package.h" 31 #include "content/browser/download/save_package.h"
32 #include "content/browser/frame_host/cross_process_frame_connector.h" 32 #include "content/browser/frame_host/cross_process_frame_connector.h"
33 #include "content/browser/frame_host/interstitial_page_impl.h" 33 #include "content/browser/frame_host/interstitial_page_impl.h"
34 #include "content/browser/frame_host/navigation_entry_impl.h" 34 #include "content/browser/frame_host/navigation_entry_impl.h"
35 #include "content/browser/frame_host/navigator_impl.h" 35 #include "content/browser/frame_host/navigator_impl.h"
36 #include "content/browser/frame_host/render_frame_host_impl.h" 36 #include "content/browser/frame_host/render_frame_host_impl.h"
37 #include "content/browser/frame_host/render_widget_host_view_child_frame.h" 37 #include "content/browser/frame_host/render_widget_host_view_child_frame.h"
38 #include "content/browser/geolocation/geolocation_dispatcher_host.h" 38 #include "content/browser/geolocation/geolocation_dispatcher_host.h"
39 #include "content/browser/geolocation/geolocation_service_context.h"
39 #include "content/browser/host_zoom_map_impl.h" 40 #include "content/browser/host_zoom_map_impl.h"
40 #include "content/browser/loader/resource_dispatcher_host_impl.h" 41 #include "content/browser/loader/resource_dispatcher_host_impl.h"
41 #include "content/browser/manifest/manifest_manager_host.h" 42 #include "content/browser/manifest/manifest_manager_host.h"
42 #include "content/browser/media/audio_stream_monitor.h" 43 #include "content/browser/media/audio_stream_monitor.h"
43 #include "content/browser/media/capture/web_contents_audio_muter.h" 44 #include "content/browser/media/capture/web_contents_audio_muter.h"
44 #include "content/browser/media/midi_dispatcher_host.h" 45 #include "content/browser/media/midi_dispatcher_host.h"
45 #include "content/browser/message_port_message_filter.h" 46 #include "content/browser/message_port_message_filter.h"
46 #include "content/browser/message_port_service.h" 47 #include "content/browser/message_port_service.h"
47 #include "content/browser/power_save_blocker_impl.h" 48 #include "content/browser/power_save_blocker_impl.h"
48 #include "content/browser/renderer_host/render_process_host_impl.h" 49 #include "content/browser/renderer_host/render_process_host_impl.h"
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after
328 render_frame_id(render_frame_id), 329 render_frame_id(render_frame_id),
329 chooser(chooser), 330 chooser(chooser),
330 identifier(identifier) { 331 identifier(identifier) {
331 } 332 }
332 333
333 WebContentsImpl::ColorChooserInfo::~ColorChooserInfo() { 334 WebContentsImpl::ColorChooserInfo::~ColorChooserInfo() {
334 } 335 }
335 336
336 // WebContentsImpl ------------------------------------------------------------- 337 // WebContentsImpl -------------------------------------------------------------
337 338
338 WebContentsImpl::WebContentsImpl( 339 WebContentsImpl::WebContentsImpl(BrowserContext* browser_context,
339 BrowserContext* browser_context, 340 WebContentsImpl* opener)
340 WebContentsImpl* opener)
341 : delegate_(NULL), 341 : delegate_(NULL),
342 controller_(this, browser_context), 342 controller_(this, browser_context),
343 render_view_host_delegate_view_(NULL), 343 render_view_host_delegate_view_(NULL),
344 opener_(opener), 344 opener_(opener),
345 created_with_opener_(!!opener), 345 created_with_opener_(!!opener),
346 #if defined(OS_WIN) 346 #if defined(OS_WIN)
347 accessible_parent_(NULL), 347 accessible_parent_(NULL),
348 #endif 348 #endif
349 frame_tree_(new NavigatorImpl(&controller_, this), 349 frame_tree_(new NavigatorImpl(&controller_, this),
350 this, this, this, this), 350 this,
Michael van Ouwerkerk 2014/10/09 13:11:23 Are these random formatting changes due to running
blundell 2014/10/21 12:27:49 Yep.
351 this,
352 this,
353 this),
351 is_loading_(false), 354 is_loading_(false),
352 is_load_to_different_document_(false), 355 is_load_to_different_document_(false),
353 crashed_status_(base::TERMINATION_STATUS_STILL_RUNNING), 356 crashed_status_(base::TERMINATION_STATUS_STILL_RUNNING),
354 crashed_error_code_(0), 357 crashed_error_code_(0),
355 waiting_for_response_(false), 358 waiting_for_response_(false),
356 load_state_(net::LOAD_STATE_IDLE, base::string16()), 359 load_state_(net::LOAD_STATE_IDLE, base::string16()),
357 loading_total_progress_(0.0), 360 loading_total_progress_(0.0),
358 loading_frames_in_progress_(0), 361 loading_frames_in_progress_(0),
359 upload_size_(0), 362 upload_size_(0),
360 upload_position_(0), 363 upload_position_(0),
(...skipping 10 matching lines...) Expand all
371 minimum_zoom_percent_(static_cast<int>(kMinimumZoomFactor * 100)), 374 minimum_zoom_percent_(static_cast<int>(kMinimumZoomFactor * 100)),
372 maximum_zoom_percent_(static_cast<int>(kMaximumZoomFactor * 100)), 375 maximum_zoom_percent_(static_cast<int>(kMaximumZoomFactor * 100)),
373 totalPinchGestureAmount_(0), 376 totalPinchGestureAmount_(0),
374 currentPinchZoomStepDelta_(0), 377 currentPinchZoomStepDelta_(0),
375 render_view_message_source_(NULL), 378 render_view_message_source_(NULL),
376 fullscreen_widget_routing_id_(MSG_ROUTING_NONE), 379 fullscreen_widget_routing_id_(MSG_ROUTING_NONE),
377 fullscreen_widget_had_focus_at_shutdown_(false), 380 fullscreen_widget_had_focus_at_shutdown_(false),
378 is_subframe_(false), 381 is_subframe_(false),
379 force_disable_overscroll_content_(false), 382 force_disable_overscroll_content_(false),
380 last_dialog_suppressed_(false), 383 last_dialog_suppressed_(false),
384 geolocation_context_(new GeolocationServiceContext()),
381 accessibility_mode_( 385 accessibility_mode_(
382 BrowserAccessibilityStateImpl::GetInstance()->accessibility_mode()), 386 BrowserAccessibilityStateImpl::GetInstance()->accessibility_mode()),
383 audio_stream_monitor_(this), 387 audio_stream_monitor_(this),
384 loading_weak_factory_(this) { 388 loading_weak_factory_(this) {
385 for (size_t i = 0; i < g_created_callbacks.Get().size(); i++) 389 for (size_t i = 0; i < g_created_callbacks.Get().size(); i++)
386 g_created_callbacks.Get().at(i).Run(this); 390 g_created_callbacks.Get().at(i).Run(this);
387 frame_tree_.SetFrameRemoveListener( 391 frame_tree_.SetFrameRemoveListener(
388 base::Bind(&WebContentsImpl::OnFrameRemoved, 392 base::Bind(&WebContentsImpl::OnFrameRemoved,
389 base::Unretained(this))); 393 base::Unretained(this)));
390 } 394 }
(...skipping 1449 matching lines...) Expand 10 before | Expand all | Expand 10 after
1840 int browser_plugin_instance_id) { 1844 int browser_plugin_instance_id) {
1841 BrowserPluginGuestManager* guest_manager = 1845 BrowserPluginGuestManager* guest_manager =
1842 GetBrowserContext()->GetGuestManager(); 1846 GetBrowserContext()->GetGuestManager();
1843 WebContents* guest = guest_manager->GetGuestByInstanceID( 1847 WebContents* guest = guest_manager->GetGuestByInstanceID(
1844 this, browser_plugin_instance_id); 1848 this, browser_plugin_instance_id);
1845 if (!guest) 1849 if (!guest)
1846 return NULL; 1850 return NULL;
1847 return guest->GetMainFrame(); 1851 return guest->GetMainFrame();
1848 } 1852 }
1849 1853
1854 GeolocationServiceContext* WebContentsImpl::GetGeolocationServiceContext() {
1855 return geolocation_context_.get();
1856 }
1857
1850 void WebContentsImpl::OnShowValidationMessage( 1858 void WebContentsImpl::OnShowValidationMessage(
1851 const gfx::Rect& anchor_in_root_view, 1859 const gfx::Rect& anchor_in_root_view,
1852 const base::string16& main_text, 1860 const base::string16& main_text,
1853 const base::string16& sub_text) { 1861 const base::string16& sub_text) {
1854 if (delegate_) 1862 if (delegate_)
1855 delegate_->ShowValidationMessage( 1863 delegate_->ShowValidationMessage(
1856 this, anchor_in_root_view, main_text, sub_text); 1864 this, anchor_in_root_view, main_text, sub_text);
1857 } 1865 }
1858 1866
1859 void WebContentsImpl::OnHideValidationMessage() { 1867 void WebContentsImpl::OnHideValidationMessage() {
(...skipping 2513 matching lines...) Expand 10 before | Expand all | Expand 10 after
4373 node->render_manager()->ResumeResponseDeferredAtStart(); 4381 node->render_manager()->ResumeResponseDeferredAtStart();
4374 } 4382 }
4375 4383
4376 void WebContentsImpl::SetForceDisableOverscrollContent(bool force_disable) { 4384 void WebContentsImpl::SetForceDisableOverscrollContent(bool force_disable) {
4377 force_disable_overscroll_content_ = force_disable; 4385 force_disable_overscroll_content_ = force_disable;
4378 if (view_) 4386 if (view_)
4379 view_->SetOverscrollControllerEnabled(CanOverscrollContent()); 4387 view_->SetOverscrollControllerEnabled(CanOverscrollContent());
4380 } 4388 }
4381 4389
4382 } // namespace content 4390 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698