| OLD | NEW | 
|    1 /* |    1 /* | 
|    2  * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved. |    2  * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved. | 
|    3  * |    3  * | 
|    4  * Redistribution and use in source and binary forms, with or without |    4  * Redistribution and use in source and binary forms, with or without | 
|    5  * modification, are permitted provided that the following conditions |    5  * modification, are permitted provided that the following conditions | 
|    6  * are met: |    6  * are met: | 
|    7  * 1. Redistributions of source code must retain the above copyright |    7  * 1. Redistributions of source code must retain the above copyright | 
|    8  *    notice, this list of conditions and the following disclaimer. |    8  *    notice, this list of conditions and the following disclaimer. | 
|    9  * 2. Redistributions in binary form must reproduce the above copyright |    9  * 2. Redistributions in binary form must reproduce the above copyright | 
|   10  *    notice, this list of conditions and the following disclaimer in the |   10  *    notice, this list of conditions and the following disclaimer in the | 
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|   48   MakeNPVariant(cstr, &variant); |   48   MakeNPVariant(cstr, &variant); | 
|   49   // Report the string to the div. |   49   // Report the string to the div. | 
|   50   NPVariant result; |   50   NPVariant result; | 
|   51   browser->invokeDefault(npp_, text_box_, &variant, 1, &result); |   51   browser->invokeDefault(npp_, text_box_, &variant, 1, &result); | 
|   52   // Release the variant. |   52   // Release the variant. | 
|   53   browser->releasevariantvalue(&variant); |   53   browser->releasevariantvalue(&variant); | 
|   54   browser->releasevariantvalue(&result); |   54   browser->releasevariantvalue(&result); | 
|   55 } |   55 } | 
|   56  |   56  | 
|   57 std::string EventHandler::EventName(double timestamp, int32 type) { |   57 std::string EventHandler::EventName(double timestamp, int32 type) { | 
 |   58 #if !defined(OS_LINUX) | 
|   58   std::stringstream strstr; |   59   std::stringstream strstr; | 
|   59   strstr.setf(std::ios::fixed, std::ios::floatfield); |   60   strstr.setf(std::ios::fixed, std::ios::floatfield); | 
|   60   strstr << timestamp << ": "; |   61   strstr << timestamp << ": "; | 
|   61   std::string str(strstr.str()); |   62   std::string str(strstr.str()); | 
 |   63 #else | 
 |   64   std::string str; | 
 |   65 #endif | 
|   62   switch (type) { |   66   switch (type) { | 
|   63     case NPEventType_MouseDown: |   67     case NPEventType_MouseDown: | 
|   64       return str + "MouseDown"; |   68       return str + "MouseDown"; | 
|   65     case NPEventType_MouseUp: |   69     case NPEventType_MouseUp: | 
|   66       return str + "MouseUp"; |   70       return str + "MouseUp"; | 
|   67     case NPEventType_MouseMove: |   71     case NPEventType_MouseMove: | 
|   68       return str + "MouseMove"; |   72       return str + "MouseMove"; | 
|   69     case NPEventType_MouseEnter: |   73     case NPEventType_MouseEnter: | 
|   70       return str + "MouseEnter"; |   74       return str + "MouseEnter"; | 
|   71     case NPEventType_MouseLeave: |   75     case NPEventType_MouseLeave: | 
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  171     return; |  175     return; | 
|  172   } |  176   } | 
|  173   size_t len; |  177   size_t len; | 
|  174   char* name = string_duplicate(cstr, &len); |  178   char* name = string_duplicate(cstr, &len); | 
|  175   if (NULL == name) { |  179   if (NULL == name) { | 
|  176     STRINGN_TO_NPVARIANT(NULL, 0, *var); |  180     STRINGN_TO_NPVARIANT(NULL, 0, *var); | 
|  177     return; |  181     return; | 
|  178   } |  182   } | 
|  179   STRINGN_TO_NPVARIANT(name, len, *var); |  183   STRINGN_TO_NPVARIANT(name, len, *var); | 
|  180 } |  184 } | 
| OLD | NEW |