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

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

Issue 9147026: API for connection type (Ethernet/WIFI/WWAN ...) in NetworkChangeNotifier. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: sync Created 8 years, 7 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/metrics/histogram.h" 10 #include "base/metrics/histogram.h"
(...skipping 489 matching lines...) Expand 10 before | Expand all | Expand 10 after
500 prefs.accelerated_layers_enabled = false; 500 prefs.accelerated_layers_enabled = false;
501 } 501 }
502 } 502 }
503 503
504 if (ChildProcessSecurityPolicyImpl::GetInstance()->HasWebUIBindings( 504 if (ChildProcessSecurityPolicyImpl::GetInstance()->HasWebUIBindings(
505 rvh->GetProcess()->GetID())) { 505 rvh->GetProcess()->GetID())) {
506 prefs.loads_images_automatically = true; 506 prefs.loads_images_automatically = true;
507 prefs.javascript_enabled = true; 507 prefs.javascript_enabled = true;
508 } 508 }
509 509
510 prefs.is_online = !net::NetworkChangeNotifier::IsOffline(); 510 prefs.is_online = net::NetworkChangeNotifier::ConnectionType() !=
511 net::NetworkChangeNotifier::CONNECTION_NONE;
511 512
512 // Force accelerated compositing and 2d canvas off for chrome:, about: and 513 // Force accelerated compositing and 2d canvas off for chrome:, about: and
513 // chrome-devtools: pages (unless it's specifically allowed). 514 // chrome-devtools: pages (unless it's specifically allowed).
514 if ((url.SchemeIs(chrome::kChromeDevToolsScheme) || 515 if ((url.SchemeIs(chrome::kChromeDevToolsScheme) ||
515 url.SchemeIs(chrome::kChromeUIScheme) || 516 url.SchemeIs(chrome::kChromeUIScheme) ||
516 (url.SchemeIs(chrome::kAboutScheme) && 517 (url.SchemeIs(chrome::kAboutScheme) &&
517 url.spec() != chrome::kAboutBlankURL)) && 518 url.spec() != chrome::kAboutBlankURL)) &&
518 !command_line.HasSwitch(switches::kAllowWebUICompositing)) { 519 !command_line.HasSwitch(switches::kAllowWebUICompositing)) {
519 prefs.accelerated_compositing_enabled = false; 520 prefs.accelerated_compositing_enabled = false;
520 prefs.accelerated_2d_canvas_enabled = false; 521 prefs.accelerated_2d_canvas_enabled = false;
(...skipping 2208 matching lines...) Expand 10 before | Expand all | Expand 10 after
2729 void WebContentsImpl::CreateViewAndSetSizeForRVH(RenderViewHost* rvh) { 2730 void WebContentsImpl::CreateViewAndSetSizeForRVH(RenderViewHost* rvh) {
2730 RenderWidgetHostView* rwh_view = GetView()->CreateViewForWidget(rvh); 2731 RenderWidgetHostView* rwh_view = GetView()->CreateViewForWidget(rvh);
2731 // Can be NULL during tests. 2732 // Can be NULL during tests.
2732 if (rwh_view) 2733 if (rwh_view)
2733 rwh_view->SetSize(GetView()->GetContainerSize()); 2734 rwh_view->SetSize(GetView()->GetContainerSize());
2734 } 2735 }
2735 2736
2736 RenderViewHostImpl* WebContentsImpl::GetRenderViewHostImpl() { 2737 RenderViewHostImpl* WebContentsImpl::GetRenderViewHostImpl() {
2737 return static_cast<RenderViewHostImpl*>(GetRenderViewHost()); 2738 return static_cast<RenderViewHostImpl*>(GetRenderViewHost());
2738 } 2739 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698