Ticket #6409: B_ESCAPE-for-STOP.patch
File B_ESCAPE-for-STOP.patch, 1.4 KB (added by , 14 years ago) |
---|
-
WebKit/haiku/WebPositive/BrowserWindow.cpp
544 544 } else if (bytes[0] == B_RIGHT_ARROW && modifiers == B_COMMAND_KEY) { 545 545 PostMessage(GO_FORWARD); 546 546 return; 547 } else if (bytes[0] == B_ESCAPE) { 548 PostMessage(STOP); 549 return; 547 550 } else if (bytes[0] == B_FUNCTION_KEY) { 548 551 // Some function key Firefox compatibility 549 552 int32 key; … … 2084 2087 // TODO: What if it isn't HTML, but for example SVG? 2085 2088 BString source; 2086 2089 ret = message->FindString("source", &source); 2087 2090 2088 2091 if (ret == B_OK) 2089 2092 ret = find_directory(B_COMMON_TEMP_DIRECTORY, &pathToPageSource); 2090 2093 2091 2094 BString tmpFileName("PageSource_"); 2092 2095 tmpFileName << system_time() << ".html"; 2093 2096 if (ret == B_OK) 2094 2097 ret = pathToPageSource.Append(tmpFileName.String()); 2095 2098 2096 2099 BFile pageSourceFile(pathToPageSource.Path(), 2097 2100 B_CREATE_FILE | B_ERASE_FILE | B_WRITE_ONLY); 2098 2101 if (ret == B_OK) 2099 2102 ret = pageSourceFile.InitCheck(); 2100 2103 2101 2104 if (ret == B_OK) { 2102 2105 ssize_t written = pageSourceFile.Write(source.String(), 2103 2106 source.Length()); 2104 2107 if (written != source.Length()) 2105 2108 ret = (status_t)written; 2106 2109 } 2107 2110 2108 2111 if (ret == B_OK) { 2109 2112 const char* type = "text/html"; 2110 2113 size_t size = strlen(type);