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

Unified Diff: content/renderer/render_frame_impl.cc

Issue 2512563003: Convert enable_plugins to a buildflag header. (Closed)
Patch Set: Merge Created 4 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/renderer/render_frame_impl.h ('k') | content/renderer/render_thread_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/render_frame_impl.cc
diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc
index 23a4d618fd4ade7b544bf182a765852b671f7653..a2aa24823df853696c6fbc9447b7c03a4cd933bc 100644
--- a/content/renderer/render_frame_impl.cc
+++ b/content/renderer/render_frame_impl.cc
@@ -209,7 +209,7 @@
#include "url/url_constants.h"
#include "url/url_util.h"
-#if defined(ENABLE_PLUGINS)
+#if BUILDFLAG(ENABLE_PLUGINS)
#include "content/renderer/pepper/pepper_browser_connection.h"
#include "content/renderer/pepper/pepper_plugin_instance_impl.h"
#include "content/renderer/pepper/pepper_plugin_registry.h"
@@ -1082,7 +1082,7 @@ RenderFrameImpl::RenderFrameImpl(const CreateParams& params)
render_view_(params.render_view),
routing_id_(params.routing_id),
proxy_routing_id_(MSG_ROUTING_NONE),
-#if defined(ENABLE_PLUGINS)
+#if BUILDFLAG(ENABLE_PLUGINS)
plugin_power_saver_helper_(nullptr),
plugin_find_handler_(nullptr),
#endif
@@ -1110,7 +1110,7 @@ RenderFrameImpl::RenderFrameImpl(const CreateParams& params)
is_pasting_(false),
suppress_further_dialogs_(false),
blame_context_(nullptr),
-#if defined(ENABLE_PLUGINS)
+#if BUILDFLAG(ENABLE_PLUGINS)
focused_pepper_plugin_(nullptr),
pepper_last_mouse_event_target_(nullptr),
#endif
@@ -1147,7 +1147,7 @@ RenderFrameImpl::RenderFrameImpl(const CreateParams& params)
new GinJavaBridgeDispatcher(this);
#endif
-#if defined(ENABLE_PLUGINS)
+#if BUILDFLAG(ENABLE_PLUGINS)
// Manages its own lifetime.
plugin_power_saver_helper_ = new PluginPowerSaverHelper(this);
#endif
@@ -1237,7 +1237,7 @@ void RenderFrameImpl::Initialize() {
MaybeEnableMojoBindings();
-#if defined(ENABLE_PLUGINS)
+#if BUILDFLAG(ENABLE_PLUGINS)
new PepperBrowserConnection(this);
#endif
new SharedWorkerRepository(this);
@@ -1280,7 +1280,7 @@ RenderWidget* RenderFrameImpl::GetRenderWidget() {
return local_root->render_widget_.get();
}
-#if defined(ENABLE_PLUGINS)
+#if BUILDFLAG(ENABLE_PLUGINS)
void RenderFrameImpl::PepperPluginCreated(RendererPpapiHost* host) {
for (auto& observer : observers_)
observer.DidCreatePepperPlugin(host);
@@ -1435,7 +1435,7 @@ void RenderFrameImpl::OnImeFinishComposingText(bool keep_selection) {
const base::string16& text = pepper_composition_text_;
HandlePepperImeCommit(text);
}
-#endif // defined(ENABLE_PLUGINS)
+#endif // BUILDFLAG(ENABLE_PLUGINS)
MediaStreamDispatcher* RenderFrameImpl::GetMediaStreamDispatcher() {
if (!web_user_media_client_)
@@ -1499,7 +1499,7 @@ bool RenderFrameImpl::OnMessageReceived(const IPC::Message& msg) {
IPC_MESSAGE_HANDLER(FrameMsg_ContextMenuClosed, OnContextMenuClosed)
IPC_MESSAGE_HANDLER(FrameMsg_CustomContextMenuAction,
OnCustomContextMenuAction)
-#if defined(ENABLE_PLUGINS)
+#if BUILDFLAG(ENABLE_PLUGINS)
IPC_MESSAGE_HANDLER(FrameMsg_SetPepperVolume, OnSetPepperVolume)
#endif
IPC_MESSAGE_HANDLER(InputMsg_Undo, OnUndo)
@@ -2389,7 +2389,7 @@ void RenderFrameImpl::DidCommitCompositorFrame() {
}
void RenderFrameImpl::DidCommitAndDrawCompositorFrame() {
-#if defined(ENABLE_PLUGINS)
+#if BUILDFLAG(ENABLE_PLUGINS)
// Notify all instances that we painted. The same caveats apply as for
// ViewFlushedPaint regarding instances closing themselves, so we take
// similar precautions.
@@ -2448,7 +2448,7 @@ blink::WebPlugin* RenderFrameImpl::CreatePlugin(
const blink::WebPluginParams& params,
std::unique_ptr<content::PluginInstanceThrottler> throttler) {
DCHECK_EQ(frame_, frame);
-#if defined(ENABLE_PLUGINS)
+#if BUILDFLAG(ENABLE_PLUGINS)
if (info.type == WebPluginInfo::PLUGIN_TYPE_BROWSER_PLUGIN) {
return BrowserPluginManager::Get()->CreateBrowserPlugin(
this, GetContentClient()
@@ -2519,7 +2519,7 @@ RenderFrameImpl::GetRemoteAssociatedInterfaces() {
return remote_associated_interfaces_.get();
}
-#if defined(ENABLE_PLUGINS)
+#if BUILDFLAG(ENABLE_PLUGINS)
void RenderFrameImpl::RegisterPeripheralPlugin(
const url::Origin& content_origin,
const base::Closure& unthrottle_callback) {
@@ -2549,7 +2549,7 @@ void RenderFrameImpl::DidStartLoading() {
void RenderFrameImpl::DidStopLoading() {
didStopLoading();
}
-#endif // defined(ENABLE_PLUGINS)
+#endif // BUILDFLAG(ENABLE_PLUGINS)
bool RenderFrameImpl::IsFTPDirectoryListing() {
WebURLResponseExtraDataImpl* extra_data =
@@ -2686,7 +2686,7 @@ blink::WebPlugin* RenderFrameImpl::createPlugin(
->GetWeakPtr());
}
-#if defined(ENABLE_PLUGINS)
+#if BUILDFLAG(ENABLE_PLUGINS)
WebPluginInfo info;
std::string mime_type;
bool found = false;
@@ -2701,7 +2701,7 @@ blink::WebPlugin* RenderFrameImpl::createPlugin(
return CreatePlugin(frame, info, params_to_use, nullptr /* throttler */);
#else
return NULL;
-#endif // defined(ENABLE_PLUGINS)
+#endif // BUILDFLAG(ENABLE_PLUGINS)
}
#if BUILDFLAG(ENABLE_MEDIA_REMOTING)
@@ -3010,7 +3010,7 @@ void RenderFrameImpl::frameDetached(blink::WebLocalFrame* frame,
// called on the parent frame.
DCHECK_EQ(frame_, frame);
-#if defined(ENABLE_PLUGINS)
+#if BUILDFLAG(ENABLE_PLUGINS)
if (focused_pepper_plugin_)
GetRenderWidget()->set_focused_pepper_plugin(nullptr);
#endif
@@ -4645,7 +4645,7 @@ void RenderFrameImpl::WasHidden() {
for (auto& observer : observers_)
observer.WasHidden();
-#if defined(ENABLE_PLUGINS)
+#if BUILDFLAG(ENABLE_PLUGINS)
for (auto* plugin : active_pepper_instances_)
plugin->PageVisibilityChanged(false);
#endif // ENABLE_PLUGINS
@@ -4659,7 +4659,7 @@ void RenderFrameImpl::WasShown() {
for (auto& observer : observers_)
observer.WasShown();
-#if defined(ENABLE_PLUGINS)
+#if BUILDFLAG(ENABLE_PLUGINS)
for (auto* plugin : active_pepper_instances_)
plugin->PageVisibilityChanged(true);
#endif // ENABLE_PLUGINS
@@ -5909,7 +5909,7 @@ void RenderFrameImpl::SyncSelectionIfRequired() {
base::string16 text;
size_t offset;
gfx::Range range;
-#if defined(ENABLE_PLUGINS)
+#if BUILDFLAG(ENABLE_PLUGINS)
if (focused_pepper_plugin_) {
focused_pepper_plugin_->GetSurroundingText(&text, &range);
offset = 0; // Pepper API does not support offset reporting.
@@ -6417,7 +6417,7 @@ media::DecoderFactory* RenderFrameImpl::GetDecoderFactory() {
return decoder_factory_.get();
}
-#if defined(ENABLE_PLUGINS)
+#if BUILDFLAG(ENABLE_PLUGINS)
void RenderFrameImpl::HandlePepperImeCommit(const base::string16& text) {
if (text.empty())
return;
@@ -6529,7 +6529,7 @@ blink::WebPlugin* RenderFrameImpl::GetWebPluginForFind() {
if (frame_->document().isPluginDocument())
return frame_->document().to<WebPluginDocument>().plugin();
-#if defined(ENABLE_PLUGINS)
+#if BUILDFLAG(ENABLE_PLUGINS)
if (plugin_find_handler_)
return plugin_find_handler_->container()->plugin();
#endif
@@ -6554,7 +6554,7 @@ void RenderFrameImpl::SendFindReply(int request_id,
final_status_update));
}
-#if defined(ENABLE_PLUGINS)
+#if BUILDFLAG(ENABLE_PLUGINS)
void RenderFrameImpl::PepperInstanceCreated(
PepperPluginInstanceImpl* instance) {
active_pepper_instances_.insert(instance);
@@ -6624,7 +6624,7 @@ void RenderFrameImpl::OnSetPepperVolume(int32_t pp_instance, double volume) {
#endif // ENABLE_PLUGINS
void RenderFrameImpl::RenderWidgetSetFocus(bool enable) {
-#if defined(ENABLE_PLUGINS)
+#if BUILDFLAG(ENABLE_PLUGINS)
// Notify all Pepper plugins.
for (auto* plugin : active_pepper_instances_)
plugin->SetContentAreaFocus(enable);
@@ -6632,7 +6632,7 @@ void RenderFrameImpl::RenderWidgetSetFocus(bool enable) {
}
void RenderFrameImpl::RenderWidgetWillHandleMouseEvent() {
-#if defined(ENABLE_PLUGINS)
+#if BUILDFLAG(ENABLE_PLUGINS)
// This method is called for every mouse event that the RenderWidget receives.
// And then the mouse event is forwarded to blink, which dispatches it to the
// event target. Potentially a Pepper plugin will receive the event.
« no previous file with comments | « content/renderer/render_frame_impl.h ('k') | content/renderer/render_thread_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698