| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 "webkit/glue/plugins/plugin_host.h" | 5 #include "webkit/glue/plugins/plugin_host.h" |
| 6 | 6 |
| 7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/scoped_ptr.h" | 9 #include "base/scoped_ptr.h" |
| 10 #include "base/string_piece.h" | 10 #include "base/string_piece.h" |
| (...skipping 554 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 565 return plugin->NPP_DestroyStream(stream, reason); | 565 return plugin->NPP_DestroyStream(stream, reason); |
| 566 } | 566 } |
| 567 | 567 |
| 568 const char* NPN_UserAgent(NPP id) { | 568 const char* NPN_UserAgent(NPP id) { |
| 569 // Flash passes in a null id during the NP_initialize call. We need to | 569 // Flash passes in a null id during the NP_initialize call. We need to |
| 570 // default to the Mozilla user agent if we don't have an NPP instance or | 570 // default to the Mozilla user agent if we don't have an NPP instance or |
| 571 // else Flash won't request windowless mode. | 571 // else Flash won't request windowless mode. |
| 572 if (id) { | 572 if (id) { |
| 573 scoped_refptr<NPAPI::PluginInstance> plugin = FindInstance(id); | 573 scoped_refptr<NPAPI::PluginInstance> plugin = FindInstance(id); |
| 574 if (plugin.get() && !plugin->use_mozilla_user_agent()) | 574 if (plugin.get() && !plugin->use_mozilla_user_agent()) |
| 575 return webkit_glue::GetUserAgent().c_str(); | 575 return webkit_glue::GetUserAgent(GURL()).c_str(); |
| 576 } | 576 } |
| 577 | 577 |
| 578 static const char *UA = "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.
9a1) Gecko/20061103 Firefox/2.0a1"; | 578 static const char *UA = "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.
9a1) Gecko/20061103 Firefox/2.0a1"; |
| 579 return UA; | 579 return UA; |
| 580 } | 580 } |
| 581 | 581 |
| 582 void NPN_Status(NPP id, const char* message) { | 582 void NPN_Status(NPP id, const char* message) { |
| 583 // Displays a message on the status line of the browser window. | 583 // Displays a message on the status line of the browser window. |
| 584 | 584 |
| 585 // TODO: implement me | 585 // TODO: implement me |
| (...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 854 NPObject* obj, | 854 NPObject* obj, |
| 855 const NPVariant *args, | 855 const NPVariant *args, |
| 856 uint32_t argCount, | 856 uint32_t argCount, |
| 857 NPVariant *result) { | 857 NPVariant *result) { |
| 858 NOTREACHED(); | 858 NOTREACHED(); |
| 859 return false; | 859 return false; |
| 860 } | 860 } |
| 861 | 861 |
| 862 } // extern "C" | 862 } // extern "C" |
| 863 | 863 |
| OLD | NEW |