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

Side by Side Diff: content/browser/renderer_host/render_view_host_impl.cc

Issue 785723002: Add new extension APIs related to animation policy. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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/renderer_host/render_view_host_impl.h" 5 #include "content/browser/renderer_host/render_view_host_impl.h"
6 6
7 #include <set> 7 #include <set>
8 #include <string> 8 #include <string>
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
11 11
12 #include "base/callback.h" 12 #include "base/callback.h"
13 #include "base/command_line.h" 13 #include "base/command_line.h"
14 #include "base/debug/trace_event.h" 14 #include "base/debug/trace_event.h"
15 #include "base/i18n/rtl.h" 15 #include "base/i18n/rtl.h"
16 #include "base/json/json_reader.h" 16 #include "base/json/json_reader.h"
17 #include "base/message_loop/message_loop.h" 17 #include "base/message_loop/message_loop.h"
18 #include "base/metrics/field_trial.h" 18 #include "base/metrics/field_trial.h"
19 #include "base/metrics/histogram.h" 19 #include "base/metrics/histogram.h"
20 #include "base/stl_util.h" 20 #include "base/stl_util.h"
21 #include "base/strings/string_util.h" 21 #include "base/strings/string_util.h"
22 #include "base/strings/utf_string_conversions.h" 22 #include "base/strings/utf_string_conversions.h"
23 #include "base/sys_info.h" 23 #include "base/sys_info.h"
24 #include "base/time/time.h" 24 #include "base/time/time.h"
25 #include "base/values.h" 25 #include "base/values.h"
26 #include "cc/base/switches.h" 26 #include "cc/base/switches.h"
27 #include "content/browser/accessibility/browser_accessibility_state_impl.h"
27 #include "content/browser/child_process_security_policy_impl.h" 28 #include "content/browser/child_process_security_policy_impl.h"
28 #include "content/browser/dom_storage/session_storage_namespace_impl.h" 29 #include "content/browser/dom_storage/session_storage_namespace_impl.h"
29 #include "content/browser/frame_host/frame_tree.h" 30 #include "content/browser/frame_host/frame_tree.h"
30 #include "content/browser/gpu/compositor_util.h" 31 #include "content/browser/gpu/compositor_util.h"
31 #include "content/browser/gpu/gpu_data_manager_impl.h" 32 #include "content/browser/gpu/gpu_data_manager_impl.h"
32 #include "content/browser/gpu/gpu_process_host.h" 33 #include "content/browser/gpu/gpu_process_host.h"
33 #include "content/browser/gpu/gpu_surface_tracker.h" 34 #include "content/browser/gpu/gpu_surface_tracker.h"
34 #include "content/browser/host_zoom_map_impl.h" 35 #include "content/browser/host_zoom_map_impl.h"
35 #include "content/browser/loader/resource_dispatcher_host_impl.h" 36 #include "content/browser/loader/resource_dispatcher_host_impl.h"
36 #include "content/browser/renderer_host/dip_util.h" 37 #include "content/browser/renderer_host/dip_util.h"
(...skipping 474 matching lines...) Expand 10 before | Expand all | Expand 10 after
511 } else { 512 } else {
512 prefs.v8_cache_options = V8_CACHE_OPTIONS_DEFAULT; 513 prefs.v8_cache_options = V8_CACHE_OPTIONS_DEFAULT;
513 } 514 }
514 515
515 // TODO(marja): Clean up preferences + command line flag after streaming has 516 // TODO(marja): Clean up preferences + command line flag after streaming has
516 // launched in stable. 517 // launched in stable.
517 prefs.v8_script_streaming_enabled = true; 518 prefs.v8_script_streaming_enabled = true;
518 prefs.v8_script_streaming_mode = 519 prefs.v8_script_streaming_mode =
519 V8_SCRIPT_STREAMING_MODE_ONLY_ASYNC_AND_DEFER; 520 V8_SCRIPT_STREAMING_MODE_ONLY_ASYNC_AND_DEFER;
520 521
522 std::string image_animation_policy =
523 BrowserAccessibilityStateImpl::GetInstance()->GetImageAnimationPolicy();
524 if (image_animation_policy == "Allowed")
525 prefs.animation_policy = IMAGE_ANIMATION_POLICY_ALLOWED;
dmazzoni 2014/12/08 07:46:01 nit: just 2 spaces indent for an "if" block. (Line
526 else if (image_animation_policy == "Once")
527 prefs.animation_policy = IMAGE_ANIMATION_POLICY_ANIMATION_ONCE;
528 else if (image_animation_policy == "None")
529 prefs.animation_policy = IMAGE_ANIMATION_POLICY_NO_ANIMATION;
530
521 GetContentClient()->browser()->OverrideWebkitPrefs(this, url, &prefs); 531 GetContentClient()->browser()->OverrideWebkitPrefs(this, url, &prefs);
522 return prefs; 532 return prefs;
523 } 533 }
524 534
525 void RenderViewHostImpl::SuppressDialogsUntilSwapOut() { 535 void RenderViewHostImpl::SuppressDialogsUntilSwapOut() {
526 Send(new ViewMsg_SuppressDialogsUntilSwapOut(GetRoutingID())); 536 Send(new ViewMsg_SuppressDialogsUntilSwapOut(GetRoutingID()));
527 } 537 }
528 538
529 void RenderViewHostImpl::ClosePage() { 539 void RenderViewHostImpl::ClosePage() {
530 is_waiting_for_close_ack_ = true; 540 is_waiting_for_close_ack_ = true;
(...skipping 953 matching lines...) Expand 10 before | Expand all | Expand 10 after
1484 FrameTree* frame_tree = delegate_->GetFrameTree(); 1494 FrameTree* frame_tree = delegate_->GetFrameTree();
1485 1495
1486 frame_tree->ResetForMainFrameSwap(); 1496 frame_tree->ResetForMainFrameSwap();
1487 } 1497 }
1488 1498
1489 void RenderViewHostImpl::SelectWordAroundCaret() { 1499 void RenderViewHostImpl::SelectWordAroundCaret() {
1490 Send(new ViewMsg_SelectWordAroundCaret(GetRoutingID())); 1500 Send(new ViewMsg_SelectWordAroundCaret(GetRoutingID()));
1491 } 1501 }
1492 1502
1493 } // namespace content 1503 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698