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

Side by Side Diff: content/child/npapi/plugin_host.cc

Issue 186883002: Move user_agent code from webkit/ to content/. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: review Created 6 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 | Annotate | Revision Log
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/child/npapi/plugin_host.h" 5 #include "content/child/npapi/plugin_host.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/file_util.h" 8 #include "base/file_util.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
11 #include "base/strings/string_piece.h" 11 #include "base/strings/string_piece.h"
12 #include "base/strings/string_util.h" 12 #include "base/strings/string_util.h"
13 #include "base/strings/sys_string_conversions.h" 13 #include "base/strings/sys_string_conversions.h"
14 #include "base/strings/utf_string_conversions.h" 14 #include "base/strings/utf_string_conversions.h"
15 #include "build/build_config.h" 15 #include "build/build_config.h"
16 #include "content/child/npapi/plugin_instance.h" 16 #include "content/child/npapi/plugin_instance.h"
17 #include "content/child/npapi/plugin_lib.h" 17 #include "content/child/npapi/plugin_lib.h"
18 #include "content/child/npapi/plugin_stream_url.h" 18 #include "content/child/npapi/plugin_stream_url.h"
19 #include "content/child/npapi/webplugin_delegate.h" 19 #include "content/child/npapi/webplugin_delegate.h"
20 #include "content/public/common/content_switches.h" 20 #include "content/public/common/content_switches.h"
21 #include "content/public/common/user_agent.h"
21 #include "content/public/common/webplugininfo.h" 22 #include "content/public/common/webplugininfo.h"
22 #include "net/base/net_util.h" 23 #include "net/base/net_util.h"
23 #include "third_party/WebKit/public/web/WebBindings.h" 24 #include "third_party/WebKit/public/web/WebBindings.h"
24 #include "third_party/WebKit/public/web/WebKit.h" 25 #include "third_party/WebKit/public/web/WebKit.h"
25 #include "third_party/npapi/bindings/npruntime.h" 26 #include "third_party/npapi/bindings/npruntime.h"
26 #include "ui/gl/gl_implementation.h" 27 #include "ui/gl/gl_implementation.h"
27 #include "ui/gl/gl_surface.h" 28 #include "ui/gl/gl_surface.h"
28 #include "webkit/common/user_agent/user_agent.h"
29 29
30 #if defined(OS_MACOSX) 30 #if defined(OS_MACOSX)
31 #include "base/mac/mac_util.h" 31 #include "base/mac/mac_util.h"
32 #endif 32 #endif
33 33
34 using blink::WebBindings; 34 using blink::WebBindings;
35 35
36 // Declarations for stub implementations of deprecated functions, which are no 36 // Declarations for stub implementations of deprecated functions, which are no
37 // longer listed in npapi.h. 37 // longer listed in npapi.h.
38 extern "C" { 38 extern "C" {
(...skipping 552 matching lines...) Expand 10 before | Expand all | Expand 10 after
591 scoped_refptr<PluginInstance> plugin = FindInstance(id); 591 scoped_refptr<PluginInstance> plugin = FindInstance(id);
592 if (plugin.get() && !plugin->use_mozilla_user_agent()) 592 if (plugin.get() && !plugin->use_mozilla_user_agent())
593 use_mozilla_user_agent = false; 593 use_mozilla_user_agent = false;
594 } 594 }
595 595
596 if (use_mozilla_user_agent) 596 if (use_mozilla_user_agent)
597 return "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9a1) " 597 return "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9a1) "
598 "Gecko/20061103 Firefox/2.0a1"; 598 "Gecko/20061103 Firefox/2.0a1";
599 #endif 599 #endif
600 600
601 return webkit_glue::GetUserAgent(GURL()).c_str(); 601 return content::GetUserAgent(GURL()).c_str();
602 } 602 }
603 603
604 void NPN_Status(NPP id, const char* message) { 604 void NPN_Status(NPP id, const char* message) {
605 // Displays a message on the status line of the browser window. 605 // Displays a message on the status line of the browser window.
606 606
607 // TODO: implement me 607 // TODO: implement me
608 DVLOG(1) << "NPN_Status is not implemented yet."; 608 DVLOG(1) << "NPN_Status is not implemented yet.";
609 } 609 }
610 610
611 void NPN_InvalidateRect(NPP id, NPRect *invalidRect) { 611 void NPN_InvalidateRect(NPP id, NPRect *invalidRect) {
(...skipping 493 matching lines...) Expand 10 before | Expand all | Expand 10 after
1105 } 1105 }
1106 1106
1107 void NPN_URLRedirectResponse(NPP instance, void* notify_data, NPBool allow) { 1107 void NPN_URLRedirectResponse(NPP instance, void* notify_data, NPBool allow) {
1108 scoped_refptr<PluginInstance> plugin(FindInstance(instance)); 1108 scoped_refptr<PluginInstance> plugin(FindInstance(instance));
1109 if (plugin.get()) { 1109 if (plugin.get()) {
1110 plugin->URLRedirectResponse(!!allow, notify_data); 1110 plugin->URLRedirectResponse(!!allow, notify_data);
1111 } 1111 }
1112 } 1112 }
1113 1113
1114 } // extern "C" 1114 } // extern "C"
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698