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

Side by Side Diff: Source/web/ContextMenuClientImpl.cpp

Issue 28983004: Split the frame tree logic out of HistoryItem (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 1 month 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 | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009, 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2009, 2012 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 272 matching lines...) Expand 10 before | Expand all | Expand 10 after
283 283
284 // If it's not a link, an image, a media element, or an image/media link, 284 // If it's not a link, an image, a media element, or an image/media link,
285 // show a selection menu or a more generic page menu. 285 // show a selection menu or a more generic page menu.
286 if (selectedFrame->document()->loader()) 286 if (selectedFrame->document()->loader())
287 data.frameEncoding = selectedFrame->document()->encodingName(); 287 data.frameEncoding = selectedFrame->document()->encodingName();
288 288
289 // Send the frame and page URLs in any case. 289 // Send the frame and page URLs in any case.
290 data.pageURL = urlFromFrame(m_webView->mainFrameImpl()->frame()); 290 data.pageURL = urlFromFrame(m_webView->mainFrameImpl()->frame());
291 if (selectedFrame != m_webView->mainFrameImpl()->frame()) { 291 if (selectedFrame != m_webView->mainFrameImpl()->frame()) {
292 data.frameURL = urlFromFrame(selectedFrame); 292 data.frameURL = urlFromFrame(selectedFrame);
293 RefPtr<HistoryItem> historyItem = selectedFrame->loader().history()->cur rentItem(); 293 RefPtr<HistoryItem> historyItem = selectedFrame->page()->history()->curr entItem(selectedFrame);
294 if (historyItem) 294 if (historyItem)
295 data.frameHistoryItem = WebHistoryItem(historyItem); 295 data.frameHistoryItem = WebHistoryItem(historyItem);
296 } 296 }
297 297
298 if (r.isSelected()) { 298 if (r.isSelected()) {
299 if (!r.innerNonSharedNode()->hasTagName(HTMLNames::inputTag) || !toHTMLI nputElement(r.innerNonSharedNode())->isPasswordField()) 299 if (!r.innerNonSharedNode()->hasTagName(HTMLNames::inputTag) || !toHTMLI nputElement(r.innerNonSharedNode())->isPasswordField())
300 data.selectedText = selectedFrame->selectedText().stripWhiteSpace(); 300 data.selectedText = selectedFrame->selectedText().stripWhiteSpace();
301 } 301 }
302 302
303 if (r.isContentEditable()) { 303 if (r.isContentEditable()) {
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
415 outputItems[i] = subItems[i]; 415 outputItems[i] = subItems[i];
416 subMenuItems.swap(outputItems); 416 subMenuItems.swap(outputItems);
417 } 417 }
418 418
419 void ContextMenuClientImpl::populateCustomMenuItems(const WebCore::ContextMenu* defaultMenu, WebContextMenuData* data) 419 void ContextMenuClientImpl::populateCustomMenuItems(const WebCore::ContextMenu* defaultMenu, WebContextMenuData* data)
420 { 420 {
421 populateSubMenuItems(defaultMenu->items(), data->customItems); 421 populateSubMenuItems(defaultMenu->items(), data->customItems);
422 } 422 }
423 423
424 } // namespace blink 424 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698