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

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

Issue 1313013002: Make WebLocalFrameImpl to use VisibleSelection::toNormalizedEphemeralRange() instead of toNormalized (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 2015-08-25T17:25:21 Created 5 years, 4 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 | no next file » | 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 1222 matching lines...) Expand 10 before | Expand all | Expand 10 after
1233 WebPluginContainerImpl* pluginContainer = pluginContainerFromFrame(frame()); 1233 WebPluginContainerImpl* pluginContainer = pluginContainerFromFrame(frame());
1234 if (pluginContainer) 1234 if (pluginContainer)
1235 return pluginContainer->plugin()->hasSelection(); 1235 return pluginContainer->plugin()->hasSelection();
1236 1236
1237 // frame()->selection()->isNone() never returns true. 1237 // frame()->selection()->isNone() never returns true.
1238 return frame()->selection().start() != frame()->selection().end(); 1238 return frame()->selection().start() != frame()->selection().end();
1239 } 1239 }
1240 1240
1241 WebRange WebLocalFrameImpl::selectionRange() const 1241 WebRange WebLocalFrameImpl::selectionRange() const
1242 { 1242 {
1243 return frame()->selection().toNormalizedRange(); 1243 return createRange(frame()->selection().selection().toNormalizedEphemeralRan ge());
1244 } 1244 }
1245 1245
1246 WebString WebLocalFrameImpl::selectionAsText() const 1246 WebString WebLocalFrameImpl::selectionAsText() const
1247 { 1247 {
1248 WebPluginContainerImpl* pluginContainer = pluginContainerFromFrame(frame()); 1248 WebPluginContainerImpl* pluginContainer = pluginContainerFromFrame(frame());
1249 if (pluginContainer) 1249 if (pluginContainer)
1250 return pluginContainer->plugin()->selectionAsText(); 1250 return pluginContainer->plugin()->selectionAsText();
1251 1251
1252 const EphemeralRange range = frame()->selection().selection().toNormalizedEp hemeralRange(); 1252 const EphemeralRange range = frame()->selection().selection().toNormalizedEp hemeralRange();
1253 if (range.isNull()) 1253 if (range.isNull())
(...skipping 957 matching lines...) Expand 10 before | Expand all | Expand 10 after
2211 } 2211 }
2212 2212
2213 WebSandboxFlags WebLocalFrameImpl::effectiveSandboxFlags() const 2213 WebSandboxFlags WebLocalFrameImpl::effectiveSandboxFlags() const
2214 { 2214 {
2215 if (!frame()) 2215 if (!frame())
2216 return WebSandboxFlags::None; 2216 return WebSandboxFlags::None;
2217 return static_cast<WebSandboxFlags>(frame()->loader().effectiveSandboxFlags( )); 2217 return static_cast<WebSandboxFlags>(frame()->loader().effectiveSandboxFlags( ));
2218 } 2218 }
2219 2219
2220 } // namespace blink 2220 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698