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

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

Issue 1461243002: [OLD ATTEMPT, DO NOT REVIEW] mustash: Enable connections to mus from the Chrome renderer Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed Ben's comments 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/lazy_instance.h" 10 #include "base/lazy_instance.h"
(...skipping 516 matching lines...) Expand 10 before | Expand all | Expand 10 after
527 new_contents->created_with_opener_ = true; 527 new_contents->created_with_opener_ = true;
528 528
529 if (params.guest_delegate) { 529 if (params.guest_delegate) {
530 // This makes |new_contents| act as a guest. 530 // This makes |new_contents| act as a guest.
531 // For more info, see comment above class BrowserPluginGuest. 531 // For more info, see comment above class BrowserPluginGuest.
532 BrowserPluginGuest::Create(new_contents, params.guest_delegate); 532 BrowserPluginGuest::Create(new_contents, params.guest_delegate);
533 // We are instantiating a WebContents for browser plugin. Set its subframe 533 // We are instantiating a WebContents for browser plugin. Set its subframe
534 // bit to true. 534 // bit to true.
535 new_contents->is_subframe_ = true; 535 new_contents->is_subframe_ = true;
536 } 536 }
537
537 new_contents->Init(params); 538 new_contents->Init(params);
538 return new_contents; 539 return new_contents;
539 } 540 }
540 541
541 // static 542 // static
542 std::vector<WebContentsImpl*> WebContentsImpl::GetAllWebContents() { 543 std::vector<WebContentsImpl*> WebContentsImpl::GetAllWebContents() {
543 std::vector<WebContentsImpl*> result; 544 std::vector<WebContentsImpl*> result;
544 scoped_ptr<RenderWidgetHostIterator> widgets( 545 scoped_ptr<RenderWidgetHostIterator> widgets(
545 RenderWidgetHostImpl::GetRenderWidgetHosts()); 546 RenderWidgetHostImpl::GetRenderWidgetHosts());
546 while (RenderWidgetHost* rwh = widgets->GetNextHost()) { 547 while (RenderWidgetHost* rwh = widgets->GetNextHost()) {
(...skipping 824 matching lines...) Expand 10 before | Expand all | Expand 10 after
1371 if (browser_plugin_guest_ && 1372 if (browser_plugin_guest_ &&
1372 !BrowserPluginGuestMode::UseCrossProcessFramesForGuests()) { 1373 !BrowserPluginGuestMode::UseCrossProcessFramesForGuests()) {
1373 view_.reset(new WebContentsViewGuest(this, browser_plugin_guest_.get(), 1374 view_.reset(new WebContentsViewGuest(this, browser_plugin_guest_.get(),
1374 view_.Pass(), 1375 view_.Pass(),
1375 &render_view_host_delegate_view_)); 1376 &render_view_host_delegate_view_));
1376 } 1377 }
1377 1378
1378 #if defined(MOJO_SHELL_CLIENT) 1379 #if defined(MOJO_SHELL_CLIENT)
1379 if (MojoShellConnection::Get() && 1380 if (MojoShellConnection::Get() &&
1380 base::CommandLine::ForCurrentProcess()->HasSwitch( 1381 base::CommandLine::ForCurrentProcess()->HasSwitch(
1381 switches::kUseMusInRenderer)) { 1382 switches::kUseMusInRenderer) &&
1382 view_.reset(new WebContentsViewMus(this, view_.Pass(), 1383 params.mus_window) {
1384 view_.reset(new WebContentsViewMus(this, params.mus_window, view_.Pass(),
1383 &render_view_host_delegate_view_)); 1385 &render_view_host_delegate_view_));
1384 } 1386 }
1385 #endif 1387 #endif
1386 1388
1387 CHECK(render_view_host_delegate_view_); 1389 CHECK(render_view_host_delegate_view_);
1388 CHECK(view_.get()); 1390 CHECK(view_.get());
1389 1391
1390 gfx::Size initial_size = params.initial_size; 1392 gfx::Size initial_size = params.initial_size;
1391 view_->CreateView(initial_size, params.context); 1393 view_->CreateView(initial_size, params.context);
1392 1394
(...skipping 3396 matching lines...) Expand 10 before | Expand all | Expand 10 after
4789 return NULL; 4791 return NULL;
4790 } 4792 }
4791 4793
4792 void WebContentsImpl::SetForceDisableOverscrollContent(bool force_disable) { 4794 void WebContentsImpl::SetForceDisableOverscrollContent(bool force_disable) {
4793 force_disable_overscroll_content_ = force_disable; 4795 force_disable_overscroll_content_ = force_disable;
4794 if (view_) 4796 if (view_)
4795 view_->SetOverscrollControllerEnabled(CanOverscrollContent()); 4797 view_->SetOverscrollControllerEnabled(CanOverscrollContent());
4796 } 4798 }
4797 4799
4798 } // namespace content 4800 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698