Chromium Code Reviews| 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" | |
| 44 #endif | |
| 45 #endif | 41 #endif |
| 46 #include "DateTimeChooserImpl.h" | 42 #include "DateTimeChooserImpl.h" |
| 47 #include "ExternalDateTimeChooser.h" | 43 #include "ExternalDateTimeChooser.h" |
| 48 #include "ExternalPopupMenu.h" | 44 #include "ExternalPopupMenu.h" |
| 49 #include "HTMLNames.h" | 45 #include "HTMLNames.h" |
| 50 #include "WebAccessibilityObject.h" | 46 #include "WebAccessibilityObject.h" |
| 51 #include "WebAutofillClient.h" | 47 #include "WebAutofillClient.h" |
| 52 #include "bindings/v8/ScriptController.h" | 48 #include "bindings/v8/ScriptController.h" |
| 53 #include "core/dom/Document.h" | 49 #include "core/dom/Document.h" |
| 54 #include "core/dom/Node.h" | 50 #include "core/dom/Node.h" |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 138 } | 134 } |
| 139 | 135 |
| 140 ChromeClientImpl::ChromeClientImpl(WebViewImpl* webView) | 136 ChromeClientImpl::ChromeClientImpl(WebViewImpl* webView) |
| 141 : m_webView(webView) | 137 : m_webView(webView) |
| 142 , m_toolbarsVisible(true) | 138 , m_toolbarsVisible(true) |
| 143 , m_statusbarVisible(true) | 139 , m_statusbarVisible(true) |
| 144 , m_scrollbarsVisible(true) | 140 , m_scrollbarsVisible(true) |
| 145 , m_menubarVisible(true) | 141 , m_menubarVisible(true) |
| 146 , m_resizable(true) | 142 , m_resizable(true) |
| 147 , m_nextNewWindowNavigationPolicy(WebNavigationPolicyIgnore) | 143 , m_nextNewWindowNavigationPolicy(WebNavigationPolicyIgnore) |
| 148 #if ENABLE(PAGE_POPUP) | |
| 149 , m_pagePopupDriver(webView) | 144 , m_pagePopupDriver(webView) |
| 150 #endif | |
| 151 { | 145 { |
| 152 } | 146 } |
| 153 | 147 |
| 154 ChromeClientImpl::~ChromeClientImpl() | 148 ChromeClientImpl::~ChromeClientImpl() |
| 155 { | 149 { |
| 156 } | 150 } |
| 157 | 151 |
| 158 void* ChromeClientImpl::webView() const | 152 void* ChromeClientImpl::webView() const |
| 159 { | 153 { |
| 160 return static_cast<void*>(m_webView); | 154 return static_cast<void*>(m_webView); |
| (...skipping 554 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 715 | 709 |
| 716 void ChromeClientImpl::reachedApplicationCacheOriginQuota(SecurityOrigin*, int64 _t) | 710 void ChromeClientImpl::reachedApplicationCacheOriginQuota(SecurityOrigin*, int64 _t) |
| 717 { | 711 { |
| 718 ASSERT_NOT_REACHED(); | 712 ASSERT_NOT_REACHED(); |
| 719 } | 713 } |
| 720 | 714 |
| 721 #if ENABLE(INPUT_TYPE_COLOR) | 715 #if ENABLE(INPUT_TYPE_COLOR) |
| 722 PassOwnPtr<ColorChooser> ChromeClientImpl::createColorChooser(ColorChooserClient * chooserClient, const Color&) | 716 PassOwnPtr<ColorChooser> ChromeClientImpl::createColorChooser(ColorChooserClient * chooserClient, const Color&) |
| 723 { | 717 { |
| 724 OwnPtr<ColorChooserUIController> controller; | 718 OwnPtr<ColorChooserUIController> controller; |
| 725 #if ENABLE(PAGE_POPUP) | |
| 726 controller = adoptPtr(new ColorChooserPopupUIController(this, chooserClient) ); | 719 controller = adoptPtr(new ColorChooserPopupUIController(this, chooserClient) ); |
| 727 #else | |
| 728 controller = adoptPtr(new ColorChooserUIController(this, chooserClient)); | |
|
tkent
2013/05/07 21:20:23
We need to check the runtime flag, and select eith
| |
| 729 #endif | |
| 730 controller->openUI(); | 720 controller->openUI(); |
| 731 return controller.release(); | 721 return controller.release(); |
| 732 } | 722 } |
| 733 PassOwnPtr<WebColorChooser> ChromeClientImpl::createWebColorChooser(WebColorChoo serClient* chooserClient, const WebColor& initialColor) | 723 PassOwnPtr<WebColorChooser> ChromeClientImpl::createWebColorChooser(WebColorChoo serClient* chooserClient, const WebColor& initialColor) |
| 734 { | 724 { |
| 735 WebViewClient* client = m_webView->client(); | 725 WebViewClient* client = m_webView->client(); |
| 736 if (!client) | 726 if (!client) |
| 737 return nullptr; | 727 return nullptr; |
| 738 return adoptPtr(client->createColorChooser(chooserClient, initialColor)); | 728 return adoptPtr(client->createColorChooser(chooserClient, initialColor)); |
| 739 } | 729 } |
| (...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1045 return adoptRef(new ExternalPopupMenu(client, m_webView->client())); | 1035 return adoptRef(new ExternalPopupMenu(client, m_webView->client())); |
| 1046 | 1036 |
| 1047 return adoptRef(new PopupMenuChromium(client)); | 1037 return adoptRef(new PopupMenuChromium(client)); |
| 1048 } | 1038 } |
| 1049 | 1039 |
| 1050 PassRefPtr<SearchPopupMenu> ChromeClientImpl::createSearchPopupMenu(PopupMenuCli ent* client) const | 1040 PassRefPtr<SearchPopupMenu> ChromeClientImpl::createSearchPopupMenu(PopupMenuCli ent* client) const |
| 1051 { | 1041 { |
| 1052 return adoptRef(new SearchPopupMenuChromium(client)); | 1042 return adoptRef(new SearchPopupMenuChromium(client)); |
| 1053 } | 1043 } |
| 1054 | 1044 |
| 1055 #if ENABLE(PAGE_POPUP) | |
| 1056 PagePopup* ChromeClientImpl::openPagePopup(PagePopupClient* client, const IntRec t& originBoundsInRootView) | 1045 PagePopup* ChromeClientImpl::openPagePopup(PagePopupClient* client, const IntRec t& originBoundsInRootView) |
| 1057 { | 1046 { |
| 1058 ASSERT(m_pagePopupDriver); | 1047 ASSERT(m_pagePopupDriver); |
| 1059 return m_pagePopupDriver->openPagePopup(client, originBoundsInRootView); | 1048 return m_pagePopupDriver->openPagePopup(client, originBoundsInRootView); |
| 1060 } | 1049 } |
| 1061 | 1050 |
| 1062 void ChromeClientImpl::closePagePopup(PagePopup* popup) | 1051 void ChromeClientImpl::closePagePopup(PagePopup* popup) |
| 1063 { | 1052 { |
| 1064 ASSERT(m_pagePopupDriver); | 1053 ASSERT(m_pagePopupDriver); |
| 1065 m_pagePopupDriver->closePagePopup(popup); | 1054 m_pagePopupDriver->closePagePopup(popup); |
| 1066 } | 1055 } |
| 1067 | 1056 |
| 1068 void ChromeClientImpl::setPagePopupDriver(PagePopupDriver* driver) | 1057 void ChromeClientImpl::setPagePopupDriver(PagePopupDriver* driver) |
| 1069 { | 1058 { |
| 1070 ASSERT(driver); | 1059 ASSERT(driver); |
| 1071 m_pagePopupDriver = driver; | 1060 m_pagePopupDriver = driver; |
| 1072 } | 1061 } |
| 1073 | 1062 |
| 1074 void ChromeClientImpl::resetPagePopupDriver() | 1063 void ChromeClientImpl::resetPagePopupDriver() |
| 1075 { | 1064 { |
| 1076 m_pagePopupDriver = m_webView; | 1065 m_pagePopupDriver = m_webView; |
| 1077 } | 1066 } |
| 1078 #endif | |
| 1079 | 1067 |
| 1080 bool ChromeClientImpl::willAddTextFieldDecorationsTo(HTMLInputElement* input) | 1068 bool ChromeClientImpl::willAddTextFieldDecorationsTo(HTMLInputElement* input) |
| 1081 { | 1069 { |
| 1082 ASSERT(input); | 1070 ASSERT(input); |
| 1083 const Vector<OwnPtr<TextFieldDecorator> >& decorators = m_webView->textField Decorators(); | 1071 const Vector<OwnPtr<TextFieldDecorator> >& decorators = m_webView->textField Decorators(); |
| 1084 for (unsigned i = 0; i < decorators.size(); ++i) { | 1072 for (unsigned i = 0; i < decorators.size(); ++i) { |
| 1085 if (decorators[i]->willAddDecorationTo(input)) | 1073 if (decorators[i]->willAddDecorationTo(input)) |
| 1086 return true; | 1074 return true; |
| 1087 } | 1075 } |
| 1088 return false; | 1076 return false; |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1198 { | 1186 { |
| 1199 } | 1187 } |
| 1200 | 1188 |
| 1201 void NavigatorContentUtilsClientImpl::registerProtocolHandler(const String& sche me, const String& baseURL, const String& url, const String& title) | 1189 void NavigatorContentUtilsClientImpl::registerProtocolHandler(const String& sche me, const String& baseURL, const String& url, const String& title) |
| 1202 { | 1190 { |
| 1203 m_webView->client()->registerProtocolHandler(scheme, baseURL, url, title); | 1191 m_webView->client()->registerProtocolHandler(scheme, baseURL, url, title); |
| 1204 } | 1192 } |
| 1205 #endif | 1193 #endif |
| 1206 | 1194 |
| 1207 } // namespace WebKit | 1195 } // namespace WebKit |
| OLD | NEW |