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

Side by Side Diff: content/renderer/pepper/plugin_power_saver_helper.cc

Issue 2775963002: s/same_page/same_document for DidCommitProvisionalLoad method. (Closed)
Patch Set: Addressed review comment Created 3 years, 9 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/pepper/plugin_power_saver_helper.h" 5 #include "content/renderer/pepper/plugin_power_saver_helper.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/location.h" 10 #include "base/location.h"
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 } 42 }
43 43
44 PluginPowerSaverHelper::PluginPowerSaverHelper(RenderFrame* render_frame) 44 PluginPowerSaverHelper::PluginPowerSaverHelper(RenderFrame* render_frame)
45 : RenderFrameObserver(render_frame) {} 45 : RenderFrameObserver(render_frame) {}
46 46
47 PluginPowerSaverHelper::~PluginPowerSaverHelper() { 47 PluginPowerSaverHelper::~PluginPowerSaverHelper() {
48 } 48 }
49 49
50 void PluginPowerSaverHelper::DidCommitProvisionalLoad( 50 void PluginPowerSaverHelper::DidCommitProvisionalLoad(
51 bool is_new_navigation, 51 bool is_new_navigation,
52 bool is_same_page_navigation) { 52 bool is_same_document_navigation) {
53 blink::WebFrame* frame = render_frame()->GetWebFrame(); 53 blink::WebFrame* frame = render_frame()->GetWebFrame();
54 // Only apply to top-level and new page navigation. 54 // Only apply to top-level and new page navigation.
55 if (frame->parent() || is_same_page_navigation) 55 if (frame->parent() || is_same_document_navigation)
56 return; // Not a top-level navigation. 56 return; // Not a top-level navigation.
57 57
58 origin_whitelist_.clear(); 58 origin_whitelist_.clear();
59 } 59 }
60 60
61 bool PluginPowerSaverHelper::OnMessageReceived(const IPC::Message& message) { 61 bool PluginPowerSaverHelper::OnMessageReceived(const IPC::Message& message) {
62 bool handled = true; 62 bool handled = true;
63 IPC_BEGIN_MESSAGE_MAP(PluginPowerSaverHelper, message) 63 IPC_BEGIN_MESSAGE_MAP(PluginPowerSaverHelper, message)
64 IPC_MESSAGE_HANDLER(FrameMsg_UpdatePluginContentOriginWhitelist, 64 IPC_MESSAGE_HANDLER(FrameMsg_UpdatePluginContentOriginWhitelist,
65 OnUpdatePluginContentOriginWhitelist) 65 OnUpdatePluginContentOriginWhitelist)
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 122
123 void PluginPowerSaverHelper::WhitelistContentOrigin( 123 void PluginPowerSaverHelper::WhitelistContentOrigin(
124 const url::Origin& content_origin) { 124 const url::Origin& content_origin) {
125 if (origin_whitelist_.insert(content_origin).second) { 125 if (origin_whitelist_.insert(content_origin).second) {
126 Send(new FrameHostMsg_PluginContentOriginAllowed( 126 Send(new FrameHostMsg_PluginContentOriginAllowed(
127 render_frame()->GetRoutingID(), content_origin)); 127 render_frame()->GetRoutingID(), content_origin));
128 } 128 }
129 } 129 }
130 130
131 } // namespace content 131 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/pepper/plugin_power_saver_helper.h ('k') | content/renderer/presentation/presentation_dispatcher.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698