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

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

Issue 2338623004: Add Blink setting to block doc.written scripts on 2g-like networks (Closed)
Patch Set: Nit Created 4 years, 3 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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_frame_impl.h" 5 #include "content/renderer/render_frame_impl.h"
6 6
7 #include <map> 7 #include <map>
8 #include <string> 8 #include <string>
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
(...skipping 1053 matching lines...) Expand 10 before | Expand all | Expand 10 after
1064 push_messaging_dispatcher_(NULL), 1064 push_messaging_dispatcher_(NULL),
1065 presentation_dispatcher_(NULL), 1065 presentation_dispatcher_(NULL),
1066 screen_orientation_dispatcher_(NULL), 1066 screen_orientation_dispatcher_(NULL),
1067 manifest_manager_(NULL), 1067 manifest_manager_(NULL),
1068 accessibility_mode_(AccessibilityModeOff), 1068 accessibility_mode_(AccessibilityModeOff),
1069 render_accessibility_(NULL), 1069 render_accessibility_(NULL),
1070 media_player_delegate_(NULL), 1070 media_player_delegate_(NULL),
1071 is_using_lofi_(false), 1071 is_using_lofi_(false),
1072 effective_connection_type_( 1072 effective_connection_type_(
1073 blink::WebEffectiveConnectionType::TypeUnknown), 1073 blink::WebEffectiveConnectionType::TypeUnknown),
1074 effective_connection_type_override_(
1075 blink::WebEffectiveConnectionType::TypeUnknown),
1076 effective_connection_type_overridden_(false),
1074 is_pasting_(false), 1077 is_pasting_(false),
1075 suppress_further_dialogs_(false), 1078 suppress_further_dialogs_(false),
1076 blame_context_(nullptr), 1079 blame_context_(nullptr),
1077 #if defined(ENABLE_PLUGINS) 1080 #if defined(ENABLE_PLUGINS)
1078 focused_pepper_plugin_(nullptr), 1081 focused_pepper_plugin_(nullptr),
1079 pepper_last_mouse_event_target_(nullptr), 1082 pepper_last_mouse_event_target_(nullptr),
1080 #endif 1083 #endif
1081 frame_binding_(this), 1084 frame_binding_(this),
1082 has_accessed_initial_document_(false), 1085 has_accessed_initial_document_(false),
1083 weak_factory_(this) { 1086 weak_factory_(this) {
(...skipping 2660 matching lines...) Expand 10 before | Expand all | Expand 10 after
3744 Send(new FrameHostMsg_DidChangeThemeColor( 3747 Send(new FrameHostMsg_DidChangeThemeColor(
3745 routing_id_, frame_->document().themeColor())); 3748 routing_id_, frame_->document().themeColor()));
3746 } 3749 }
3747 3750
3748 void RenderFrameImpl::dispatchLoad() { 3751 void RenderFrameImpl::dispatchLoad() {
3749 Send(new FrameHostMsg_DispatchLoad(routing_id_)); 3752 Send(new FrameHostMsg_DispatchLoad(routing_id_));
3750 } 3753 }
3751 3754
3752 blink::WebEffectiveConnectionType 3755 blink::WebEffectiveConnectionType
3753 RenderFrameImpl::getEffectiveConnectionType() { 3756 RenderFrameImpl::getEffectiveConnectionType() {
3757 if (effective_connection_type_overridden_)
3758 return effective_connection_type_override_;
3754 return effective_connection_type_; 3759 return effective_connection_type_;
3755 } 3760 }
3756 3761
3762 void RenderFrameImpl::setEffectiveConnectionTypeOverride(
3763 blink::WebEffectiveConnectionType effective_type) {
3764 effective_connection_type_override_ = effective_type;
3765 effective_connection_type_overridden_ = true;
3766 }
3767
3768 void RenderFrameImpl::clearEffectiveConnectionTypeOverride() {
3769 effective_connection_type_overridden_ = false;
3770 }
3771
3757 void RenderFrameImpl::didChangeSelection(bool is_empty_selection) { 3772 void RenderFrameImpl::didChangeSelection(bool is_empty_selection) {
3758 if (!GetRenderWidget()->input_handler().handling_input_event() && 3773 if (!GetRenderWidget()->input_handler().handling_input_event() &&
3759 !handling_select_range_) 3774 !handling_select_range_)
3760 return; 3775 return;
3761 3776
3762 if (is_empty_selection) 3777 if (is_empty_selection)
3763 selection_text_.clear(); 3778 selection_text_.clear();
3764 3779
3765 // UpdateTextInputState should be called before SyncSelectionIfRequired. 3780 // UpdateTextInputState should be called before SyncSelectionIfRequired.
3766 // UpdateTextInputState may send TextInputStateChanged to notify the focus 3781 // UpdateTextInputState may send TextInputStateChanged to notify the focus
(...skipping 2598 matching lines...) Expand 10 before | Expand all | Expand 10 after
6365 // event target. Potentially a Pepper plugin will receive the event. 6380 // event target. Potentially a Pepper plugin will receive the event.
6366 // In order to tell whether a plugin gets the last mouse event and which it 6381 // In order to tell whether a plugin gets the last mouse event and which it
6367 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets 6382 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets
6368 // the event, it will notify us via DidReceiveMouseEvent() and set itself as 6383 // the event, it will notify us via DidReceiveMouseEvent() and set itself as
6369 // |pepper_last_mouse_event_target_|. 6384 // |pepper_last_mouse_event_target_|.
6370 pepper_last_mouse_event_target_ = nullptr; 6385 pepper_last_mouse_event_target_ = nullptr;
6371 #endif 6386 #endif
6372 } 6387 }
6373 6388
6374 } // namespace content 6389 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698