Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(265)

Side by Side Diff: Source/WebKit/chromium/src/ContextMenuClientImpl.cpp

Issue 7782040: Merge 94102 - [Chromium] Add null checks for document()->loader() (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/835/
Patch Set: Created 9 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | Source/WebKit/chromium/src/WebSearchableFormData.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2009 Google 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 are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after
236 data.mediaFlags |= WebContextMenuData::MediaCanSave; 236 data.mediaFlags |= WebContextMenuData::MediaCanSave;
237 } 237 }
238 } 238 }
239 } 239 }
240 240
241 data.isImageBlocked = 241 data.isImageBlocked =
242 (data.mediaType == WebContextMenuData::MediaTypeImage) && !r.image(); 242 (data.mediaType == WebContextMenuData::MediaTypeImage) && !r.image();
243 243
244 // If it's not a link, an image, a media element, or an image/media link, 244 // If it's not a link, an image, a media element, or an image/media link,
245 // show a selection menu or a more generic page menu. 245 // show a selection menu or a more generic page menu.
246 data.frameEncoding = selectedFrame->document()->loader()->writer()->encoding (); 246 if (selectedFrame->document()->loader())
247 data.frameEncoding = selectedFrame->document()->loader()->writer()->enco ding();
247 248
248 // Send the frame and page URLs in any case. 249 // Send the frame and page URLs in any case.
249 data.pageURL = urlFromFrame(m_webView->mainFrameImpl()->frame()); 250 data.pageURL = urlFromFrame(m_webView->mainFrameImpl()->frame());
250 if (selectedFrame != m_webView->mainFrameImpl()->frame()) { 251 if (selectedFrame != m_webView->mainFrameImpl()->frame()) {
251 data.frameURL = urlFromFrame(selectedFrame); 252 data.frameURL = urlFromFrame(selectedFrame);
252 RefPtr<HistoryItem> historyItem = selectedFrame->loader()->history()->cu rrentItem(); 253 RefPtr<HistoryItem> historyItem = selectedFrame->loader()->history()->cu rrentItem();
253 if (historyItem) 254 if (historyItem)
254 data.frameHistoryItem = WebHistoryItem(historyItem); 255 data.frameHistoryItem = WebHistoryItem(historyItem);
255 } 256 }
256 257
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
346 customItems.append(outputItem); 347 customItems.append(outputItem);
347 } 348 }
348 349
349 WebVector<WebMenuItemInfo> outputItems(customItems.size()); 350 WebVector<WebMenuItemInfo> outputItems(customItems.size());
350 for (size_t i = 0; i < customItems.size(); ++i) 351 for (size_t i = 0; i < customItems.size(); ++i)
351 outputItems[i] = customItems[i]; 352 outputItems[i] = customItems[i];
352 data->customItems.swap(outputItems); 353 data->customItems.swap(outputItems);
353 } 354 }
354 355
355 } // namespace WebKit 356 } // namespace WebKit
OLDNEW
« no previous file with comments | « no previous file | Source/WebKit/chromium/src/WebSearchableFormData.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698