| OLD | NEW |
| 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 2887 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2898 // FIXME: Either this should only deal with WebLocalFrames or it should move
to WebFrame. | 2898 // FIXME: Either this should only deal with WebLocalFrames or it should move
to WebFrame. |
| 2899 if (!relativeToFrame) | 2899 if (!relativeToFrame) |
| 2900 relativeToFrame = mainFrame(); | 2900 relativeToFrame = mainFrame(); |
| 2901 Frame* frame = toWebLocalFrameImpl(relativeToFrame)->frame(); | 2901 Frame* frame = toWebLocalFrameImpl(relativeToFrame)->frame(); |
| 2902 frame = frame->tree().find(name); | 2902 frame = frame->tree().find(name); |
| 2903 if (!frame || !frame->isLocalFrame()) | 2903 if (!frame || !frame->isLocalFrame()) |
| 2904 return nullptr; | 2904 return nullptr; |
| 2905 return WebLocalFrameImpl::fromFrame(toLocalFrame(frame)); | 2905 return WebLocalFrameImpl::fromFrame(toLocalFrame(frame)); |
| 2906 } | 2906 } |
| 2907 | 2907 |
| 2908 WebFrame* WebViewImpl::focusedFrame() | 2908 WebLocalFrame* WebViewImpl::focusedFrame() |
| 2909 { | 2909 { |
| 2910 return WebFrame::fromFrame(focusedCoreFrame()); | 2910 Frame* frame = focusedCoreFrame(); |
| 2911 if (!frame || !frame->isLocalFrame()) |
| 2912 return nullptr; |
| 2913 return WebLocalFrameImpl::fromFrame(toLocalFrame(frame)); |
| 2911 } | 2914 } |
| 2912 | 2915 |
| 2913 void WebViewImpl::setFocusedFrame(WebFrame* frame) | 2916 void WebViewImpl::setFocusedFrame(WebFrame* frame) |
| 2914 { | 2917 { |
| 2915 if (!frame) { | 2918 if (!frame) { |
| 2916 // Clears the focused frame if any. | 2919 // Clears the focused frame if any. |
| 2917 Frame* focusedFrame = focusedCoreFrame(); | 2920 Frame* focusedFrame = focusedCoreFrame(); |
| 2918 if (focusedFrame && focusedFrame->isLocalFrame()) | 2921 if (focusedFrame && focusedFrame->isLocalFrame()) |
| 2919 toLocalFrame(focusedFrame)->selection().setFocused(false); | 2922 toLocalFrame(focusedFrame)->selection().setFocused(false); |
| 2920 return; | 2923 return; |
| (...skipping 1646 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4567 { | 4570 { |
| 4568 // TODO(oshima): Investigate if this should return the ScreenInfo's scale fa
ctor rather than | 4571 // TODO(oshima): Investigate if this should return the ScreenInfo's scale fa
ctor rather than |
| 4569 // page's scale factor, which can be 1 in use-zoom-for-dsf mode. | 4572 // page's scale factor, which can be 1 in use-zoom-for-dsf mode. |
| 4570 if (!page()) | 4573 if (!page()) |
| 4571 return 1; | 4574 return 1; |
| 4572 | 4575 |
| 4573 return page()->deviceScaleFactor(); | 4576 return page()->deviceScaleFactor(); |
| 4574 } | 4577 } |
| 4575 | 4578 |
| 4576 } // namespace blink | 4579 } // namespace blink |
| OLD | NEW |