| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006, 2007, 2008, 2010 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007, 2008, 2010 Apple Inc. All rights reserved. |
| 3 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) | 3 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 #include "sky/engine/core/frame/Settings.h" | 66 #include "sky/engine/core/frame/Settings.h" |
| 67 #include "sky/engine/core/html/HTMLDocument.h" | 67 #include "sky/engine/core/html/HTMLDocument.h" |
| 68 #include "sky/engine/core/inspector/ConsoleMessage.h" | 68 #include "sky/engine/core/inspector/ConsoleMessage.h" |
| 69 #include "sky/engine/core/inspector/ConsoleMessageStorage.h" | 69 #include "sky/engine/core/inspector/ConsoleMessageStorage.h" |
| 70 #include "sky/engine/core/inspector/InspectorTraceEvents.h" | 70 #include "sky/engine/core/inspector/InspectorTraceEvents.h" |
| 71 #include "sky/engine/core/loader/FrameLoaderClient.h" | 71 #include "sky/engine/core/loader/FrameLoaderClient.h" |
| 72 #include "sky/engine/core/page/Chrome.h" | 72 #include "sky/engine/core/page/Chrome.h" |
| 73 #include "sky/engine/core/page/ChromeClient.h" | 73 #include "sky/engine/core/page/ChromeClient.h" |
| 74 #include "sky/engine/core/page/EventHandler.h" | 74 #include "sky/engine/core/page/EventHandler.h" |
| 75 #include "sky/engine/core/page/Page.h" | 75 #include "sky/engine/core/page/Page.h" |
| 76 #include "sky/engine/core/page/WindowFocusAllowedIndicator.h" | |
| 77 #include "sky/engine/core/rendering/style/RenderStyle.h" | 76 #include "sky/engine/core/rendering/style/RenderStyle.h" |
| 78 #include "sky/engine/platform/EventDispatchForbiddenScope.h" | 77 #include "sky/engine/platform/EventDispatchForbiddenScope.h" |
| 79 #include "sky/engine/platform/PlatformScreen.h" | 78 #include "sky/engine/platform/PlatformScreen.h" |
| 80 #include "sky/engine/platform/geometry/FloatRect.h" | 79 #include "sky/engine/platform/geometry/FloatRect.h" |
| 81 #include "sky/engine/platform/weborigin/KURL.h" | 80 #include "sky/engine/platform/weborigin/KURL.h" |
| 82 #include "sky/engine/platform/weborigin/SecurityPolicy.h" | 81 #include "sky/engine/platform/weborigin/SecurityPolicy.h" |
| 83 #include "sky/engine/public/platform/Platform.h" | 82 #include "sky/engine/public/platform/Platform.h" |
| 84 #include "sky/engine/core/inspector/ScriptCallStack.h" | 83 #include "sky/engine/core/inspector/ScriptCallStack.h" |
| 85 #include "sky/engine/wtf/MainThread.h" | 84 #include "sky/engine/wtf/MainThread.h" |
| 86 #include "sky/engine/wtf/MathExtras.h" | 85 #include "sky/engine/wtf/MathExtras.h" |
| (...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 467 | 466 |
| 468 void LocalDOMWindow::focus(ExecutionContext* context) | 467 void LocalDOMWindow::focus(ExecutionContext* context) |
| 469 { | 468 { |
| 470 if (!m_frame) | 469 if (!m_frame) |
| 471 return; | 470 return; |
| 472 | 471 |
| 473 FrameHost* host = m_frame->host(); | 472 FrameHost* host = m_frame->host(); |
| 474 if (!host) | 473 if (!host) |
| 475 return; | 474 return; |
| 476 | 475 |
| 477 bool allowFocus = WindowFocusAllowedIndicator::windowFocusAllowed(); | 476 host->chrome().focus(); |
| 478 | |
| 479 // If we're a top level window, bring the window to the front. | |
| 480 if (allowFocus) | |
| 481 host->chrome().focus(); | |
| 482 | 477 |
| 483 if (!m_frame) | 478 if (!m_frame) |
| 484 return; | 479 return; |
| 485 | 480 |
| 486 m_frame->eventHandler().focusDocumentView(); | 481 m_frame->eventHandler().focusDocumentView(); |
| 487 } | 482 } |
| 488 | 483 |
| 489 bool LocalDOMWindow::find(const String& string, bool caseSensitive, bool backwar
ds, bool wrap, bool /*wholeWord*/, bool /*searchInFrames*/, bool /*showDialog*/)
const | 484 bool LocalDOMWindow::find(const String& string, bool caseSensitive, bool backwar
ds, bool wrap, bool /*wholeWord*/, bool /*searchInFrames*/, bool /*showDialog*/)
const |
| 490 { | 485 { |
| 491 // |m_frame| can be destructed during |Editor::findString()| via | 486 // |m_frame| can be destructed during |Editor::findString()| via |
| (...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 780 { | 775 { |
| 781 return static_cast<DOMWindowLifecycleNotifier&>(LifecycleContext<LocalDOMWin
dow>::lifecycleNotifier()); | 776 return static_cast<DOMWindowLifecycleNotifier&>(LifecycleContext<LocalDOMWin
dow>::lifecycleNotifier()); |
| 782 } | 777 } |
| 783 | 778 |
| 784 PassOwnPtr<LifecycleNotifier<LocalDOMWindow> > LocalDOMWindow::createLifecycleNo
tifier() | 779 PassOwnPtr<LifecycleNotifier<LocalDOMWindow> > LocalDOMWindow::createLifecycleNo
tifier() |
| 785 { | 780 { |
| 786 return DOMWindowLifecycleNotifier::create(this); | 781 return DOMWindowLifecycleNotifier::create(this); |
| 787 } | 782 } |
| 788 | 783 |
| 789 } // namespace blink | 784 } // namespace blink |
| OLD | NEW |