| 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 2888 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2899 // FIXME: Either this should only deal with WebLocalFrames or it should move
to WebFrame. | 2899 // FIXME: Either this should only deal with WebLocalFrames or it should move
to WebFrame. |
| 2900 if (!relativeToFrame) | 2900 if (!relativeToFrame) |
| 2901 relativeToFrame = mainFrame(); | 2901 relativeToFrame = mainFrame(); |
| 2902 Frame* frame = toWebLocalFrameImpl(relativeToFrame)->frame(); | 2902 Frame* frame = toWebLocalFrameImpl(relativeToFrame)->frame(); |
| 2903 frame = frame->tree().find(name); | 2903 frame = frame->tree().find(name); |
| 2904 if (!frame || !frame->isLocalFrame()) | 2904 if (!frame || !frame->isLocalFrame()) |
| 2905 return nullptr; | 2905 return nullptr; |
| 2906 return WebLocalFrameImpl::fromFrame(toLocalFrame(frame)); | 2906 return WebLocalFrameImpl::fromFrame(toLocalFrame(frame)); |
| 2907 } | 2907 } |
| 2908 | 2908 |
| 2909 WebFrame* WebViewImpl::focusedFrame() | 2909 WebLocalFrame* WebViewImpl::focusedFrame() |
| 2910 { | 2910 { |
| 2911 return WebFrame::fromFrame(focusedCoreFrame()); | 2911 Frame* frame = focusedCoreFrame(); |
| 2912 if (!frame) |
| 2913 LOG(ERROR) << "hyb: frame is null"; |
| 2914 if (!frame->isLocalFrame()) |
| 2915 LOG(ERROR) << "hyb: frame is not local frame"; |
| 2916 |
| 2917 if (!frame || !frame->isLocalFrame()) |
| 2918 return nullptr; |
| 2919 return WebLocalFrameImpl::fromFrame(toLocalFrame(frame)); |
| 2912 } | 2920 } |
| 2913 | 2921 |
| 2914 void WebViewImpl::setFocusedFrame(WebFrame* frame) | 2922 void WebViewImpl::setFocusedFrame(WebFrame* frame) |
| 2915 { | 2923 { |
| 2916 if (!frame) { | 2924 if (!frame) { |
| 2917 // Clears the focused frame if any. | 2925 // Clears the focused frame if any. |
| 2918 Frame* focusedFrame = focusedCoreFrame(); | 2926 Frame* focusedFrame = focusedCoreFrame(); |
| 2919 if (focusedFrame && focusedFrame->isLocalFrame()) | 2927 if (focusedFrame && focusedFrame->isLocalFrame()) |
| 2920 toLocalFrame(focusedFrame)->selection().setFocused(false); | 2928 toLocalFrame(focusedFrame)->selection().setFocused(false); |
| 2921 return; | 2929 return; |
| (...skipping 1610 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4532 { | 4540 { |
| 4533 // TODO(oshima): Investigate if this should return the ScreenInfo's scale fa
ctor rather than | 4541 // TODO(oshima): Investigate if this should return the ScreenInfo's scale fa
ctor rather than |
| 4534 // page's scale factor, which can be 1 in use-zoom-for-dsf mode. | 4542 // page's scale factor, which can be 1 in use-zoom-for-dsf mode. |
| 4535 if (!page()) | 4543 if (!page()) |
| 4536 return 1; | 4544 return 1; |
| 4537 | 4545 |
| 4538 return page()->deviceScaleFactor(); | 4546 return page()->deviceScaleFactor(); |
| 4539 } | 4547 } |
| 4540 | 4548 |
| 4541 } // namespace blink | 4549 } // namespace blink |
| OLD | NEW |