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

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

Issue 1476643002: mustash: Enable connections to mus from the Chrome renderer [take 2] (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: RenderWidgetMus => RenderWidgetMusConnection Created 5 years 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/stack_trace.h"
Ben Goodger (Google) 2015/11/25 04:07:28 remove
Fady Samuel 2015/11/25 17:45:52 Done.
10 #include "base/lazy_instance.h" 11 #include "base/lazy_instance.h"
11 #include "base/location.h" 12 #include "base/location.h"
12 #include "base/logging.h" 13 #include "base/logging.h"
13 #include "base/metrics/histogram.h" 14 #include "base/metrics/histogram.h"
14 #include "base/process/process.h" 15 #include "base/process/process.h"
15 #include "base/profiler/scoped_tracker.h" 16 #include "base/profiler/scoped_tracker.h"
16 #include "base/single_thread_task_runner.h" 17 #include "base/single_thread_task_runner.h"
17 #include "base/strings/string16.h" 18 #include "base/strings/string16.h"
18 #include "base/strings/string_number_conversions.h" 19 #include "base/strings/string_number_conversions.h"
19 #include "base/strings/string_util.h" 20 #include "base/strings/string_util.h"
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 #if defined(OS_ANDROID) && !defined(USE_AURA) 128 #if defined(OS_ANDROID) && !defined(USE_AURA)
128 #include "content/browser/android/date_time_chooser_android.h" 129 #include "content/browser/android/date_time_chooser_android.h"
129 #include "content/browser/web_contents/web_contents_android.h" 130 #include "content/browser/web_contents/web_contents_android.h"
130 #endif // OS_ANDROID && !USE_AURA 131 #endif // OS_ANDROID && !USE_AURA
131 132
132 #if defined(OS_MACOSX) 133 #if defined(OS_MACOSX)
133 #include "base/mac/foundation_util.h" 134 #include "base/mac/foundation_util.h"
134 #endif 135 #endif
135 136
136 #if defined(MOJO_SHELL_CLIENT) 137 #if defined(MOJO_SHELL_CLIENT)
138 #include "content/browser/mus_util.h"
137 #include "content/browser/web_contents/web_contents_view_mus.h" 139 #include "content/browser/web_contents/web_contents_view_mus.h"
138 #include "content/public/common/mojo_shell_connection.h" 140 #include "content/public/common/mojo_shell_connection.h"
139 #endif 141 #endif
140 142
141 namespace content { 143 namespace content {
142 namespace { 144 namespace {
143 145
144 const int kMinimumDelayBetweenLoadingUpdatesMS = 100; 146 const int kMinimumDelayBetweenLoadingUpdatesMS = 100;
145 const char kDotGoogleDotCom[] = ".google.com"; 147 const char kDotGoogleDotCom[] = ".google.com";
146 148
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after
410 page_scale_factor_is_one_(true), 412 page_scale_factor_is_one_(true),
411 loading_weak_factory_(this) { 413 loading_weak_factory_(this) {
412 frame_tree_.SetFrameRemoveListener( 414 frame_tree_.SetFrameRemoveListener(
413 base::Bind(&WebContentsImpl::OnFrameRemoved, 415 base::Bind(&WebContentsImpl::OnFrameRemoved,
414 base::Unretained(this))); 416 base::Unretained(this)));
415 #if defined(ENABLE_BROWSER_CDMS) 417 #if defined(ENABLE_BROWSER_CDMS)
416 media_web_contents_observer_.reset(new MediaWebContentsObserver(this)); 418 media_web_contents_observer_.reset(new MediaWebContentsObserver(this));
417 #endif 419 #endif
418 420
419 wake_lock_service_context_.reset(new WakeLockServiceContext(this)); 421 wake_lock_service_context_.reset(new WakeLockServiceContext(this));
422 // base::debug::StackTrace().Print();
Ben Goodger (Google) 2015/11/25 04:07:28 remove
Fady Samuel 2015/11/25 17:45:52 Done.
420 } 423 }
421 424
422 WebContentsImpl::~WebContentsImpl() { 425 WebContentsImpl::~WebContentsImpl() {
423 is_being_destroyed_ = true; 426 is_being_destroyed_ = true;
424 427
425 rwh_input_event_router_.reset(); 428 rwh_input_event_router_.reset();
426 429
427 // Delete all RFH pending shutdown, which will lead the corresponding RVH to 430 // Delete all RFH pending shutdown, which will lead the corresponding RVH to
428 // shutdown and be deleted as well. 431 // shutdown and be deleted as well.
429 frame_tree_.ForEach( 432 frame_tree_.ForEach(
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
527 new_contents->created_with_opener_ = true; 530 new_contents->created_with_opener_ = true;
528 531
529 if (params.guest_delegate) { 532 if (params.guest_delegate) {
530 // This makes |new_contents| act as a guest. 533 // This makes |new_contents| act as a guest.
531 // For more info, see comment above class BrowserPluginGuest. 534 // For more info, see comment above class BrowserPluginGuest.
532 BrowserPluginGuest::Create(new_contents, params.guest_delegate); 535 BrowserPluginGuest::Create(new_contents, params.guest_delegate);
533 // We are instantiating a WebContents for browser plugin. Set its subframe 536 // We are instantiating a WebContents for browser plugin. Set its subframe
534 // bit to true. 537 // bit to true.
535 new_contents->is_subframe_ = true; 538 new_contents->is_subframe_ = true;
536 } 539 }
540
Ben Goodger (Google) 2015/11/25 04:07:28 undo
Fady Samuel 2015/11/25 17:45:52 Done.
537 new_contents->Init(params); 541 new_contents->Init(params);
538 return new_contents; 542 return new_contents;
539 } 543 }
540 544
541 // static 545 // static
542 std::vector<WebContentsImpl*> WebContentsImpl::GetAllWebContents() { 546 std::vector<WebContentsImpl*> WebContentsImpl::GetAllWebContents() {
543 std::vector<WebContentsImpl*> result; 547 std::vector<WebContentsImpl*> result;
544 scoped_ptr<RenderWidgetHostIterator> widgets( 548 scoped_ptr<RenderWidgetHostIterator> widgets(
545 RenderWidgetHostImpl::GetRenderWidgetHosts()); 549 RenderWidgetHostImpl::GetRenderWidgetHosts());
546 while (RenderWidgetHost* rwh = widgets->GetNextHost()) { 550 while (RenderWidgetHost* rwh = widgets->GetNextHost()) {
(...skipping 825 matching lines...) Expand 10 before | Expand all | Expand 10 after
1372 !BrowserPluginGuestMode::UseCrossProcessFramesForGuests()) { 1376 !BrowserPluginGuestMode::UseCrossProcessFramesForGuests()) {
1373 view_.reset(new WebContentsViewGuest(this, browser_plugin_guest_.get(), 1377 view_.reset(new WebContentsViewGuest(this, browser_plugin_guest_.get(),
1374 view_.Pass(), 1378 view_.Pass(),
1375 &render_view_host_delegate_view_)); 1379 &render_view_host_delegate_view_));
1376 } 1380 }
1377 1381
1378 #if defined(MOJO_SHELL_CLIENT) 1382 #if defined(MOJO_SHELL_CLIENT)
1379 if (MojoShellConnection::Get() && 1383 if (MojoShellConnection::Get() &&
1380 base::CommandLine::ForCurrentProcess()->HasSwitch( 1384 base::CommandLine::ForCurrentProcess()->HasSwitch(
1381 switches::kUseMusInRenderer)) { 1385 switches::kUseMusInRenderer)) {
1382 view_.reset(new WebContentsViewMus(this, view_.Pass(), 1386 mus::Window* window = GetMusWindow(params.context);
1383 &render_view_host_delegate_view_)); 1387 if (window) {
1388 view_.reset(new WebContentsViewMus(this, window, view_.Pass(),
1389 &render_view_host_delegate_view_));
1390 }
1384 } 1391 }
1385 #endif 1392 #endif
1386 1393
1387 CHECK(render_view_host_delegate_view_); 1394 CHECK(render_view_host_delegate_view_);
1388 CHECK(view_.get()); 1395 CHECK(view_.get());
1389 1396
1390 gfx::Size initial_size = params.initial_size; 1397 gfx::Size initial_size = params.initial_size;
1391 view_->CreateView(initial_size, params.context); 1398 view_->CreateView(initial_size, params.context);
1392 1399
1393 #if defined(ENABLE_PLUGINS) 1400 #if defined(ENABLE_PLUGINS)
(...skipping 3395 matching lines...) Expand 10 before | Expand all | Expand 10 after
4789 return NULL; 4796 return NULL;
4790 } 4797 }
4791 4798
4792 void WebContentsImpl::SetForceDisableOverscrollContent(bool force_disable) { 4799 void WebContentsImpl::SetForceDisableOverscrollContent(bool force_disable) {
4793 force_disable_overscroll_content_ = force_disable; 4800 force_disable_overscroll_content_ = force_disable;
4794 if (view_) 4801 if (view_)
4795 view_->SetOverscrollControllerEnabled(CanOverscrollContent()); 4802 view_->SetOverscrollControllerEnabled(CanOverscrollContent());
4796 } 4803 }
4797 4804
4798 } // namespace content 4805 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698