OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "chrome_frame/chrome_frame_npapi.h" | 5 #include "chrome_frame/chrome_frame_npapi.h" |
6 | 6 |
7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
10 #include "base/string_split.h" | 10 #include "base/string_split.h" |
(...skipping 381 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
392 | 392 |
393 DLOG(INFO) << "Do not have method: " << npapi::StringFromIdentifier(name); | 393 DLOG(INFO) << "Do not have method: " << npapi::StringFromIdentifier(name); |
394 | 394 |
395 return false; | 395 return false; |
396 } | 396 } |
397 | 397 |
398 bool ChromeFrameNPAPI::Invoke(NPObject* header, NPIdentifier name, | 398 bool ChromeFrameNPAPI::Invoke(NPObject* header, NPIdentifier name, |
399 const NPVariant* args, uint32_t arg_count, | 399 const NPVariant* args, uint32_t arg_count, |
400 NPVariant* result) { | 400 NPVariant* result) { |
401 ChromeFrameNPAPI* plugin_instance = ChromeFrameInstanceFromNPObject(header); | 401 ChromeFrameNPAPI* plugin_instance = ChromeFrameInstanceFromNPObject(header); |
402 if (!plugin_instance && (plugin_instance->automation_client_.get())) | 402 if (!plugin_instance || !plugin_instance->automation_client_.get()) |
403 return false; | 403 return false; |
404 | 404 |
405 bool success = false; | 405 bool success = false; |
406 for (int i = 0; i < arraysize(plugin_methods_); ++i) { | 406 for (int i = 0; i < arraysize(plugin_methods_); ++i) { |
407 if (name == plugin_method_identifiers_[i]) { | 407 if (name == plugin_method_identifiers_[i]) { |
408 PluginMethod method = plugin_methods_[i]; | 408 PluginMethod method = plugin_methods_[i]; |
409 success = (plugin_instance->*method)(header, args, arg_count, result); | 409 success = (plugin_instance->*method)(header, args, arg_count, result); |
410 break; | 410 break; |
411 } | 411 } |
412 } | 412 } |
(...skipping 717 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1130 void ChromeFrameNPAPI::URLRedirectNotify(const char* url, int status, | 1130 void ChromeFrameNPAPI::URLRedirectNotify(const char* url, int status, |
1131 void* notify_data) { | 1131 void* notify_data) { |
1132 DVLOG(1) << __FUNCTION__ | 1132 DVLOG(1) << __FUNCTION__ |
1133 << "Received redirect notification for url:" | 1133 << "Received redirect notification for url:" |
1134 << url; | 1134 << url; |
1135 // Inform chrome about the redirect and disallow the current redirect | 1135 // Inform chrome about the redirect and disallow the current redirect |
1136 // attempt. | 1136 // attempt. |
1137 url_fetcher_.UrlRedirectNotify(url, status, notify_data); | 1137 url_fetcher_.UrlRedirectNotify(url, status, notify_data); |
1138 npapi::URLRedirectResponse(instance_, notify_data, false); | 1138 npapi::URLRedirectResponse(instance_, notify_data, false); |
1139 } | 1139 } |
OLD | NEW |