| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 Google 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 are | 6 * modification, are permitted provided that the following conditions are |
| 7 * met: | 7 * met: |
| 8 * | 8 * |
| 9 * * Redistributions of source code must retain the above copyright | 9 * * Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 */ | 30 */ |
| 31 | 31 |
| 32 #include "config.h" | 32 #include "config.h" |
| 33 #include "ChromeClientImpl.h" | 33 #include "ChromeClientImpl.h" |
| 34 | 34 |
| 35 #include "core/accessibility/AXObjectCache.h" | 35 #include "core/accessibility/AXObjectCache.h" |
| 36 #include "core/accessibility/AccessibilityObject.h" | 36 #include "core/accessibility/AccessibilityObject.h" |
| 37 #if ENABLE(INPUT_TYPE_COLOR) | 37 #if ENABLE(INPUT_TYPE_COLOR) |
| 38 #include "core/platform/ColorChooser.h" | 38 #include "core/platform/ColorChooser.h" |
| 39 #include "core/platform/ColorChooserClient.h" | 39 #include "core/platform/ColorChooserClient.h" |
| 40 #if ENABLE(PAGE_POPUP) | |
| 41 #include "ColorChooserPopupUIController.h" | 40 #include "ColorChooserPopupUIController.h" |
| 42 #else | |
| 43 #include "ColorChooserUIController.h" | 41 #include "ColorChooserUIController.h" |
| 44 #endif | 42 #endif |
| 45 #endif | |
| 46 #include "DateTimeChooserImpl.h" | 43 #include "DateTimeChooserImpl.h" |
| 47 #include "ExternalDateTimeChooser.h" | 44 #include "ExternalDateTimeChooser.h" |
| 48 #include "ExternalPopupMenu.h" | 45 #include "ExternalPopupMenu.h" |
| 49 #include "HTMLNames.h" | 46 #include "HTMLNames.h" |
| 47 #include "RuntimeEnabledFeatures.h" |
| 50 #include "WebAccessibilityObject.h" | 48 #include "WebAccessibilityObject.h" |
| 51 #include "WebAutofillClient.h" | 49 #include "WebAutofillClient.h" |
| 52 #include "bindings/v8/ScriptController.h" | 50 #include "bindings/v8/ScriptController.h" |
| 53 #include "core/dom/Document.h" | 51 #include "core/dom/Document.h" |
| 54 #include "core/dom/Node.h" | 52 #include "core/dom/Node.h" |
| 55 #include "core/html/HTMLInputElement.h" | 53 #include "core/html/HTMLInputElement.h" |
| 56 #include "core/html/shadow/TextFieldDecorationElement.h" | 54 #include "core/html/shadow/TextFieldDecorationElement.h" |
| 57 #include "core/loader/DocumentLoader.h" | 55 #include "core/loader/DocumentLoader.h" |
| 58 #include "core/loader/FrameLoadRequest.h" | 56 #include "core/loader/FrameLoadRequest.h" |
| 59 #include "core/loader/NavigationAction.h" | 57 #include "core/loader/NavigationAction.h" |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 137 } | 135 } |
| 138 | 136 |
| 139 ChromeClientImpl::ChromeClientImpl(WebViewImpl* webView) | 137 ChromeClientImpl::ChromeClientImpl(WebViewImpl* webView) |
| 140 : m_webView(webView) | 138 : m_webView(webView) |
| 141 , m_toolbarsVisible(true) | 139 , m_toolbarsVisible(true) |
| 142 , m_statusbarVisible(true) | 140 , m_statusbarVisible(true) |
| 143 , m_scrollbarsVisible(true) | 141 , m_scrollbarsVisible(true) |
| 144 , m_menubarVisible(true) | 142 , m_menubarVisible(true) |
| 145 , m_resizable(true) | 143 , m_resizable(true) |
| 146 , m_nextNewWindowNavigationPolicy(WebNavigationPolicyIgnore) | 144 , m_nextNewWindowNavigationPolicy(WebNavigationPolicyIgnore) |
| 147 #if ENABLE(PAGE_POPUP) | |
| 148 , m_pagePopupDriver(webView) | 145 , m_pagePopupDriver(webView) |
| 149 #endif | |
| 150 { | 146 { |
| 151 } | 147 } |
| 152 | 148 |
| 153 ChromeClientImpl::~ChromeClientImpl() | 149 ChromeClientImpl::~ChromeClientImpl() |
| 154 { | 150 { |
| 155 } | 151 } |
| 156 | 152 |
| 157 void* ChromeClientImpl::webView() const | 153 void* ChromeClientImpl::webView() const |
| 158 { | 154 { |
| 159 return static_cast<void*>(m_webView); | 155 return static_cast<void*>(m_webView); |
| (...skipping 525 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 685 void ChromeClientImpl::print(Frame* frame) | 681 void ChromeClientImpl::print(Frame* frame) |
| 686 { | 682 { |
| 687 if (m_webView->client()) | 683 if (m_webView->client()) |
| 688 m_webView->client()->printPage(WebFrameImpl::fromFrame(frame)); | 684 m_webView->client()->printPage(WebFrameImpl::fromFrame(frame)); |
| 689 } | 685 } |
| 690 | 686 |
| 691 #if ENABLE(INPUT_TYPE_COLOR) | 687 #if ENABLE(INPUT_TYPE_COLOR) |
| 692 PassOwnPtr<ColorChooser> ChromeClientImpl::createColorChooser(ColorChooserClient
* chooserClient, const Color&) | 688 PassOwnPtr<ColorChooser> ChromeClientImpl::createColorChooser(ColorChooserClient
* chooserClient, const Color&) |
| 693 { | 689 { |
| 694 OwnPtr<ColorChooserUIController> controller; | 690 OwnPtr<ColorChooserUIController> controller; |
| 695 #if ENABLE(PAGE_POPUP) | 691 if (RuntimeEnabledFeatures::pagePopupEnabled()) |
| 696 controller = adoptPtr(new ColorChooserPopupUIController(this, chooserClient)
); | 692 controller = adoptPtr(new ColorChooserPopupUIController(this, chooserCli
ent)); |
| 697 #else | 693 else |
| 698 controller = adoptPtr(new ColorChooserUIController(this, chooserClient)); | 694 controller = adoptPtr(new ColorChooserUIController(this, chooserClient))
; |
| 699 #endif | |
| 700 controller->openUI(); | 695 controller->openUI(); |
| 701 return controller.release(); | 696 return controller.release(); |
| 702 } | 697 } |
| 703 PassOwnPtr<WebColorChooser> ChromeClientImpl::createWebColorChooser(WebColorChoo
serClient* chooserClient, const WebColor& initialColor) | 698 PassOwnPtr<WebColorChooser> ChromeClientImpl::createWebColorChooser(WebColorChoo
serClient* chooserClient, const WebColor& initialColor) |
| 704 { | 699 { |
| 705 WebViewClient* client = m_webView->client(); | 700 WebViewClient* client = m_webView->client(); |
| 706 if (!client) | 701 if (!client) |
| 707 return nullptr; | 702 return nullptr; |
| 708 return adoptPtr(client->createColorChooser(chooserClient, initialColor)); | 703 return adoptPtr(client->createColorChooser(chooserClient, initialColor)); |
| 709 } | 704 } |
| (...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 970 } | 965 } |
| 971 | 966 |
| 972 PassRefPtr<PopupMenu> ChromeClientImpl::createPopupMenu(PopupMenuClient* client)
const | 967 PassRefPtr<PopupMenu> ChromeClientImpl::createPopupMenu(PopupMenuClient* client)
const |
| 973 { | 968 { |
| 974 if (WebViewImpl::useExternalPopupMenus()) | 969 if (WebViewImpl::useExternalPopupMenus()) |
| 975 return adoptRef(new ExternalPopupMenu(client, m_webView->client())); | 970 return adoptRef(new ExternalPopupMenu(client, m_webView->client())); |
| 976 | 971 |
| 977 return adoptRef(new PopupMenuChromium(client)); | 972 return adoptRef(new PopupMenuChromium(client)); |
| 978 } | 973 } |
| 979 | 974 |
| 980 #if ENABLE(PAGE_POPUP) | |
| 981 PagePopup* ChromeClientImpl::openPagePopup(PagePopupClient* client, const IntRec
t& originBoundsInRootView) | 975 PagePopup* ChromeClientImpl::openPagePopup(PagePopupClient* client, const IntRec
t& originBoundsInRootView) |
| 982 { | 976 { |
| 983 ASSERT(m_pagePopupDriver); | 977 ASSERT(m_pagePopupDriver); |
| 984 return m_pagePopupDriver->openPagePopup(client, originBoundsInRootView); | 978 return m_pagePopupDriver->openPagePopup(client, originBoundsInRootView); |
| 985 } | 979 } |
| 986 | 980 |
| 987 void ChromeClientImpl::closePagePopup(PagePopup* popup) | 981 void ChromeClientImpl::closePagePopup(PagePopup* popup) |
| 988 { | 982 { |
| 989 ASSERT(m_pagePopupDriver); | 983 ASSERT(m_pagePopupDriver); |
| 990 m_pagePopupDriver->closePagePopup(popup); | 984 m_pagePopupDriver->closePagePopup(popup); |
| 991 } | 985 } |
| 992 | 986 |
| 993 void ChromeClientImpl::setPagePopupDriver(PagePopupDriver* driver) | 987 void ChromeClientImpl::setPagePopupDriver(PagePopupDriver* driver) |
| 994 { | 988 { |
| 995 ASSERT(driver); | 989 ASSERT(driver); |
| 996 m_pagePopupDriver = driver; | 990 m_pagePopupDriver = driver; |
| 997 } | 991 } |
| 998 | 992 |
| 999 void ChromeClientImpl::resetPagePopupDriver() | 993 void ChromeClientImpl::resetPagePopupDriver() |
| 1000 { | 994 { |
| 1001 m_pagePopupDriver = m_webView; | 995 m_pagePopupDriver = m_webView; |
| 1002 } | 996 } |
| 1003 #endif | |
| 1004 | 997 |
| 1005 bool ChromeClientImpl::willAddTextFieldDecorationsTo(HTMLInputElement* input) | 998 bool ChromeClientImpl::willAddTextFieldDecorationsTo(HTMLInputElement* input) |
| 1006 { | 999 { |
| 1007 ASSERT(input); | 1000 ASSERT(input); |
| 1008 const Vector<OwnPtr<TextFieldDecorator> >& decorators = m_webView->textField
Decorators(); | 1001 const Vector<OwnPtr<TextFieldDecorator> >& decorators = m_webView->textField
Decorators(); |
| 1009 for (unsigned i = 0; i < decorators.size(); ++i) { | 1002 for (unsigned i = 0; i < decorators.size(); ++i) { |
| 1010 if (decorators[i]->willAddDecorationTo(input)) | 1003 if (decorators[i]->willAddDecorationTo(input)) |
| 1011 return true; | 1004 return true; |
| 1012 } | 1005 } |
| 1013 return false; | 1006 return false; |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1113 { | 1106 { |
| 1114 } | 1107 } |
| 1115 | 1108 |
| 1116 void NavigatorContentUtilsClientImpl::registerProtocolHandler(const String& sche
me, const String& baseURL, const String& url, const String& title) | 1109 void NavigatorContentUtilsClientImpl::registerProtocolHandler(const String& sche
me, const String& baseURL, const String& url, const String& title) |
| 1117 { | 1110 { |
| 1118 m_webView->client()->registerProtocolHandler(scheme, baseURL, url, title); | 1111 m_webView->client()->registerProtocolHandler(scheme, baseURL, url, title); |
| 1119 } | 1112 } |
| 1120 #endif | 1113 #endif |
| 1121 | 1114 |
| 1122 } // namespace WebKit | 1115 } // namespace WebKit |
| OLD | NEW |