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 "config.h" | 5 #include "config.h" |
6 #include <string> | 6 #include <string> |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #pragma warning(push, 0) | 9 #pragma warning(push, 0) |
10 #include "Chrome.h" | 10 #include "Chrome.h" |
(...skipping 996 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1007 void WebFrameLoaderClient::setMainFrameDocumentReady(bool ready) { | 1007 void WebFrameLoaderClient::setMainFrameDocumentReady(bool ready) { |
1008 // FIXME | 1008 // FIXME |
1009 } | 1009 } |
1010 | 1010 |
1011 // Creates a new connection and begins downloading from that (contrast this | 1011 // Creates a new connection and begins downloading from that (contrast this |
1012 // with |download|). | 1012 // with |download|). |
1013 void WebFrameLoaderClient::startDownload(const ResourceRequest& request) { | 1013 void WebFrameLoaderClient::startDownload(const ResourceRequest& request) { |
1014 WebViewDelegate* d = webframe_->webview_impl()->delegate(); | 1014 WebViewDelegate* d = webframe_->webview_impl()->delegate(); |
1015 if (d) { | 1015 if (d) { |
1016 const GURL url(webkit_glue::KURLToGURL(request.url())); | 1016 const GURL url(webkit_glue::KURLToGURL(request.url())); |
1017 const GURL referrer(webkit_glue::StringToStdWString(request.httpReferrer()))
; | 1017 const GURL referrer(webkit_glue::StringToStdString(request.httpReferrer())); |
1018 d->DownloadUrl(url, referrer); | 1018 d->DownloadUrl(url, referrer); |
1019 } | 1019 } |
1020 } | 1020 } |
1021 | 1021 |
1022 void WebFrameLoaderClient::willChangeTitle(DocumentLoader*) { | 1022 void WebFrameLoaderClient::willChangeTitle(DocumentLoader*) { |
1023 // FIXME | 1023 // FIXME |
1024 } | 1024 } |
1025 void WebFrameLoaderClient::didChangeTitle(DocumentLoader*) { | 1025 void WebFrameLoaderClient::didChangeTitle(DocumentLoader*) { |
1026 // FIXME | 1026 // FIXME |
1027 } | 1027 } |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1166 // FIXME | 1166 // FIXME |
1167 return false; | 1167 return false; |
1168 } | 1168 } |
1169 | 1169 |
1170 String WebFrameLoaderClient::generatedMIMETypeForURLScheme(const String& URLSche
me) const { | 1170 String WebFrameLoaderClient::generatedMIMETypeForURLScheme(const String& URLSche
me) const { |
1171 // This appears to generate MIME types for protocol handlers that are handled | 1171 // This appears to generate MIME types for protocol handlers that are handled |
1172 // internally. The only place I can find in the WebKit code that uses this | 1172 // internally. The only place I can find in the WebKit code that uses this |
1173 // function is WebView::registerViewClass, where it is used as part of the | 1173 // function is WebView::registerViewClass, where it is used as part of the |
1174 // process by which custom view classes for certain document representations | 1174 // process by which custom view classes for certain document representations |
1175 // are registered. | 1175 // are registered. |
1176 String mimetype(L"x-apple-web-kit/"); | 1176 String mimetype("x-apple-web-kit/"); |
1177 mimetype.append(URLScheme.lower()); | 1177 mimetype.append(URLScheme.lower()); |
1178 return mimetype; | 1178 return mimetype; |
1179 } | 1179 } |
1180 | 1180 |
1181 void WebFrameLoaderClient::frameLoadCompleted() { | 1181 void WebFrameLoaderClient::frameLoadCompleted() { |
1182 // FIXME: the mac port also conditionally calls setDrawsBackground:YES on | 1182 // FIXME: the mac port also conditionally calls setDrawsBackground:YES on |
1183 // it's ScrollView here. | 1183 // it's ScrollView here. |
1184 | 1184 |
1185 // This comment from the Mac port: | 1185 // This comment from the Mac port: |
1186 // Note: Can be called multiple times. | 1186 // Note: Can be called multiple times. |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1297 } | 1297 } |
1298 | 1298 |
1299 // Utility function to convert a vector to an array of char*'s. | 1299 // Utility function to convert a vector to an array of char*'s. |
1300 // Caller is responsible to free memory with DeleteToArray(). | 1300 // Caller is responsible to free memory with DeleteToArray(). |
1301 static char** ToArray(const Vector<WebCore::String> &vector) { | 1301 static char** ToArray(const Vector<WebCore::String> &vector) { |
1302 char **rv = new char *[vector.size()+1]; | 1302 char **rv = new char *[vector.size()+1]; |
1303 unsigned int index = 0; | 1303 unsigned int index = 0; |
1304 for (index = 0; index < vector.size(); ++index) { | 1304 for (index = 0; index < vector.size(); ++index) { |
1305 WebCore::CString src = vector[index].utf8(); | 1305 WebCore::CString src = vector[index].utf8(); |
1306 rv[index] = new char[src.length() + 1]; | 1306 rv[index] = new char[src.length() + 1]; |
1307 strncpy_s(rv[index], src.length() + 1, src.data(), _TRUNCATE); | 1307 base::strlcpy(rv[index], src.data(), src.length() + 1); |
1308 rv[index][src.length()] = '\0'; | 1308 rv[index][src.length()] = '\0'; |
1309 } | 1309 } |
1310 rv[index] = 0; | 1310 rv[index] = 0; |
1311 return rv; | 1311 return rv; |
1312 } | 1312 } |
1313 | 1313 |
1314 static void DeleteToArray(char** arr) { | 1314 static void DeleteToArray(char** arr) { |
1315 char **ptr = arr; | 1315 char **ptr = arr; |
1316 while (*ptr != 0) { | 1316 while (*ptr != 0) { |
1317 delete [] *ptr; | 1317 delete [] *ptr; |
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1485 return false; | 1485 return false; |
1486 | 1486 |
1487 DCHECK(disposition); | 1487 DCHECK(disposition); |
1488 if (middle_or_ctrl) | 1488 if (middle_or_ctrl) |
1489 *disposition = shift ? NEW_FOREGROUND_TAB : NEW_BACKGROUND_TAB; | 1489 *disposition = shift ? NEW_FOREGROUND_TAB : NEW_BACKGROUND_TAB; |
1490 else | 1490 else |
1491 *disposition = shift ? NEW_WINDOW : SAVE_TO_DISK; | 1491 *disposition = shift ? NEW_WINDOW : SAVE_TO_DISK; |
1492 return true; | 1492 return true; |
1493 } | 1493 } |
1494 | 1494 |
OLD | NEW |