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

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

Issue 100193005: Add ExtendSelectionAndDelete handler in WebPlugin (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years 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
« no previous file with comments | « no previous file | public/web/WebPlugin.h » ('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) 2011, 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2011, 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 2414 matching lines...) Expand 10 before | Expand all | Expand 10 after
2425 WebVector<WebCompositionUnderline> results(underlines.size()); 2425 WebVector<WebCompositionUnderline> results(underlines.size());
2426 for (size_t index = 0; index < underlines.size(); ++index) { 2426 for (size_t index = 0; index < underlines.size(); ++index) {
2427 CompositionUnderline underline = underlines[index]; 2427 CompositionUnderline underline = underlines[index];
2428 results[index] = WebCompositionUnderline(underline.startOffset, underlin e.endOffset, static_cast<WebColor>(underline.color.rgb()), underline.thick); 2428 results[index] = WebCompositionUnderline(underline.startOffset, underlin e.endOffset, static_cast<WebColor>(underline.color.rgb()), underline.thick);
2429 } 2429 }
2430 return results; 2430 return results;
2431 } 2431 }
2432 2432
2433 void WebViewImpl::extendSelectionAndDelete(int before, int after) 2433 void WebViewImpl::extendSelectionAndDelete(int before, int after)
2434 { 2434 {
2435 const Frame* focused = focusedWebCoreFrame(); 2435 Frame* focused = focusedWebCoreFrame();
2436 if (!focused) 2436 if (!focused)
2437 return; 2437 return;
2438 if (WebPlugin* plugin = focusedPluginIfInputMethodSupported(focused)) {
2439 plugin->extendSelectionAndDelete(before, after);
2440 return;
2441 }
2438 focused->inputMethodController().extendSelectionAndDelete(before, after); 2442 focused->inputMethodController().extendSelectionAndDelete(before, after);
2439 } 2443 }
2440 2444
2441 bool WebViewImpl::isSelectionEditable() const 2445 bool WebViewImpl::isSelectionEditable() const
2442 { 2446 {
2443 if (const Frame* frame = focusedWebCoreFrame()) 2447 if (const Frame* frame = focusedWebCoreFrame())
2444 return frame->selection().isContentEditable(); 2448 return frame->selection().isContentEditable();
2445 return false; 2449 return false;
2446 } 2450 }
2447 2451
(...skipping 1744 matching lines...) Expand 10 before | Expand all | Expand 10 after
4192 const PageScaleConstraints& constraints = m_pageScaleConstraintsSet.pageDefi nedConstraints(); 4196 const PageScaleConstraints& constraints = m_pageScaleConstraintsSet.pageDefi nedConstraints();
4193 4197
4194 if (!mainFrameImpl() || !mainFrameImpl()->frameView()) 4198 if (!mainFrameImpl() || !mainFrameImpl()->frameView())
4195 return false; 4199 return false;
4196 4200
4197 return mainFrameImpl()->frameView()->layoutSize().width() == m_size.width 4201 return mainFrameImpl()->frameView()->layoutSize().width() == m_size.width
4198 || (constraints.minimumScale == constraints.maximumScale && constraints. minimumScale != -1); 4202 || (constraints.minimumScale == constraints.maximumScale && constraints. minimumScale != -1);
4199 } 4203 }
4200 4204
4201 } // namespace blink 4205 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | public/web/WebPlugin.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698