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

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

Issue 201773005: Copy a few selection related methods to WebFrame from WebView. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: update test Created 6 years, 9 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 | « Source/web/WebViewImpl.h ('k') | Source/web/tests/WebViewTest.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) 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 2272 matching lines...) Expand 10 before | Expand all | Expand 10 after
2283 LocalFrame* focused = focusedWebCoreFrame(); 2283 LocalFrame* focused = focusedWebCoreFrame();
2284 if (!focused) 2284 if (!focused)
2285 return; 2285 return;
2286 if (WebPlugin* plugin = focusedPluginIfInputMethodSupported(focused)) { 2286 if (WebPlugin* plugin = focusedPluginIfInputMethodSupported(focused)) {
2287 plugin->extendSelectionAndDelete(before, after); 2287 plugin->extendSelectionAndDelete(before, after);
2288 return; 2288 return;
2289 } 2289 }
2290 focused->inputMethodController().extendSelectionAndDelete(before, after); 2290 focused->inputMethodController().extendSelectionAndDelete(before, after);
2291 } 2291 }
2292 2292
2293 bool WebViewImpl::isSelectionEditable() const
2294 {
2295 if (const LocalFrame* frame = focusedWebCoreFrame())
2296 return frame->selection().isContentEditable();
2297 return false;
2298 }
2299
2300 WebColor WebViewImpl::backgroundColor() const 2293 WebColor WebViewImpl::backgroundColor() const
2301 { 2294 {
2302 if (isTransparent()) 2295 if (isTransparent())
2303 return Color::transparent; 2296 return Color::transparent;
2304 if (!m_page) 2297 if (!m_page)
2305 return m_baseBackgroundColor; 2298 return m_baseBackgroundColor;
2306 if (!m_page->mainFrame()) 2299 if (!m_page->mainFrame())
2307 return m_baseBackgroundColor; 2300 return m_baseBackgroundColor;
2308 FrameView* view = m_page->mainFrame()->view(); 2301 FrameView* view = m_page->mainFrame()->view();
2309 return view->documentBackgroundColor().rgb(); 2302 return view->documentBackgroundColor().rgb();
(...skipping 1687 matching lines...) Expand 10 before | Expand all | Expand 10 after
3997 const PageScaleConstraints& constraints = m_pageScaleConstraintsSet.pageDefi nedConstraints(); 3990 const PageScaleConstraints& constraints = m_pageScaleConstraintsSet.pageDefi nedConstraints();
3998 3991
3999 if (!mainFrameImpl() || !mainFrameImpl()->frameView()) 3992 if (!mainFrameImpl() || !mainFrameImpl()->frameView())
4000 return false; 3993 return false;
4001 3994
4002 return mainFrameImpl()->frameView()->layoutSize().width() == m_size.width 3995 return mainFrameImpl()->frameView()->layoutSize().width() == m_size.width
4003 || (constraints.minimumScale == constraints.maximumScale && constraints. minimumScale != -1); 3996 || (constraints.minimumScale == constraints.maximumScale && constraints. minimumScale != -1);
4004 } 3997 }
4005 3998
4006 } // namespace blink 3999 } // namespace blink
OLDNEW
« no previous file with comments | « Source/web/WebViewImpl.h ('k') | Source/web/tests/WebViewTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698