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

Side by Side Diff: content/renderer/render_view_impl.cc

Issue 2640143002: Allow autoplay unmuted for WebAPK in the manifest scope (Closed)
Patch Set: fixed Android build and layout tests Created 3 years, 10 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/renderer/render_view_impl.h" 5 #include "content/renderer/render_view_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <cmath> 8 #include <cmath>
9 #include <memory> 9 #include <memory>
10 10
(...skipping 577 matching lines...) Expand 10 before | Expand all | Expand 10 after
588 WebView::create(this, is_hidden() ? blink::WebPageVisibilityStateHidden 588 WebView::create(this, is_hidden() ? blink::WebPageVisibilityStateHidden
589 : blink::WebPageVisibilityStateVisible); 589 : blink::WebPageVisibilityStateVisible);
590 RenderWidget::Init(show_callback, webview_->widget()); 590 RenderWidget::Init(show_callback, webview_->widget());
591 591
592 g_view_map.Get().insert(std::make_pair(webview(), this)); 592 g_view_map.Get().insert(std::make_pair(webview(), this));
593 g_routing_id_view_map.Get().insert(std::make_pair(GetRoutingID(), this)); 593 g_routing_id_view_map.Get().insert(std::make_pair(GetRoutingID(), this));
594 594
595 const base::CommandLine& command_line = 595 const base::CommandLine& command_line =
596 *base::CommandLine::ForCurrentProcess(); 596 *base::CommandLine::ForCurrentProcess();
597 597
598 #if defined(OS_ANDROID)
599 webview()->settings()->setMediaPlaybackGestureWhitelistScope(
600 blink::WebString::fromASCII(command_line.GetSwitchValueASCII(
601 switches::kMediaPlaybackGestureWhitelistScope)));
602 #endif
mlamouri (slow - plz ping) 2017/02/10 14:28:45 Instead of having `#if defined`, could we do: ```
Zhiqiang Zhang (Slow) 2017/02/10 14:47:10 Done.
603
598 if (command_line.HasSwitch(switches::kStatsCollectionController)) 604 if (command_line.HasSwitch(switches::kStatsCollectionController))
599 stats_collection_observer_.reset(new StatsCollectionObserver(this)); 605 stats_collection_observer_.reset(new StatsCollectionObserver(this));
600 606
601 // Debug cases of https://crbug.com/575245. 607 // Debug cases of https://crbug.com/575245.
602 base::debug::SetCrashKeyValue("rvinit_view_id", 608 base::debug::SetCrashKeyValue("rvinit_view_id",
603 base::IntToString(GetRoutingID())); 609 base::IntToString(GetRoutingID()));
604 base::debug::SetCrashKeyValue("rvinit_proxy_id", 610 base::debug::SetCrashKeyValue("rvinit_proxy_id",
605 base::IntToString(params.proxy_routing_id)); 611 base::IntToString(params.proxy_routing_id));
606 base::debug::SetCrashKeyValue( 612 base::debug::SetCrashKeyValue(
607 "rvinit_main_frame_id", base::IntToString(params.main_frame_routing_id)); 613 "rvinit_main_frame_id", base::IntToString(params.main_frame_routing_id));
(...skipping 2077 matching lines...) Expand 10 before | Expand all | Expand 10 after
2685 INPUT_EVENT_ACK_STATE_NOT_CONSUMED); 2691 INPUT_EVENT_ACK_STATE_NOT_CONSUMED);
2686 } 2692 }
2687 2693
2688 std::unique_ptr<InputEventAck> ack( 2694 std::unique_ptr<InputEventAck> ack(
2689 new InputEventAck(InputEventAckSource::MAIN_THREAD, input_event->type(), 2695 new InputEventAck(InputEventAckSource::MAIN_THREAD, input_event->type(),
2690 INPUT_EVENT_ACK_STATE_NOT_CONSUMED)); 2696 INPUT_EVENT_ACK_STATE_NOT_CONSUMED));
2691 OnInputEventAck(std::move(ack)); 2697 OnInputEventAck(std::move(ack));
2692 } 2698 }
2693 2699
2694 } // namespace content 2700 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698