| OLD | NEW |
| 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 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 #include "content/browser/web_contents/web_contents_android.h" | 129 #include "content/browser/web_contents/web_contents_android.h" |
| 130 #endif // OS_ANDROID && !USE_AURA | 130 #endif // OS_ANDROID && !USE_AURA |
| 131 | 131 |
| 132 #if defined(OS_MACOSX) | 132 #if defined(OS_MACOSX) |
| 133 #include "base/mac/foundation_util.h" | 133 #include "base/mac/foundation_util.h" |
| 134 #endif | 134 #endif |
| 135 | 135 |
| 136 #if defined(MOJO_SHELL_CLIENT) | 136 #if defined(MOJO_SHELL_CLIENT) |
| 137 #include "content/browser/web_contents/web_contents_view_mus.h" | 137 #include "content/browser/web_contents/web_contents_view_mus.h" |
| 138 #include "content/public/common/mojo_shell_connection.h" | 138 #include "content/public/common/mojo_shell_connection.h" |
| 139 #include "ui/aura/mus/mus_util.h" |
| 139 #endif | 140 #endif |
| 140 | 141 |
| 141 namespace content { | 142 namespace content { |
| 142 namespace { | 143 namespace { |
| 143 | 144 |
| 144 const int kMinimumDelayBetweenLoadingUpdatesMS = 100; | 145 const int kMinimumDelayBetweenLoadingUpdatesMS = 100; |
| 145 const char kDotGoogleDotCom[] = ".google.com"; | 146 const char kDotGoogleDotCom[] = ".google.com"; |
| 146 | 147 |
| 147 #if defined(OS_ANDROID) | 148 #if defined(OS_ANDROID) |
| 148 const char kWebContentsAndroidKey[] = "web_contents_android"; | 149 const char kWebContentsAndroidKey[] = "web_contents_android"; |
| (...skipping 1223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 mus::Window* window = aura::GetMusWindow(params.context); |
| 1383 &render_view_host_delegate_view_)); | 1384 if (window) { |
| 1385 view_.reset(new WebContentsViewMus(this, window, view_.Pass(), |
| 1386 &render_view_host_delegate_view_)); |
| 1387 } |
| 1384 } | 1388 } |
| 1385 #endif | 1389 #endif |
| 1386 | 1390 |
| 1387 CHECK(render_view_host_delegate_view_); | 1391 CHECK(render_view_host_delegate_view_); |
| 1388 CHECK(view_.get()); | 1392 CHECK(view_.get()); |
| 1389 | 1393 |
| 1390 gfx::Size initial_size = params.initial_size; | 1394 gfx::Size initial_size = params.initial_size; |
| 1391 view_->CreateView(initial_size, params.context); | 1395 view_->CreateView(initial_size, params.context); |
| 1392 | 1396 |
| 1393 #if defined(ENABLE_PLUGINS) | 1397 #if defined(ENABLE_PLUGINS) |
| (...skipping 3395 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4789 return NULL; | 4793 return NULL; |
| 4790 } | 4794 } |
| 4791 | 4795 |
| 4792 void WebContentsImpl::SetForceDisableOverscrollContent(bool force_disable) { | 4796 void WebContentsImpl::SetForceDisableOverscrollContent(bool force_disable) { |
| 4793 force_disable_overscroll_content_ = force_disable; | 4797 force_disable_overscroll_content_ = force_disable; |
| 4794 if (view_) | 4798 if (view_) |
| 4795 view_->SetOverscrollControllerEnabled(CanOverscrollContent()); | 4799 view_->SetOverscrollControllerEnabled(CanOverscrollContent()); |
| 4796 } | 4800 } |
| 4797 | 4801 |
| 4798 } // namespace content | 4802 } // namespace content |
| OLD | NEW |