diff --git a/CHROMIUM_BUILD_COMPATIBILITY.txt b/CHROMIUM_BUILD_COMPATIBILITY.txt index 6e79545c4..a918f90ae 100644 --- a/CHROMIUM_BUILD_COMPATIBILITY.txt +++ b/CHROMIUM_BUILD_COMPATIBILITY.txt @@ -36,3 +36,4 @@ Date | CEF Revision | Chromium Revision 2009-08-13 | /trunk@34 | /trunk@23266 2009-08-20 | /trunk@35 | /trunk@23814 2009-08-25 | /trunk@41 | /trunk@24210 +2009-09-17 | /trunk@42 | /trunk@26432 diff --git a/cef.sln b/cef.sln index 5371fe559..656f2ab88 100644 --- a/cef.sln +++ b/cef.sln @@ -4,26 +4,26 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "WebKit (readonly)", "WebKit EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "webcore", "..\webkit\WebCore.vcproj", "{1C16337B-ACF3-4D03-AA90-851C5B5EADA6}" ProjectSection(ProjectDependencies) = postProject - {F9810DE8-CBC3-4605-A7B1-ECA2D5292FD7} = {F9810DE8-CBC3-4605-A7B1-ECA2D5292FD7} - {FC0E1FD0-5DD7-4041-A1C9-CD3C376E4EED} = {FC0E1FD0-5DD7-4041-A1C9-CD3C376E4EED} - {EF5E94AB-B646-4E5B-A058-52EF07B8351C} = {EF5E94AB-B646-4E5B-A058-52EF07B8351C} - {21E22961-22BF-4493-BD3A-868F93DA5179} = {21E22961-22BF-4493-BD3A-868F93DA5179} - {AA8A5A85-592B-4357-BC60-E0E91E026AF6} = {AA8A5A85-592B-4357-BC60-E0E91E026AF6} - {238CE175-76CE-4A25-A676-69D115885601} = {238CE175-76CE-4A25-A676-69D115885601} - {CD9CA56E-4E94-444C-87D4-58CA1E6F300D} = {CD9CA56E-4E94-444C-87D4-58CA1E6F300D} - {6EAD4A4B-2BBC-4974-8E45-BB5C16CC2AC9} = {6EAD4A4B-2BBC-4974-8E45-BB5C16CC2AC9} - {C564F145-9172-42C3-BFCB-6014CA97DBCD} = {C564F145-9172-42C3-BFCB-6014CA97DBCD} {2E2D3301-2EC4-4C0F-B889-87073B30F673} = {2E2D3301-2EC4-4C0F-B889-87073B30F673} + {C564F145-9172-42C3-BFCB-6014CA97DBCD} = {C564F145-9172-42C3-BFCB-6014CA97DBCD} + {6EAD4A4B-2BBC-4974-8E45-BB5C16CC2AC9} = {6EAD4A4B-2BBC-4974-8E45-BB5C16CC2AC9} + {CD9CA56E-4E94-444C-87D4-58CA1E6F300D} = {CD9CA56E-4E94-444C-87D4-58CA1E6F300D} + {238CE175-76CE-4A25-A676-69D115885601} = {238CE175-76CE-4A25-A676-69D115885601} + {AA8A5A85-592B-4357-BC60-E0E91E026AF6} = {AA8A5A85-592B-4357-BC60-E0E91E026AF6} + {21E22961-22BF-4493-BD3A-868F93DA5179} = {21E22961-22BF-4493-BD3A-868F93DA5179} + {EF5E94AB-B646-4E5B-A058-52EF07B8351C} = {EF5E94AB-B646-4E5B-A058-52EF07B8351C} + {FC0E1FD0-5DD7-4041-A1C9-CD3C376E4EED} = {FC0E1FD0-5DD7-4041-A1C9-CD3C376E4EED} + {F9810DE8-CBC3-4605-A7B1-ECA2D5292FD7} = {F9810DE8-CBC3-4605-A7B1-ECA2D5292FD7} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "glue", "..\webkit\glue.vcproj", "{C66B126D-0ECE-4CA2-B6DC-FA780AFBBF09}" ProjectSection(ProjectDependencies) = postProject - {2E2D3301-2EC4-4C0F-B889-87073B30F673} = {2E2D3301-2EC4-4C0F-B889-87073B30F673} - {1C16337B-ACF3-4D03-AA90-851C5B5EADA6} = {1C16337B-ACF3-4D03-AA90-851C5B5EADA6} - {5ECEC9E5-8F23-47B6-93E0-C3B328B3BE65} = {5ECEC9E5-8F23-47B6-93E0-C3B328B3BE65} - {326E9795-E760-410A-B69A-3F79DB3F5243} = {326E9795-E760-410A-B69A-3F79DB3F5243} - {0B469837-3D46-484A-AFB3-C5A6C68730B9} = {0B469837-3D46-484A-AFB3-C5A6C68730B9} {60B43839-95E6-4526-A661-209F16335E0E} = {60B43839-95E6-4526-A661-209F16335E0E} + {0B469837-3D46-484A-AFB3-C5A6C68730B9} = {0B469837-3D46-484A-AFB3-C5A6C68730B9} + {326E9795-E760-410A-B69A-3F79DB3F5243} = {326E9795-E760-410A-B69A-3F79DB3F5243} + {5ECEC9E5-8F23-47B6-93E0-C3B328B3BE65} = {5ECEC9E5-8F23-47B6-93E0-C3B328B3BE65} + {1C16337B-ACF3-4D03-AA90-851C5B5EADA6} = {1C16337B-ACF3-4D03-AA90-851C5B5EADA6} + {2E2D3301-2EC4-4C0F-B889-87073B30F673} = {2E2D3301-2EC4-4C0F-B889-87073B30F673} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "skia", "..\skia\skia.vcproj", "{CD9CA56E-4E94-444C-87D4-58CA1E6F300D}" @@ -34,19 +34,11 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "wtf", "..\webkit\WTF.vcproj EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sqlite", "..\third_party\sqlite\sqlite.vcproj", "{6EAD4A4B-2BBC-4974-8E45-BB5C16CC2AC9}" - ProjectSection(ProjectDependencies) = postProject - {8C27D792-2648-4F5E-9ED0-374276327308} = {8C27D792-2648-4F5E-9ED0-374276327308} - EndProjectSection EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Libraries", "Libraries", "{EF78C1F9-AA17-4CA5-B6CB-39B37A73A3DA}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "WebKit (ours)", "WebKit (ours)", "{CB43561E-A6F8-49E2-96A2-3F2BA1FFF21E}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "icu", "..\third_party\icu38\build\icu.vcproj", "{8C27D792-2648-4F5E-9ED0-374276327308}" - ProjectSection(ProjectDependencies) = postProject - {A0D94973-D355-47A5-A1E2-3456F321F010} = {A0D94973-D355-47A5-A1E2-3456F321F010} - EndProjectSection -EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "icu", "icu", "{1AFC1EC3-24FA-4260-B099-76319EC9977A}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libpng", "..\third_party\libpng\libpng.vcproj", "{C564F145-9172-42C3-BFCB-6014CA97DBCD}" @@ -70,56 +62,45 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "bzip2", "..\third_party\bzi EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libcef", "libcef\libcef.vcproj", "{FA39524D-3067-4141-888D-28A86C66F2B9}" ProjectSection(ProjectDependencies) = postProject - {60B43839-95E6-4526-A661-209F16335E0E} = {60B43839-95E6-4526-A661-209F16335E0E} - {5ECEC9E5-8F23-47B6-93E0-C3B328B3BE65} = {5ECEC9E5-8F23-47B6-93E0-C3B328B3BE65} - {2A70CBF0-847E-4E3A-B926-542A656DC7FE} = {2A70CBF0-847E-4E3A-B926-542A656DC7FE} - {5916D37D-8C97-424F-A904-74E52594C2D6} = {5916D37D-8C97-424F-A904-74E52594C2D6} - {7100F41F-868D-4E99-80A2-AF8E6574749D} = {7100F41F-868D-4E99-80A2-AF8E6574749D} - {8423AF0D-4B88-4EBF-94E1-E4D00D00E21C} = {8423AF0D-4B88-4EBF-94E1-E4D00D00E21C} - {8C27D792-2648-4F5E-9ED0-374276327308} = {8C27D792-2648-4F5E-9ED0-374276327308} - {A508ADD3-CECE-4E0F-8448-2F5E454DF551} = {A508ADD3-CECE-4E0F-8448-2F5E454DF551} - {AA8A5A85-592B-4357-BC60-E0E91E026AF6} = {AA8A5A85-592B-4357-BC60-E0E91E026AF6} - {B55CA863-B374-4BAF-95AC-539E4FA4C90C} = {B55CA863-B374-4BAF-95AC-539E4FA4C90C} - {C0334F9A-1168-4101-9DD8-C30FB252D435} = {C0334F9A-1168-4101-9DD8-C30FB252D435} - {C564F145-9172-42C3-BFCB-6014CA97DBCD} = {C564F145-9172-42C3-BFCB-6014CA97DBCD} - {C66B126D-0ECE-4CA2-B6DC-FA780AFBBF09} = {C66B126D-0ECE-4CA2-B6DC-FA780AFBBF09} - {CD9CA56E-4E94-444C-87D4-58CA1E6F300D} = {CD9CA56E-4E94-444C-87D4-58CA1E6F300D} - {EF5E94AB-B646-4E5B-A058-52EF07B8351C} = {EF5E94AB-B646-4E5B-A058-52EF07B8351C} - {F4F4BCAA-EA59-445C-A119-3E6C29647A51} = {F4F4BCAA-EA59-445C-A119-3E6C29647A51} - {F54ABC59-5C00-414A-A9BA-BAF26D1699F0} = {F54ABC59-5C00-414A-A9BA-BAF26D1699F0} - {FC0E1FD0-5DD7-4041-A1C9-CD3C376E4EED} = {FC0E1FD0-5DD7-4041-A1C9-CD3C376E4EED} - {8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942} = {8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942} - {326E9795-E760-410A-B69A-3F79DB3F5243} = {326E9795-E760-410A-B69A-3F79DB3F5243} - {1C16337B-ACF3-4D03-AA90-851C5B5EADA6} = {1C16337B-ACF3-4D03-AA90-851C5B5EADA6} - {238CE175-76CE-4A25-A676-69D115885601} = {238CE175-76CE-4A25-A676-69D115885601} - {1832A374-8A74-4F9E-B536-69A699B3E165} = {1832A374-8A74-4F9E-B536-69A699B3E165} - {21E22961-22BF-4493-BD3A-868F93DA5179} = {21E22961-22BF-4493-BD3A-868F93DA5179} - {EC8B7909-62AF-470D-A75D-E1D89C837142} = {EC8B7909-62AF-470D-A75D-E1D89C837142} {0B469837-3D46-484A-AFB3-C5A6C68730B9} = {0B469837-3D46-484A-AFB3-C5A6C68730B9} + {EC8B7909-62AF-470D-A75D-E1D89C837142} = {EC8B7909-62AF-470D-A75D-E1D89C837142} + {21E22961-22BF-4493-BD3A-868F93DA5179} = {21E22961-22BF-4493-BD3A-868F93DA5179} + {1832A374-8A74-4F9E-B536-69A699B3E165} = {1832A374-8A74-4F9E-B536-69A699B3E165} + {238CE175-76CE-4A25-A676-69D115885601} = {238CE175-76CE-4A25-A676-69D115885601} + {1C16337B-ACF3-4D03-AA90-851C5B5EADA6} = {1C16337B-ACF3-4D03-AA90-851C5B5EADA6} + {326E9795-E760-410A-B69A-3F79DB3F5243} = {326E9795-E760-410A-B69A-3F79DB3F5243} + {8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942} = {8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942} + {FC0E1FD0-5DD7-4041-A1C9-CD3C376E4EED} = {FC0E1FD0-5DD7-4041-A1C9-CD3C376E4EED} + {F54ABC59-5C00-414A-A9BA-BAF26D1699F0} = {F54ABC59-5C00-414A-A9BA-BAF26D1699F0} + {EF5E94AB-B646-4E5B-A058-52EF07B8351C} = {EF5E94AB-B646-4E5B-A058-52EF07B8351C} + {CD9CA56E-4E94-444C-87D4-58CA1E6F300D} = {CD9CA56E-4E94-444C-87D4-58CA1E6F300D} + {C66B126D-0ECE-4CA2-B6DC-FA780AFBBF09} = {C66B126D-0ECE-4CA2-B6DC-FA780AFBBF09} + {C564F145-9172-42C3-BFCB-6014CA97DBCD} = {C564F145-9172-42C3-BFCB-6014CA97DBCD} + {C0334F9A-1168-4101-9DD8-C30FB252D435} = {C0334F9A-1168-4101-9DD8-C30FB252D435} + {B55CA863-B374-4BAF-95AC-539E4FA4C90C} = {B55CA863-B374-4BAF-95AC-539E4FA4C90C} + {AA8A5A85-592B-4357-BC60-E0E91E026AF6} = {AA8A5A85-592B-4357-BC60-E0E91E026AF6} + {A508ADD3-CECE-4E0F-8448-2F5E454DF551} = {A508ADD3-CECE-4E0F-8448-2F5E454DF551} + {8423AF0D-4B88-4EBF-94E1-E4D00D00E21C} = {8423AF0D-4B88-4EBF-94E1-E4D00D00E21C} + {7100F41F-868D-4E99-80A2-AF8E6574749D} = {7100F41F-868D-4E99-80A2-AF8E6574749D} + {5916D37D-8C97-424F-A904-74E52594C2D6} = {5916D37D-8C97-424F-A904-74E52594C2D6} + {2A70CBF0-847E-4E3A-B926-542A656DC7FE} = {2A70CBF0-847E-4E3A-B926-542A656DC7FE} + {5ECEC9E5-8F23-47B6-93E0-C3B328B3BE65} = {5ECEC9E5-8F23-47B6-93E0-C3B328B3BE65} + {60B43839-95E6-4526-A661-209F16335E0E} = {60B43839-95E6-4526-A661-209F16335E0E} EndProjectSection EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "V8", "V8", "{B353A6A5-9551-4B76-908E-0F0A9B31E4CE}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "googleurl", "..\googleurl\build\googleurl.vcproj", "{EF5E94AB-B646-4E5B-A058-52EF07B8351C}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "googleurl", "..\build\temp_gyp\googleurl.vcproj", "{EF5E94AB-B646-4E5B-A058-52EF07B8351C}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "modp_b64", "..\third_party\modp_b64\modp_b64.vcproj", "{7100F41F-868D-4E99-80A2-AF8E6574749D}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "activex_shim", "..\webkit\activex_shim\activex_shim.vcproj", "{F4F4BCAA-EA59-445C-A119-3E6C29647A51}" - ProjectSection(ProjectDependencies) = postProject - {8C27D792-2648-4F5E-9ED0-374276327308} = {8C27D792-2648-4F5E-9ED0-374276327308} - {EF5E94AB-B646-4E5B-A058-52EF07B8351C} = {EF5E94AB-B646-4E5B-A058-52EF07B8351C} - EndProjectSection -EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "net", "..\net\net.vcproj", "{326E9795-E760-410A-B69A-3F79DB3F5243}" ProjectSection(ProjectDependencies) = postProject - {8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942} = {8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942} {E13045CD-7E1F-4A41-9B18-8D288B2E7B41} = {E13045CD-7E1F-4A41-9B18-8D288B2E7B41} + {8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942} = {8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "base", "..\base\base.vcproj", "{1832A374-8A74-4F9E-B536-69A699B3E165}" - ProjectSection(ProjectDependencies) = postProject - {8C27D792-2648-4F5E-9ED0-374276327308} = {8C27D792-2648-4F5E-9ED0-374276327308} - EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "base_gfx", "..\base\base_gfx.vcproj", "{A508ADD3-CECE-4E0F-8448-2F5E454DF551}" EndProject @@ -130,8 +111,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "default_plugin", "..\webkit EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "v8_snapshot", "..\v8\tools\visual_studio\v8_snapshot.vcproj", "{C0334F9A-1168-4101-9DD8-C30FB252D435}" ProjectSection(ProjectDependencies) = postProject - {865575D0-37E2-405E-8CBA-5F6C485B5A26} = {865575D0-37E2-405E-8CBA-5F6C485B5A26} {0DDBDA8B-A49F-4CC7-A1D5-5BB8297C8A3F} = {0DDBDA8B-A49F-4CC7-A1D5-5BB8297C8A3F} + {865575D0-37E2-405E-8CBA-5F6C485B5A26} = {865575D0-37E2-405E-8CBA-5F6C485B5A26} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sdch", "..\sdch\sdch.vcproj", "{F54ABC59-5C00-414A-A9BA-BAF26D1699F0}" @@ -142,9 +123,10 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tools", "Tools", "{A507014E EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "tld_cleanup", "..\net\tld_cleanup.vcproj", "{E13045CD-7E1F-4A41-9B18-8D288B2E7B41}" ProjectSection(ProjectDependencies) = postProject - {EF5E94AB-B646-4E5B-A058-52EF07B8351C} = {EF5E94AB-B646-4E5B-A058-52EF07B8351C} - {8C27D792-2648-4F5E-9ED0-374276327308} = {8C27D792-2648-4F5E-9ED0-374276327308} {1832A374-8A74-4F9E-B536-69A699B3E165} = {1832A374-8A74-4F9E-B536-69A699B3E165} + {EF5E94AB-B646-4E5B-A058-52EF07B8351C} = {EF5E94AB-B646-4E5B-A058-52EF07B8351C} + {9E2EFAAB-02B7-4A82-B664-1E98DF6D1953} = {9E2EFAAB-02B7-4A82-B664-1E98DF6D1953} + {14E7F2BB-B8FC-4DC1-B04D-31C06BDFA1D9} = {14E7F2BB-B8FC-4DC1-B04D-31C06BDFA1D9} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "v8_mksnapshot", "..\v8\tools\visual_studio\v8_mksnapshot.vcproj", "{865575D0-37E2-405E-8CBA-5F6C485B5A26}" @@ -163,12 +145,10 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "webkit_strings", "..\webkit EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cefclient", "tests\cefclient\cefclient.vcproj", "{6617FED9-C5D4-4907-BF55-A90062A6683F}" ProjectSection(ProjectDependencies) = postProject - {A9D6DC71-C0DC-4549-AEA0-3B15B44E86A9} = {A9D6DC71-C0DC-4549-AEA0-3B15B44E86A9} {C13650D5-CF1A-4259-BE45-B1EBA6280E47} = {C13650D5-CF1A-4259-BE45-B1EBA6280E47} + {A9D6DC71-C0DC-4549-AEA0-3B15B44E86A9} = {A9D6DC71-C0DC-4549-AEA0-3B15B44E86A9} EndProjectSection EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "icudt", "..\third_party\icu38\build\icudt.vcproj", "{A0D94973-D355-47A5-A1E2-3456F321F010}" -EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "net_resources", "..\net\net_resources.vcproj", "{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "webkit_resources", "..\webkit\webkit_resources.vcproj", "{0B469837-3D46-484A-AFB3-C5A6C68730B9}" @@ -180,38 +160,38 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "v8_snapshot_cc", "..\v8\too EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libcef_dll", "libcef_dll\libcef_dll.vcproj", "{C13650D5-CF1A-4259-BE45-B1EBA6280E47}" ProjectSection(ProjectDependencies) = postProject - {6AE76406-B03B-11DD-94B1-80B556D89593} = {6AE76406-B03B-11DD-94B1-80B556D89593} - {0B945915-31A7-4A07-A5B5-568D737A39B1} = {0B945915-31A7-4A07-A5B5-568D737A39B1} - {EC8B7909-62AF-470D-A75D-E1D89C837142} = {EC8B7909-62AF-470D-A75D-E1D89C837142} - {D7A94F58-576A-45D9-A45F-EB87C63ABBB0} = {D7A94F58-576A-45D9-A45F-EB87C63ABBB0} - {8423AF0D-4B88-4EBF-94E1-E4D00D00E21C} = {8423AF0D-4B88-4EBF-94E1-E4D00D00E21C} - {7100F41F-868D-4E99-80A2-AF8E6574749D} = {7100F41F-868D-4E99-80A2-AF8E6574749D} - {0B469837-3D46-484A-AFB3-C5A6C68730B9} = {0B469837-3D46-484A-AFB3-C5A6C68730B9} - {60B43839-95E6-4526-A661-209F16335E0E} = {60B43839-95E6-4526-A661-209F16335E0E} - {C564F145-9172-42C3-BFCB-6014CA97DBCD} = {C564F145-9172-42C3-BFCB-6014CA97DBCD} - {FA39524D-3067-4141-888D-28A86C66F2B9} = {FA39524D-3067-4141-888D-28A86C66F2B9} - {F54ABC59-5C00-414A-A9BA-BAF26D1699F0} = {F54ABC59-5C00-414A-A9BA-BAF26D1699F0} - {21E22961-22BF-4493-BD3A-868F93DA5179} = {21E22961-22BF-4493-BD3A-868F93DA5179} - {B55CA863-B374-4BAF-95AC-539E4FA4C90C} = {B55CA863-B374-4BAF-95AC-539E4FA4C90C} - {C66B126D-0ECE-4CA2-B6DC-FA780AFBBF09} = {C66B126D-0ECE-4CA2-B6DC-FA780AFBBF09} - {CD9CA56E-4E94-444C-87D4-58CA1E6F300D} = {CD9CA56E-4E94-444C-87D4-58CA1E6F300D} - {1832A374-8A74-4F9E-B536-69A699B3E165} = {1832A374-8A74-4F9E-B536-69A699B3E165} - {238CE175-76CE-4A25-A676-69D115885601} = {238CE175-76CE-4A25-A676-69D115885601} - {1C16337B-ACF3-4D03-AA90-851C5B5EADA6} = {1C16337B-ACF3-4D03-AA90-851C5B5EADA6} - {5916D37D-8C97-424F-A904-74E52594C2D6} = {5916D37D-8C97-424F-A904-74E52594C2D6} - {AA8A5A85-592B-4357-BC60-E0E91E026AF6} = {AA8A5A85-592B-4357-BC60-E0E91E026AF6} - {8C27D792-2648-4F5E-9ED0-374276327308} = {8C27D792-2648-4F5E-9ED0-374276327308} - {326E9795-E760-410A-B69A-3F79DB3F5243} = {326E9795-E760-410A-B69A-3F79DB3F5243} - {C0334F9A-1168-4101-9DD8-C30FB252D435} = {C0334F9A-1168-4101-9DD8-C30FB252D435} - {F4F4BCAA-EA59-445C-A119-3E6C29647A51} = {F4F4BCAA-EA59-445C-A119-3E6C29647A51} - {EF5E94AB-B646-4E5B-A058-52EF07B8351C} = {EF5E94AB-B646-4E5B-A058-52EF07B8351C} - {8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942} = {8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942} - {FC0E1FD0-5DD7-4041-A1C9-CD3C376E4EED} = {FC0E1FD0-5DD7-4041-A1C9-CD3C376E4EED} - {A508ADD3-CECE-4E0F-8448-2F5E454DF551} = {A508ADD3-CECE-4E0F-8448-2F5E454DF551} - {2A70CBF0-847E-4E3A-B926-542A656DC7FE} = {2A70CBF0-847E-4E3A-B926-542A656DC7FE} {5ECEC9E5-8F23-47B6-93E0-C3B328B3BE65} = {5ECEC9E5-8F23-47B6-93E0-C3B328B3BE65} - {49909552-0B0C-4C14-8CF6-DB8A2ADE0934} = {49909552-0B0C-4C14-8CF6-DB8A2ADE0934} + {2A70CBF0-847E-4E3A-B926-542A656DC7FE} = {2A70CBF0-847E-4E3A-B926-542A656DC7FE} + {A508ADD3-CECE-4E0F-8448-2F5E454DF551} = {A508ADD3-CECE-4E0F-8448-2F5E454DF551} + {FC0E1FD0-5DD7-4041-A1C9-CD3C376E4EED} = {FC0E1FD0-5DD7-4041-A1C9-CD3C376E4EED} + {8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942} = {8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942} + {EF5E94AB-B646-4E5B-A058-52EF07B8351C} = {EF5E94AB-B646-4E5B-A058-52EF07B8351C} + {C0334F9A-1168-4101-9DD8-C30FB252D435} = {C0334F9A-1168-4101-9DD8-C30FB252D435} + {326E9795-E760-410A-B69A-3F79DB3F5243} = {326E9795-E760-410A-B69A-3F79DB3F5243} + {AA8A5A85-592B-4357-BC60-E0E91E026AF6} = {AA8A5A85-592B-4357-BC60-E0E91E026AF6} + {5916D37D-8C97-424F-A904-74E52594C2D6} = {5916D37D-8C97-424F-A904-74E52594C2D6} + {1C16337B-ACF3-4D03-AA90-851C5B5EADA6} = {1C16337B-ACF3-4D03-AA90-851C5B5EADA6} + {238CE175-76CE-4A25-A676-69D115885601} = {238CE175-76CE-4A25-A676-69D115885601} + {1832A374-8A74-4F9E-B536-69A699B3E165} = {1832A374-8A74-4F9E-B536-69A699B3E165} + {CD9CA56E-4E94-444C-87D4-58CA1E6F300D} = {CD9CA56E-4E94-444C-87D4-58CA1E6F300D} + {C66B126D-0ECE-4CA2-B6DC-FA780AFBBF09} = {C66B126D-0ECE-4CA2-B6DC-FA780AFBBF09} + {B55CA863-B374-4BAF-95AC-539E4FA4C90C} = {B55CA863-B374-4BAF-95AC-539E4FA4C90C} + {21E22961-22BF-4493-BD3A-868F93DA5179} = {21E22961-22BF-4493-BD3A-868F93DA5179} + {F54ABC59-5C00-414A-A9BA-BAF26D1699F0} = {F54ABC59-5C00-414A-A9BA-BAF26D1699F0} + {FA39524D-3067-4141-888D-28A86C66F2B9} = {FA39524D-3067-4141-888D-28A86C66F2B9} + {C564F145-9172-42C3-BFCB-6014CA97DBCD} = {C564F145-9172-42C3-BFCB-6014CA97DBCD} + {60B43839-95E6-4526-A661-209F16335E0E} = {60B43839-95E6-4526-A661-209F16335E0E} + {0B469837-3D46-484A-AFB3-C5A6C68730B9} = {0B469837-3D46-484A-AFB3-C5A6C68730B9} + {7100F41F-868D-4E99-80A2-AF8E6574749D} = {7100F41F-868D-4E99-80A2-AF8E6574749D} + {8423AF0D-4B88-4EBF-94E1-E4D00D00E21C} = {8423AF0D-4B88-4EBF-94E1-E4D00D00E21C} + {D7A94F58-576A-45D9-A45F-EB87C63ABBB0} = {D7A94F58-576A-45D9-A45F-EB87C63ABBB0} + {EC8B7909-62AF-470D-A75D-E1D89C837142} = {EC8B7909-62AF-470D-A75D-E1D89C837142} + {0B945915-31A7-4A07-A5B5-568D737A39B1} = {0B945915-31A7-4A07-A5B5-568D737A39B1} + {6AE76406-B03B-11DD-94B1-80B556D89593} = {6AE76406-B03B-11DD-94B1-80B556D89593} + {14E7F2BB-B8FC-4DC1-B04D-31C06BDFA1D9} = {14E7F2BB-B8FC-4DC1-B04D-31C06BDFA1D9} {9E5416B9-B91B-4029-93F4-102C1AD5CAF4} = {9E5416B9-B91B-4029-93F4-102C1AD5CAF4} + {9E2EFAAB-02B7-4A82-B664-1E98DF6D1953} = {9E2EFAAB-02B7-4A82-B664-1E98DF6D1953} + {49909552-0B0C-4C14-8CF6-DB8A2ADE0934} = {49909552-0B0C-4C14-8CF6-DB8A2ADE0934} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libcef_dll_wrapper", "libcef_dll\wrapper\libcef_dll_wrapper.vcproj", "{A9D6DC71-C0DC-4549-AEA0-3B15B44E86A9}" @@ -221,8 +201,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libcef_dll_wrapper", "libce EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "webkit", "..\webkit\WebKit.vcproj", "{5ECEC9E5-8F23-47B6-93E0-C3B328B3BE65}" ProjectSection(ProjectDependencies) = postProject - {2E2D3301-2EC4-4C0F-B889-87073B30F673} = {2E2D3301-2EC4-4C0F-B889-87073B30F673} {1C16337B-ACF3-4D03-AA90-851C5B5EADA6} = {1C16337B-ACF3-4D03-AA90-851C5B5EADA6} + {2E2D3301-2EC4-4C0F-B889-87073B30F673} = {2E2D3301-2EC4-4C0F-B889-87073B30F673} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "config", "..\webkit\config.vcproj", "{2E2D3301-2EC4-4C0F-B889-87073B30F673}" @@ -254,6 +234,15 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "patch", "patch\patch.vcproj EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "appcache", "..\webkit\appcache.vcproj", "{0B945915-31A7-4A07-A5B5-568D737A39B1}" EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "icudata", "..\third_party\icu\icudata.vcproj", "{D3A97815-3309-44F8-B9BB-CBBE2393A454}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "icui18n", "..\third_party\icu\icui18n.vcproj", "{14E7F2BB-B8FC-4DC1-B04D-31C06BDFA1D9}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "icuuc", "..\third_party\icu\icuuc.vcproj", "{9E2EFAAB-02B7-4A82-B664-1E98DF6D1953}" + ProjectSection(ProjectDependencies) = postProject + {D3A97815-3309-44F8-B9BB-CBBE2393A454} = {D3A97815-3309-44F8-B9BB-CBBE2393A454} + EndProjectSection +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Mixed Platforms = Debug|Mixed Platforms @@ -346,22 +335,6 @@ Global {6EAD4A4B-2BBC-4974-8E45-BB5C16CC2AC9}.Release|Mixed Platforms.Build.0 = Release|Win32 {6EAD4A4B-2BBC-4974-8E45-BB5C16CC2AC9}.Release|Win32.ActiveCfg = Release|Win32 {6EAD4A4B-2BBC-4974-8E45-BB5C16CC2AC9}.Release|Win32.Build.0 = Release|Win32 - {8C27D792-2648-4F5E-9ED0-374276327308}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 - {8C27D792-2648-4F5E-9ED0-374276327308}.Debug|Mixed Platforms.Build.0 = Debug|Win32 - {8C27D792-2648-4F5E-9ED0-374276327308}.Debug|Win32.ActiveCfg = Debug|Win32 - {8C27D792-2648-4F5E-9ED0-374276327308}.Debug|Win32.Build.0 = Debug|Win32 - {8C27D792-2648-4F5E-9ED0-374276327308}.Purify|Mixed Platforms.ActiveCfg = Release|Win32 - {8C27D792-2648-4F5E-9ED0-374276327308}.Purify|Mixed Platforms.Build.0 = Release|Win32 - {8C27D792-2648-4F5E-9ED0-374276327308}.Purify|Win32.ActiveCfg = Release|Win32 - {8C27D792-2648-4F5E-9ED0-374276327308}.Purify|Win32.Build.0 = Release|Win32 - {8C27D792-2648-4F5E-9ED0-374276327308}.Release - no tcmalloc|Mixed Platforms.ActiveCfg = Release|Win32 - {8C27D792-2648-4F5E-9ED0-374276327308}.Release - no tcmalloc|Mixed Platforms.Build.0 = Release|Win32 - {8C27D792-2648-4F5E-9ED0-374276327308}.Release - no tcmalloc|Win32.ActiveCfg = Release|Win32 - {8C27D792-2648-4F5E-9ED0-374276327308}.Release - no tcmalloc|Win32.Build.0 = Release|Win32 - {8C27D792-2648-4F5E-9ED0-374276327308}.Release|Mixed Platforms.ActiveCfg = Release|Win32 - {8C27D792-2648-4F5E-9ED0-374276327308}.Release|Mixed Platforms.Build.0 = Release|Win32 - {8C27D792-2648-4F5E-9ED0-374276327308}.Release|Win32.ActiveCfg = Release|Win32 - {8C27D792-2648-4F5E-9ED0-374276327308}.Release|Win32.Build.0 = Release|Win32 {C564F145-9172-42C3-BFCB-6014CA97DBCD}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 {C564F145-9172-42C3-BFCB-6014CA97DBCD}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {C564F145-9172-42C3-BFCB-6014CA97DBCD}.Debug|Win32.ActiveCfg = Debug|Win32 @@ -521,22 +494,6 @@ Global {7100F41F-868D-4E99-80A2-AF8E6574749D}.Release|Mixed Platforms.Build.0 = Release|Win32 {7100F41F-868D-4E99-80A2-AF8E6574749D}.Release|Win32.ActiveCfg = Release|Win32 {7100F41F-868D-4E99-80A2-AF8E6574749D}.Release|Win32.Build.0 = Release|Win32 - {F4F4BCAA-EA59-445C-A119-3E6C29647A51}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 - {F4F4BCAA-EA59-445C-A119-3E6C29647A51}.Debug|Mixed Platforms.Build.0 = Debug|Win32 - {F4F4BCAA-EA59-445C-A119-3E6C29647A51}.Debug|Win32.ActiveCfg = Debug|Win32 - {F4F4BCAA-EA59-445C-A119-3E6C29647A51}.Debug|Win32.Build.0 = Debug|Win32 - {F4F4BCAA-EA59-445C-A119-3E6C29647A51}.Purify|Mixed Platforms.ActiveCfg = Purify|Win32 - {F4F4BCAA-EA59-445C-A119-3E6C29647A51}.Purify|Mixed Platforms.Build.0 = Purify|Win32 - {F4F4BCAA-EA59-445C-A119-3E6C29647A51}.Purify|Win32.ActiveCfg = Purify|Win32 - {F4F4BCAA-EA59-445C-A119-3E6C29647A51}.Purify|Win32.Build.0 = Purify|Win32 - {F4F4BCAA-EA59-445C-A119-3E6C29647A51}.Release - no tcmalloc|Mixed Platforms.ActiveCfg = Release - no tcmalloc|Win32 - {F4F4BCAA-EA59-445C-A119-3E6C29647A51}.Release - no tcmalloc|Mixed Platforms.Build.0 = Release - no tcmalloc|Win32 - {F4F4BCAA-EA59-445C-A119-3E6C29647A51}.Release - no tcmalloc|Win32.ActiveCfg = Release - no tcmalloc|Win32 - {F4F4BCAA-EA59-445C-A119-3E6C29647A51}.Release - no tcmalloc|Win32.Build.0 = Release - no tcmalloc|Win32 - {F4F4BCAA-EA59-445C-A119-3E6C29647A51}.Release|Mixed Platforms.ActiveCfg = Release|Win32 - {F4F4BCAA-EA59-445C-A119-3E6C29647A51}.Release|Mixed Platforms.Build.0 = Release|Win32 - {F4F4BCAA-EA59-445C-A119-3E6C29647A51}.Release|Win32.ActiveCfg = Release|Win32 - {F4F4BCAA-EA59-445C-A119-3E6C29647A51}.Release|Win32.Build.0 = Release|Win32 {326E9795-E760-410A-B69A-3F79DB3F5243}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 {326E9795-E760-410A-B69A-3F79DB3F5243}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {326E9795-E760-410A-B69A-3F79DB3F5243}.Debug|Win32.ActiveCfg = Debug|Win32 @@ -729,22 +686,6 @@ Global {6617FED9-C5D4-4907-BF55-A90062A6683F}.Release|Mixed Platforms.Build.0 = Release|Win32 {6617FED9-C5D4-4907-BF55-A90062A6683F}.Release|Win32.ActiveCfg = Release|Win32 {6617FED9-C5D4-4907-BF55-A90062A6683F}.Release|Win32.Build.0 = Release|Win32 - {A0D94973-D355-47A5-A1E2-3456F321F010}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 - {A0D94973-D355-47A5-A1E2-3456F321F010}.Debug|Mixed Platforms.Build.0 = Debug|Win32 - {A0D94973-D355-47A5-A1E2-3456F321F010}.Debug|Win32.ActiveCfg = Debug|Win32 - {A0D94973-D355-47A5-A1E2-3456F321F010}.Debug|Win32.Build.0 = Debug|Win32 - {A0D94973-D355-47A5-A1E2-3456F321F010}.Purify|Mixed Platforms.ActiveCfg = Release|Win32 - {A0D94973-D355-47A5-A1E2-3456F321F010}.Purify|Mixed Platforms.Build.0 = Release|Win32 - {A0D94973-D355-47A5-A1E2-3456F321F010}.Purify|Win32.ActiveCfg = Release|Win32 - {A0D94973-D355-47A5-A1E2-3456F321F010}.Purify|Win32.Build.0 = Release|Win32 - {A0D94973-D355-47A5-A1E2-3456F321F010}.Release - no tcmalloc|Mixed Platforms.ActiveCfg = Release|Win32 - {A0D94973-D355-47A5-A1E2-3456F321F010}.Release - no tcmalloc|Mixed Platforms.Build.0 = Release|Win32 - {A0D94973-D355-47A5-A1E2-3456F321F010}.Release - no tcmalloc|Win32.ActiveCfg = Release|Win32 - {A0D94973-D355-47A5-A1E2-3456F321F010}.Release - no tcmalloc|Win32.Build.0 = Release|Win32 - {A0D94973-D355-47A5-A1E2-3456F321F010}.Release|Mixed Platforms.ActiveCfg = Release|Win32 - {A0D94973-D355-47A5-A1E2-3456F321F010}.Release|Mixed Platforms.Build.0 = Release|Win32 - {A0D94973-D355-47A5-A1E2-3456F321F010}.Release|Win32.ActiveCfg = Release|Win32 - {A0D94973-D355-47A5-A1E2-3456F321F010}.Release|Win32.Build.0 = Release|Win32 {8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 {8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}.Debug|Win32.ActiveCfg = Debug|Win32 @@ -985,6 +926,54 @@ Global {0B945915-31A7-4A07-A5B5-568D737A39B1}.Release|Mixed Platforms.Build.0 = Release|Win32 {0B945915-31A7-4A07-A5B5-568D737A39B1}.Release|Win32.ActiveCfg = Release|Win32 {0B945915-31A7-4A07-A5B5-568D737A39B1}.Release|Win32.Build.0 = Release|Win32 + {D3A97815-3309-44F8-B9BB-CBBE2393A454}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 + {D3A97815-3309-44F8-B9BB-CBBE2393A454}.Debug|Mixed Platforms.Build.0 = Debug|Win32 + {D3A97815-3309-44F8-B9BB-CBBE2393A454}.Debug|Win32.ActiveCfg = Debug|Win32 + {D3A97815-3309-44F8-B9BB-CBBE2393A454}.Debug|Win32.Build.0 = Debug|Win32 + {D3A97815-3309-44F8-B9BB-CBBE2393A454}.Purify|Mixed Platforms.ActiveCfg = Purify|Win32 + {D3A97815-3309-44F8-B9BB-CBBE2393A454}.Purify|Mixed Platforms.Build.0 = Purify|Win32 + {D3A97815-3309-44F8-B9BB-CBBE2393A454}.Purify|Win32.ActiveCfg = Purify|Win32 + {D3A97815-3309-44F8-B9BB-CBBE2393A454}.Purify|Win32.Build.0 = Purify|Win32 + {D3A97815-3309-44F8-B9BB-CBBE2393A454}.Release - no tcmalloc|Mixed Platforms.ActiveCfg = Release - no tcmalloc|Win32 + {D3A97815-3309-44F8-B9BB-CBBE2393A454}.Release - no tcmalloc|Mixed Platforms.Build.0 = Release - no tcmalloc|Win32 + {D3A97815-3309-44F8-B9BB-CBBE2393A454}.Release - no tcmalloc|Win32.ActiveCfg = Release - no tcmalloc|Win32 + {D3A97815-3309-44F8-B9BB-CBBE2393A454}.Release - no tcmalloc|Win32.Build.0 = Release - no tcmalloc|Win32 + {D3A97815-3309-44F8-B9BB-CBBE2393A454}.Release|Mixed Platforms.ActiveCfg = Release|Win32 + {D3A97815-3309-44F8-B9BB-CBBE2393A454}.Release|Mixed Platforms.Build.0 = Release|Win32 + {D3A97815-3309-44F8-B9BB-CBBE2393A454}.Release|Win32.ActiveCfg = Release|Win32 + {D3A97815-3309-44F8-B9BB-CBBE2393A454}.Release|Win32.Build.0 = Release|Win32 + {14E7F2BB-B8FC-4DC1-B04D-31C06BDFA1D9}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 + {14E7F2BB-B8FC-4DC1-B04D-31C06BDFA1D9}.Debug|Mixed Platforms.Build.0 = Debug|Win32 + {14E7F2BB-B8FC-4DC1-B04D-31C06BDFA1D9}.Debug|Win32.ActiveCfg = Debug|Win32 + {14E7F2BB-B8FC-4DC1-B04D-31C06BDFA1D9}.Debug|Win32.Build.0 = Debug|Win32 + {14E7F2BB-B8FC-4DC1-B04D-31C06BDFA1D9}.Purify|Mixed Platforms.ActiveCfg = Purify|Win32 + {14E7F2BB-B8FC-4DC1-B04D-31C06BDFA1D9}.Purify|Mixed Platforms.Build.0 = Purify|Win32 + {14E7F2BB-B8FC-4DC1-B04D-31C06BDFA1D9}.Purify|Win32.ActiveCfg = Purify|Win32 + {14E7F2BB-B8FC-4DC1-B04D-31C06BDFA1D9}.Purify|Win32.Build.0 = Purify|Win32 + {14E7F2BB-B8FC-4DC1-B04D-31C06BDFA1D9}.Release - no tcmalloc|Mixed Platforms.ActiveCfg = Release - no tcmalloc|Win32 + {14E7F2BB-B8FC-4DC1-B04D-31C06BDFA1D9}.Release - no tcmalloc|Mixed Platforms.Build.0 = Release - no tcmalloc|Win32 + {14E7F2BB-B8FC-4DC1-B04D-31C06BDFA1D9}.Release - no tcmalloc|Win32.ActiveCfg = Release - no tcmalloc|Win32 + {14E7F2BB-B8FC-4DC1-B04D-31C06BDFA1D9}.Release - no tcmalloc|Win32.Build.0 = Release - no tcmalloc|Win32 + {14E7F2BB-B8FC-4DC1-B04D-31C06BDFA1D9}.Release|Mixed Platforms.ActiveCfg = Release|Win32 + {14E7F2BB-B8FC-4DC1-B04D-31C06BDFA1D9}.Release|Mixed Platforms.Build.0 = Release|Win32 + {14E7F2BB-B8FC-4DC1-B04D-31C06BDFA1D9}.Release|Win32.ActiveCfg = Release|Win32 + {14E7F2BB-B8FC-4DC1-B04D-31C06BDFA1D9}.Release|Win32.Build.0 = Release|Win32 + {9E2EFAAB-02B7-4A82-B664-1E98DF6D1953}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 + {9E2EFAAB-02B7-4A82-B664-1E98DF6D1953}.Debug|Mixed Platforms.Build.0 = Debug|Win32 + {9E2EFAAB-02B7-4A82-B664-1E98DF6D1953}.Debug|Win32.ActiveCfg = Debug|Win32 + {9E2EFAAB-02B7-4A82-B664-1E98DF6D1953}.Debug|Win32.Build.0 = Debug|Win32 + {9E2EFAAB-02B7-4A82-B664-1E98DF6D1953}.Purify|Mixed Platforms.ActiveCfg = Purify|Win32 + {9E2EFAAB-02B7-4A82-B664-1E98DF6D1953}.Purify|Mixed Platforms.Build.0 = Purify|Win32 + {9E2EFAAB-02B7-4A82-B664-1E98DF6D1953}.Purify|Win32.ActiveCfg = Purify|Win32 + {9E2EFAAB-02B7-4A82-B664-1E98DF6D1953}.Purify|Win32.Build.0 = Purify|Win32 + {9E2EFAAB-02B7-4A82-B664-1E98DF6D1953}.Release - no tcmalloc|Mixed Platforms.ActiveCfg = Release - no tcmalloc|Win32 + {9E2EFAAB-02B7-4A82-B664-1E98DF6D1953}.Release - no tcmalloc|Mixed Platforms.Build.0 = Release - no tcmalloc|Win32 + {9E2EFAAB-02B7-4A82-B664-1E98DF6D1953}.Release - no tcmalloc|Win32.ActiveCfg = Release - no tcmalloc|Win32 + {9E2EFAAB-02B7-4A82-B664-1E98DF6D1953}.Release - no tcmalloc|Win32.Build.0 = Release - no tcmalloc|Win32 + {9E2EFAAB-02B7-4A82-B664-1E98DF6D1953}.Release|Mixed Platforms.ActiveCfg = Release|Win32 + {9E2EFAAB-02B7-4A82-B664-1E98DF6D1953}.Release|Mixed Platforms.Build.0 = Release|Win32 + {9E2EFAAB-02B7-4A82-B664-1E98DF6D1953}.Release|Win32.ActiveCfg = Release|Win32 + {9E2EFAAB-02B7-4A82-B664-1E98DF6D1953}.Release|Win32.Build.0 = Release|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -995,7 +984,6 @@ Global {5ECEC9E5-8F23-47B6-93E0-C3B328B3BE65} = {1088577A-0C49-4DE0-85CD-B68AD0BE55AA} {49909552-0B0C-4C14-8CF6-DB8A2ADE0934} = {1088577A-0C49-4DE0-85CD-B68AD0BE55AA} {C66B126D-0ECE-4CA2-B6DC-FA780AFBBF09} = {CB43561E-A6F8-49E2-96A2-3F2BA1FFF21E} - {F4F4BCAA-EA59-445C-A119-3E6C29647A51} = {CB43561E-A6F8-49E2-96A2-3F2BA1FFF21E} {5916D37D-8C97-424F-A904-74E52594C2D6} = {CB43561E-A6F8-49E2-96A2-3F2BA1FFF21E} {60B43839-95E6-4526-A661-209F16335E0E} = {CB43561E-A6F8-49E2-96A2-3F2BA1FFF21E} {0B469837-3D46-484A-AFB3-C5A6C68730B9} = {CB43561E-A6F8-49E2-96A2-3F2BA1FFF21E} @@ -1020,8 +1008,9 @@ Global {8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942} = {EF78C1F9-AA17-4CA5-B6CB-39B37A73A3DA} {9E5416B9-B91B-4029-93F4-102C1AD5CAF4} = {EF78C1F9-AA17-4CA5-B6CB-39B37A73A3DA} {963C8C1D-059E-49C6-881E-5BE6919113FC} = {EF78C1F9-AA17-4CA5-B6CB-39B37A73A3DA} - {8C27D792-2648-4F5E-9ED0-374276327308} = {1AFC1EC3-24FA-4260-B099-76319EC9977A} - {A0D94973-D355-47A5-A1E2-3456F321F010} = {1AFC1EC3-24FA-4260-B099-76319EC9977A} + {D3A97815-3309-44F8-B9BB-CBBE2393A454} = {1AFC1EC3-24FA-4260-B099-76319EC9977A} + {14E7F2BB-B8FC-4DC1-B04D-31C06BDFA1D9} = {1AFC1EC3-24FA-4260-B099-76319EC9977A} + {9E2EFAAB-02B7-4A82-B664-1E98DF6D1953} = {1AFC1EC3-24FA-4260-B099-76319EC9977A} {B55CA863-B374-4BAF-95AC-539E4FA4C90C} = {873D095E-150E-4262-8C41-2D8ED02F0F57} {FA39524D-3067-4141-888D-28A86C66F2B9} = {08BAF606-555E-4048-A47E-22CFA89A21B4} {6617FED9-C5D4-4907-BF55-A90062A6683F} = {08BAF606-555E-4048-A47E-22CFA89A21B4} diff --git a/libcef/browser_appcache_system.cc b/libcef/browser_appcache_system.cc new file mode 100644 index 000000000..c0eb314d0 --- /dev/null +++ b/libcef/browser_appcache_system.cc @@ -0,0 +1,325 @@ +// Copyright (c) 2009 The Chromium Authors. All rights reserved. Use of this +// source code is governed by a BSD-style license that can be found in the +// LICENSE file. + +#include "precompiled_libcef.h" +#include "browser_appcache_system.h" + +#include "base/lock.h" +#include "base/task.h" +#include "base/waitable_event.h" +#include "webkit/appcache/appcache_interceptor.h" +#include "webkit/appcache/web_application_cache_host_impl.h" +#include "browser_resource_loader_bridge.h" + +using WebKit::WebApplicationCacheHost; +using WebKit::WebApplicationCacheHostClient; +using appcache::WebApplicationCacheHostImpl; +using appcache::AppCacheBackendImpl; +using appcache::AppCacheInterceptor; + + +// BrowserFrontendProxy -------------------------------------------------------- +// Proxies method calls from the backend IO thread to the frontend UI thread. + +class BrowserFrontendProxy + : public base::RefCountedThreadSafe, + public appcache::AppCacheFrontend { + public: + explicit BrowserFrontendProxy(BrowserAppCacheSystem* appcache_system) + : system_(appcache_system) { + } + + void clear_appcache_system() { system_ = NULL; } + + virtual void OnCacheSelected(int host_id, int64 cache_id , + appcache::Status status) { + if (!system_) + return; + if (system_->is_io_thread()) + system_->ui_message_loop()->PostTask(FROM_HERE, NewRunnableMethod( + this, &BrowserFrontendProxy::OnCacheSelected, + host_id, cache_id, status)); + else if (system_->is_ui_thread()) + system_->frontend_impl_.OnCacheSelected(host_id, cache_id, status); + else + NOTREACHED(); + } + + virtual void OnStatusChanged(const std::vector& host_ids, + appcache::Status status) { + if (!system_) + return; + if (system_->is_io_thread()) + system_->ui_message_loop()->PostTask(FROM_HERE, NewRunnableMethod( + this, &BrowserFrontendProxy::OnStatusChanged, host_ids, status)); + else if (system_->is_ui_thread()) + system_->frontend_impl_.OnStatusChanged(host_ids, status); + else + NOTREACHED(); + } + + virtual void OnEventRaised(const std::vector& host_ids, + appcache::EventID event_id) { + if (!system_) + return; + if (system_->is_io_thread()) + system_->ui_message_loop()->PostTask(FROM_HERE, NewRunnableMethod( + this, &BrowserFrontendProxy::OnEventRaised, host_ids, event_id)); + else if (system_->is_ui_thread()) + system_->frontend_impl_.OnEventRaised(host_ids, event_id); + else + NOTREACHED(); + } + + private: + BrowserAppCacheSystem* system_; +}; + + +// BrowserBackendProxy -------------------------------------------------------- +// Proxies method calls from the frontend UI thread to the backend IO thread. + +class BrowserBackendProxy + : public base::RefCountedThreadSafe, + public appcache::AppCacheBackend { + public: + explicit BrowserBackendProxy(BrowserAppCacheSystem* appcache_system) + : system_(appcache_system), event_(true, false) { + get_status_callback_.reset( + NewCallback(this, &BrowserBackendProxy::GetStatusCallback)); + start_update_callback_.reset( + NewCallback(this, &BrowserBackendProxy::StartUpdateCallback)); + swap_cache_callback_.reset( + NewCallback(this, &BrowserBackendProxy::SwapCacheCallback)); + } + + virtual void RegisterHost(int host_id) { + if (system_->is_ui_thread()) { + system_->io_message_loop()->PostTask(FROM_HERE, NewRunnableMethod( + this, &BrowserBackendProxy::RegisterHost, host_id)); + } else if (system_->is_io_thread()) { + system_->backend_impl_->RegisterHost(host_id); + } else { + NOTREACHED(); + } + } + + virtual void UnregisterHost(int host_id) { + if (system_->is_ui_thread()) { + system_->io_message_loop()->PostTask(FROM_HERE, NewRunnableMethod( + this, &BrowserBackendProxy::UnregisterHost, host_id)); + } else if (system_->is_io_thread()) { + system_->backend_impl_->UnregisterHost(host_id); + } else { + NOTREACHED(); + } + } + + virtual void SelectCache(int host_id, + const GURL& document_url, + const int64 cache_document_was_loaded_from, + const GURL& manifest_url) { + if (system_->is_ui_thread()) { + system_->io_message_loop()->PostTask(FROM_HERE, NewRunnableMethod( + this, &BrowserBackendProxy::SelectCache, host_id, document_url, + cache_document_was_loaded_from, manifest_url)); + } else if (system_->is_io_thread()) { + system_->backend_impl_->SelectCache(host_id, document_url, + cache_document_was_loaded_from, + manifest_url); + } else { + NOTREACHED(); + } + } + + virtual void MarkAsForeignEntry(int host_id, const GURL& document_url, + int64 cache_document_was_loaded_from) { + if (system_->is_ui_thread()) { + system_->io_message_loop()->PostTask(FROM_HERE, NewRunnableMethod( + this, &BrowserBackendProxy::MarkAsForeignEntry, host_id, document_url, + cache_document_was_loaded_from)); + } else if (system_->is_io_thread()) { + system_->backend_impl_->MarkAsForeignEntry( + host_id, document_url, + cache_document_was_loaded_from); + } else { + NOTREACHED(); + } + } + + virtual appcache::Status GetStatus(int host_id) { + if (system_->is_ui_thread()) { + status_result_ = appcache::UNCACHED; + event_.Reset(); + system_->io_message_loop()->PostTask(FROM_HERE, NewRunnableMethod( + this, &BrowserBackendProxy::GetStatus, host_id)); + event_.Wait(); + } else if (system_->is_io_thread()) { + system_->backend_impl_->GetStatusWithCallback( + host_id, get_status_callback_.get(), NULL); + } else { + NOTREACHED(); + } + return status_result_; + } + + virtual bool StartUpdate(int host_id) { + if (system_->is_ui_thread()) { + bool_result_ = false; + event_.Reset(); + system_->io_message_loop()->PostTask(FROM_HERE, NewRunnableMethod( + this, &BrowserBackendProxy::StartUpdate, host_id)); + event_.Wait(); + } else if (system_->is_io_thread()) { + system_->backend_impl_->StartUpdateWithCallback( + host_id, start_update_callback_.get(), NULL); + } else { + NOTREACHED(); + } + return bool_result_; + } + + virtual bool SwapCache(int host_id) { + if (system_->is_ui_thread()) { + bool_result_ = false; + event_.Reset(); + system_->io_message_loop()->PostTask(FROM_HERE, NewRunnableMethod( + this, &BrowserBackendProxy::SwapCache, host_id)); + event_.Wait(); + } else if (system_->is_io_thread()) { + system_->backend_impl_->SwapCacheWithCallback( + host_id, swap_cache_callback_.get(), NULL); + } else { + NOTREACHED(); + } + return bool_result_; + } + + void GetStatusCallback(appcache::Status status, void* param) { + status_result_ = status; + event_.Signal(); + } + + void StartUpdateCallback(bool result, void* param) { + bool_result_ = result; + event_.Signal(); + } + + void SwapCacheCallback(bool result, void* param) { + bool_result_ = result; + event_.Signal(); + } + + void SignalEvent() { + event_.Signal(); + } + + private: + BrowserAppCacheSystem* system_; + base::WaitableEvent event_; + bool bool_result_; + appcache::Status status_result_; + scoped_ptr get_status_callback_; + scoped_ptr start_update_callback_; + scoped_ptr swap_cache_callback_; +}; + + +// BrowserAppCacheSystem -------------------------------------------------------- + +// This class only works for a single process browser. +static const int kSingleProcessId = 1; + +// A not so thread safe singleton, but should work for test_shell. +BrowserAppCacheSystem* BrowserAppCacheSystem::instance_ = NULL; + +BrowserAppCacheSystem::BrowserAppCacheSystem() + : io_message_loop_(NULL), ui_message_loop_(NULL), + ALLOW_THIS_IN_INITIALIZER_LIST( + backend_proxy_(new BrowserBackendProxy(this))), + ALLOW_THIS_IN_INITIALIZER_LIST( + frontend_proxy_(new BrowserFrontendProxy(this))), + backend_impl_(NULL), service_(NULL) { + DCHECK(!instance_); + instance_ = this; +} + +BrowserAppCacheSystem::~BrowserAppCacheSystem() { + DCHECK(!io_message_loop_ && !backend_impl_ && !service_); + frontend_proxy_->clear_appcache_system(); // in case a task is in transit + instance_ = NULL; +} + +void BrowserAppCacheSystem::InitOnUIThread( + const FilePath& cache_directory) { + DCHECK(!ui_message_loop_); + DCHECK(!cache_directory.empty()); + ui_message_loop_ = MessageLoop::current(); + cache_directory_ = cache_directory; +} + +void BrowserAppCacheSystem::InitOnIOThread(URLRequestContext* request_context) { + if (!is_initailized_on_ui_thread()) + return; + + DCHECK(!io_message_loop_); + io_message_loop_ = MessageLoop::current(); + io_message_loop_->AddDestructionObserver(this); + + // Recreate and initialize per each IO thread. + service_ = new appcache::AppCacheService(); + backend_impl_ = new appcache::AppCacheBackendImpl(); + service_->Initialize(cache_directory_); + service_->set_request_context(request_context); + backend_impl_->Initialize(service_, frontend_proxy_.get(), kSingleProcessId); + + AppCacheInterceptor::EnsureRegistered(); +} + +WebApplicationCacheHost* BrowserAppCacheSystem::CreateCacheHostForWebKit( + WebApplicationCacheHostClient* client) { + if (!is_initailized_on_ui_thread()) + return NULL; + + DCHECK(is_ui_thread()); + + // The IO thread needs to be running for this system to work. + BrowserResourceLoaderBridge::EnsureIOThread(); + + if (!is_initialized()) + return NULL; + return new WebApplicationCacheHostImpl(client, backend_proxy_.get()); +} + +void BrowserAppCacheSystem::SetExtraRequestBits( + URLRequest* request, int host_id, ResourceType::Type resource_type) { + if (is_initialized()) { + DCHECK(is_io_thread()); + AppCacheInterceptor::SetExtraRequestInfo( + request, service_, kSingleProcessId, host_id, resource_type); + } +} + +void BrowserAppCacheSystem::GetExtraResponseBits( + URLRequest* request, int64* cache_id, GURL* manifest_url) { + if (is_initialized()) { + DCHECK(is_io_thread()); + AppCacheInterceptor::GetExtraResponseInfo( + request, cache_id, manifest_url); + } +} + +void BrowserAppCacheSystem::WillDestroyCurrentMessageLoop() { + DCHECK(is_io_thread()); + DCHECK(backend_impl_->hosts().empty()); + + io_message_loop_ = NULL; + delete backend_impl_; + delete service_; + backend_impl_ = NULL; + service_ = NULL; + + // Just in case the main thread is waiting on it. + backend_proxy_->SignalEvent(); +} diff --git a/libcef/browser_appcache_system.h b/libcef/browser_appcache_system.h index 205983db6..fbb63be3f 100644 --- a/libcef/browser_appcache_system.h +++ b/libcef/browser_appcache_system.h @@ -5,21 +5,118 @@ #ifndef _BROWSER_APPCACHE_SYSTEM_H #define _BROWSER_APPCACHE_SYSTEM_H +#include "base/file_path.h" +#include "base/message_loop.h" #include "webkit/appcache/appcache_backend_impl.h" #include "webkit/appcache/appcache_frontend_impl.h" +#include "webkit/appcache/appcache_service.h" +#include "webkit/glue/resource_type.h" -class BrowserAppCacheSystem { +namespace WebKit { +class WebApplicationCacheHost; +class WebApplicationCacheHostClient; +} +class BrowserBackendProxy; +class BrowserFrontendProxy; +class URLRequest; +class URLRequestContext; + +// A class that composes the constituent parts of an appcache system +// together for use in a single process with two relavant threads, +// a UI thread on which webkit runs and an IO thread on which URLRequests +// are handled. This class conspires with BrowserResourceLoaderBridge to +// retrieve resources from the appcache. +class BrowserAppCacheSystem : public MessageLoop::DestructionObserver { public: - void Initialize() { - backend_impl_.Initialize(NULL, &frontend_impl_); + // Should be instanced somewhere in main(). If not instanced, the public + // static methods are all safe no-ops. + BrowserAppCacheSystem(); + virtual ~BrowserAppCacheSystem(); + + // One-time main UI thread initialization. + static void InitializeOnUIThread(const FilePath& cache_directory) { + if (instance_) + instance_->InitOnUIThread(cache_directory); } - appcache::AppCacheBackend* backend() { return &backend_impl_; } - appcache::AppCacheFrontend* frontend() { return &frontend_impl_; } + // Called by BrowserResourceLoaderBridge's IOThread class. + // Per IO thread initialization. Only one IO thread can exist + // at a time, but after IO thread termination a new one can be + // started on which this method should be called. The instance + // is assumed to outlive the IO thread. + static void InitializeOnIOThread(URLRequestContext* request_context) { + if (instance_) + instance_->InitOnIOThread(request_context); + } + + // Called by TestShellWebKitInit to manufacture a 'host' for webcore. + static WebKit::WebApplicationCacheHost* CreateApplicationCacheHost( + WebKit::WebApplicationCacheHostClient* client) { + return instance_ ? instance_->CreateCacheHostForWebKit(client) : NULL; + } + + // Called by BrowserResourceLoaderBridge to hook into resource loads. + static void SetExtraRequestInfo(URLRequest* request, + int host_id, + ResourceType::Type resource_type) { + if (instance_) + instance_->SetExtraRequestBits(request, host_id, resource_type); + } + + // Called by BrowserResourceLoaderBridge extract extra response bits. + static void GetExtraResponseInfo(URLRequest* request, + int64* cache_id, + GURL* manifest_url) { + if (instance_) + instance_->GetExtraResponseBits(request, cache_id, manifest_url); + } private: - appcache::AppCacheBackendImpl backend_impl_; + friend class BrowserBackendProxy; + friend class BrowserFrontendProxy; + + // A low-tech singleton. + static BrowserAppCacheSystem* instance_; + + // Instance methods called by our static public methods + void InitOnUIThread(const FilePath& cache_directory); + void InitOnIOThread(URLRequestContext* request_context); + WebKit::WebApplicationCacheHost* CreateCacheHostForWebKit( + WebKit::WebApplicationCacheHostClient* client); + void SetExtraRequestBits(URLRequest* request, + int host_id, + ResourceType::Type resource_type); + void GetExtraResponseBits(URLRequest* request, + int64* cache_id, + GURL* manifest_url); + + // Helpers + MessageLoop* io_message_loop() { return io_message_loop_; } + MessageLoop* ui_message_loop() { return ui_message_loop_; } + bool is_io_thread() { return MessageLoop::current() == io_message_loop_; } + bool is_ui_thread() { return MessageLoop::current() == ui_message_loop_; } + bool is_initialized() { + return io_message_loop_ && is_initailized_on_ui_thread(); + } + bool is_initailized_on_ui_thread() { + return ui_message_loop_ && !cache_directory_.empty(); + } + + // IOThread DestructionObserver + virtual void WillDestroyCurrentMessageLoop(); + + FilePath cache_directory_; + MessageLoop* io_message_loop_; + MessageLoop* ui_message_loop_; + scoped_refptr backend_proxy_; + scoped_refptr frontend_proxy_; appcache::AppCacheFrontendImpl frontend_impl_; + + // Created and used only on the IO thread, these do + // not survive IO thread termination. If a new IO thread + // is started new instances will be created. + appcache::AppCacheBackendImpl* backend_impl_; + appcache::AppCacheService* service_; }; #endif // _BROWSER_APPCACHE_SYSTEM_H diff --git a/libcef/browser_drag_delegate.cc b/libcef/browser_drag_delegate.cc index 4795b8a32..b5738c346 100644 --- a/libcef/browser_drag_delegate.cc +++ b/libcef/browser_drag_delegate.cc @@ -38,7 +38,8 @@ void BrowserDragDelegate::OnDragSourceDrop() { gfx::Point client; gfx::Point screen; GetCursorPositions(source_hwnd_, &client, &screen); - webview_->DragSourceEndedAt(client, screen); + webview_->DragSourceEndedAt(client, screen, WebKit::WebDragOperationCopy); + // TODO(snej): Pass the real drag operation instead } void BrowserDragDelegate::OnDragSourceMove() { diff --git a/libcef/browser_drop_delegate.cc b/libcef/browser_drop_delegate.cc index ba5f60821..1b1d347df 100644 --- a/libcef/browser_drop_delegate.cc +++ b/libcef/browser_drop_delegate.cc @@ -11,6 +11,8 @@ #include "webkit/glue/webdropdata.h" #include "webkit/glue/webview.h" +using WebKit::WebDragOperation; +using WebKit::WebDragOperationCopy; using WebKit::WebPoint; // BaseDropTarget methods ---------------------------------------------------- @@ -24,11 +26,14 @@ DWORD BrowserDropDelegate::OnDragEnter(IDataObject* data_object, POINT client_pt = cursor_position; ScreenToClient(GetHWND(), &client_pt); - bool valid = webview_->DragTargetDragEnter( + WebDragOperation op = webview_->DragTargetDragEnter( drop_data.ToDragData(), drop_data.identity, WebPoint(client_pt.x, client_pt.y), - WebPoint(cursor_position.x, cursor_position.y)); - return valid ? DROPEFFECT_COPY : DROPEFFECT_NONE; + WebPoint(cursor_position.x, cursor_position.y), + WebDragOperationCopy); + // TODO(snej): Pass the real drag operation instead + return op ? DROPEFFECT_COPY : DROPEFFECT_NONE; + // TODO(snej): Return the real drop effect constant matching 'op' } DWORD BrowserDropDelegate::OnDragOver(IDataObject* data_object, @@ -37,10 +42,13 @@ DWORD BrowserDropDelegate::OnDragOver(IDataObject* data_object, DWORD effect) { POINT client_pt = cursor_position; ScreenToClient(GetHWND(), &client_pt); - bool valid = webview_->DragTargetDragOver( + WebDragOperation op = webview_->DragTargetDragOver( WebPoint(client_pt.x, client_pt.y), - WebPoint(cursor_position.x, cursor_position.y)); - return valid ? DROPEFFECT_COPY : DROPEFFECT_NONE; + WebPoint(cursor_position.x, cursor_position.y), + WebDragOperationCopy); + // TODO(snej): Pass the real drag operation instead + return op ? DROPEFFECT_COPY : DROPEFFECT_NONE; + // TODO(snej): Return the real drop effect constant matching 'op' } void BrowserDropDelegate::OnDragLeave(IDataObject* data_object) { diff --git a/libcef/browser_impl.h b/libcef/browser_impl.h index 48ecd0926..55e5b72db 100644 --- a/libcef/browser_impl.h +++ b/libcef/browser_impl.h @@ -177,7 +177,7 @@ public: void UIT_SetFocus(WebWidgetHost* host, bool enable); CefRefPtr UIT_CreatePopupWindow(const std::wstring& url); - WebKit::WebWidget* UIT_CreatePopupWidget(WebView* webview); + WebKit::WebWidget* UIT_CreatePopupWidget(); void UIT_ClosePopupWidget(); void UIT_Show(WebKit::WebNavigationPolicy policy); diff --git a/libcef/browser_impl_win.cc b/libcef/browser_impl_win.cc index 5760076cc..bdeee27ab 100644 --- a/libcef/browser_impl_win.cc +++ b/libcef/browser_impl_win.cc @@ -263,7 +263,6 @@ void CefBrowserImpl::UIT_CreateBrowser(const std::wstring& url) webviewhost_.reset( WebViewHost::Create(window_info_.m_hWnd, delegate_.get(), *_Context->GetWebPreferences())); - GetWebView()->SetUseEditorDelegate(true); delegate_->RegisterDragDrop(); // Size the web view window to the browser window @@ -294,7 +293,7 @@ void CefBrowserImpl::UIT_SetFocus(WebWidgetHost* host, bool enable) ::SetFocus(NULL); } -WebKit::WebWidget* CefBrowserImpl::UIT_CreatePopupWidget(WebView* webview) +WebKit::WebWidget* CefBrowserImpl::UIT_CreatePopupWidget() { REQUIRE_UIT(); diff --git a/libcef/browser_request_context.cc b/libcef/browser_request_context.cc index 13c329ec5..8f2b03780 100644 --- a/libcef/browser_request_context.cc +++ b/libcef/browser_request_context.cc @@ -39,7 +39,7 @@ void BrowserRequestContext::Init( net::ProxyConfig proxy_config; host_resolver_ = net::CreateSystemHostResolver(); proxy_service_ = net::ProxyService::Create(no_proxy ? &proxy_config : NULL, - false, NULL, NULL); + false, NULL, NULL, NULL); ssl_config_service_ = net::SSLConfigService::CreateSystemSSLConfigService(); net::HttpCache *cache; @@ -57,7 +57,6 @@ void BrowserRequestContext::Init( } BrowserRequestContext::~BrowserRequestContext() { - delete cookie_store_; delete ftp_transaction_factory_; delete http_transaction_factory_; } diff --git a/libcef/browser_resource_loader_bridge.cc b/libcef/browser_resource_loader_bridge.cc index dc41fa854..9775fdbc5 100644 --- a/libcef/browser_resource_loader_bridge.cc +++ b/libcef/browser_resource_loader_bridge.cc @@ -32,6 +32,7 @@ // alternate implementation that defers fetching to another process. #include "precompiled_libcef.h" +#include "browser_appcache_system.h" #include "browser_resource_loader_bridge.h" #include "browser_request_context.h" #include "browser_impl.h" @@ -44,6 +45,7 @@ #include "base/timer.h" #include "base/thread.h" #include "base/waitable_event.h" +#include "net/base/cookie_policy.h" #include "net/base/io_buffer.h" #include "net/base/load_flags.h" #include "net/base/net_errors.h" @@ -59,6 +61,7 @@ #include "webkit/glue/webview.h" using webkit_glue::ResourceLoaderBridge; +using net::CookiePolicy; using net::HttpResponseHeaders; namespace { @@ -79,6 +82,10 @@ class IOThread : public base::Thread { Stop(); } + virtual void Init() { + BrowserAppCacheSystem::InitializeOnIOThread(request_context); + } + virtual void CleanUp() { if (request_context) { request_context->Release(); @@ -87,19 +94,6 @@ class IOThread : public base::Thread { } }; -bool EnsureIOThread() { - if (io_thread) - return true; - - if (!request_context) - BrowserResourceLoaderBridge::Init(NULL); - - io_thread = new IOThread(); - base::Thread::Options options; - options.message_loop_type = MessageLoop::TYPE_IO; - return io_thread->StartWithOptions(options); -} - //----------------------------------------------------------------------------- struct RequestParams { @@ -109,6 +103,7 @@ struct RequestParams { GURL referrer; std::string headers; int load_flags; + ResourceType::Type request_type; int appcache_host_id; scoped_refptr upload; }; @@ -293,6 +288,9 @@ class RequestProxy : public URLRequest::Delegate, request_->set_load_flags(params->load_flags); request_->set_upload(params->upload.get()); request_->set_context(request_context); + BrowserAppCacheSystem::SetExtraRequestInfo( + request_.get(), params->appcache_host_id, params->request_type); + request_->Start(); if (request_->has_upload() && @@ -406,6 +404,13 @@ class RequestProxy : public URLRequest::Delegate, } } + virtual void OnSSLCertificateError(URLRequest* request, + int cert_error, + net::X509Certificate* cert) { + // Allow all certificate errors. + request->ContinueDespiteLastError(); + } + virtual void OnReadCompleted(URLRequest* request, int bytes_read) { if (request->status().is_success() && bytes_read > 0) { OnReceivedData(bytes_read); @@ -475,11 +480,13 @@ class RequestProxy : public URLRequest::Delegate, info->request_time = request->request_time(); info->response_time = request->response_time(); info->headers = request->response_headers(); - info->appcache_id = appcache::kNoCacheId; - // TODO(michaeln): info->appcache_manifest_url = GURL(); request->GetMimeType(&info->mime_type); request->GetCharset(&info->charset); info->content_length = request->GetExpectedContentSize(); + BrowserAppCacheSystem::GetExtraResponseInfo( + request, + &info->appcache_id, + &info->appcache_manifest_url); } scoped_ptr request_; @@ -573,6 +580,7 @@ class ResourceLoaderBridgeImpl : public ResourceLoaderBridge { const GURL& referrer, const std::string& headers, int load_flags, + ResourceType::Type request_type, int appcache_host_id) : browser_(browser), params_(new RequestParams), @@ -583,6 +591,7 @@ class ResourceLoaderBridgeImpl : public ResourceLoaderBridge { params_->referrer = referrer; params_->headers = headers; params_->load_flags = load_flags; + params_->request_type = request_type; params_->appcache_host_id = appcache_host_id; } @@ -622,7 +631,7 @@ class ResourceLoaderBridgeImpl : public ResourceLoaderBridge { virtual bool Start(Peer* peer) { DCHECK(!proxy_); - if (!EnsureIOThread()) + if (!BrowserResourceLoaderBridge::EnsureIOThread()) return false; proxy_ = new RequestProxy(browser_); @@ -645,7 +654,7 @@ class ResourceLoaderBridgeImpl : public ResourceLoaderBridge { virtual void SyncLoad(SyncLoadResponse* response) { DCHECK(!proxy_); - if (!EnsureIOThread()) + if (!BrowserResourceLoaderBridge::EnsureIOThread()) return; // this may change as the result of a redirect @@ -725,7 +734,7 @@ ResourceLoaderBridge* ResourceLoaderBridge::Create( return new ResourceLoaderBridgeImpl(browser, method, url, first_party_for_cookies, referrer, headers, load_flags, - appcache_host_id); + request_type, appcache_host_id); } // Issue the proxy resolve request on the io thread, and wait @@ -762,6 +771,7 @@ void BrowserResourceLoaderBridge::Init(URLRequestContext* context) { request_context = new BrowserRequestContext(); } request_context->AddRef(); + BrowserResourceLoaderBridge::SetAcceptAllCookies(false); } // static @@ -774,6 +784,7 @@ void BrowserResourceLoaderBridge::Shutdown() { } } +// static void BrowserResourceLoaderBridge::SetCookie(const GURL& url, const GURL& first_party_for_cookies, const std::string& cookie) { @@ -789,6 +800,7 @@ void BrowserResourceLoaderBridge::SetCookie(const GURL& url, cookie_setter.get(), &CookieSetter::Set, url, cookie)); } +// static std::string BrowserResourceLoaderBridge::GetCookies( const GURL& url, const GURL& first_party_for_cookies) { // Proxy to IO thread to synchronize w/ network loading @@ -805,3 +817,24 @@ std::string BrowserResourceLoaderBridge::GetCookies( return getter->GetResult(); } + +// static +bool BrowserResourceLoaderBridge::EnsureIOThread() { + if (io_thread) + return true; + + if (!request_context) + BrowserResourceLoaderBridge::Init(NULL); + + io_thread = new IOThread(); + base::Thread::Options options; + options.message_loop_type = MessageLoop::TYPE_IO; + return io_thread->StartWithOptions(options); +} + +// static +void BrowserResourceLoaderBridge::SetAcceptAllCookies(bool accept_all_cookies) { + CookiePolicy::Type policy_type = accept_all_cookies ? + CookiePolicy::ALLOW_ALL_COOKIES : CookiePolicy::BLOCK_THIRD_PARTY_COOKIES; + request_context->cookie_policy()->set_type(policy_type); +} diff --git a/libcef/browser_resource_loader_bridge.h b/libcef/browser_resource_loader_bridge.h index e035edf2b..d4f4ba20a 100644 --- a/libcef/browser_resource_loader_bridge.h +++ b/libcef/browser_resource_loader_bridge.h @@ -34,6 +34,8 @@ class BrowserResourceLoaderBridge { const std::string& cookie); static std::string GetCookies(const GURL& url, const GURL& first_party_for_cookies); + static bool EnsureIOThread(); + static void SetAcceptAllCookies(bool accept_all_cookies); }; #endif // _BROWSER_RESOURCE_LOADER_BRIDGE_H diff --git a/libcef/browser_webkit_glue.cc b/libcef/browser_webkit_glue.cc index 39e708a83..e82f29771 100644 --- a/libcef/browser_webkit_glue.cc +++ b/libcef/browser_webkit_glue.cc @@ -42,19 +42,20 @@ void AppendToLog(const char* file, int line, const char* msg) { logging::LogMessage(file, line).stream() << msg; } -StringPiece GetRawDataResource(HMODULE module, int resource_id) { +base::StringPiece GetRawDataResource(HMODULE module, int resource_id) { void* data_ptr; size_t data_size; return base::GetDataResourceFromModule(module, resource_id, &data_ptr, - &data_size) ? - StringPiece(static_cast(data_ptr), data_size) : StringPiece(); + &data_size) + ? base::StringPiece(static_cast(data_ptr), data_size) + : base::StringPiece(); } -StringPiece NetResourceProvider(int key) { +base::StringPiece NetResourceProvider(int key) { return GetRawDataResource(::GetModuleHandle(NULL), key); } -StringPiece GetDataResource(int resource_id) { +base::StringPiece GetDataResource(int resource_id) { switch (resource_id) { case IDR_BROKENIMAGE: { // Use webkit's broken image icon (16x16) @@ -91,8 +92,8 @@ StringPiece GetDataResource(int resource_id) { 0x07, 0x0E, 0xC7, 0x4C, 0xCF, 0x49, 0xCD, 0xD2, 0xD3, 0xD4, 0xD2, 0x41, 0x00, 0x3B }; - return StringPiece(reinterpret_cast(broken_image_data), - static_cast( + return base::StringPiece(reinterpret_cast(broken_image_data), + static_cast( sizeof(broken_image_data) / sizeof(unsigned char))); } case IDR_FEED_PREVIEW: @@ -122,8 +123,8 @@ StringPiece GetDataResource(int resource_id) { 0x57, 0x6B, 0xB3, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4E, 0x44, 0xAE, 0x42, 0x60, 0x82 }; - return StringPiece(reinterpret_cast(area_resizer_data), - static_cast( + return base::StringPiece(reinterpret_cast(area_resizer_data), + static_cast( sizeof(area_resizer_data) / sizeof(unsigned char))); } case IDR_SEARCH_CANCEL: @@ -143,10 +144,10 @@ StringPiece GetDataResource(int resource_id) { break; } - return StringPiece(); + return base::StringPiece(); } -bool GetApplicationDirectory(std::wstring *path) { +bool GetApplicationDirectory(FilePath* path) { return PathService::Get(base::DIR_EXE, path); } @@ -158,18 +159,10 @@ std::string GetUIResourceProtocol() { return "cef-resource"; } -bool GetExeDirectory(std::wstring *path) { +bool GetExeDirectory(FilePath* path) { return PathService::Get(base::DIR_EXE, path); } -bool SpellCheckWord(const wchar_t* word, int word_len, - int* misspelling_start, int* misspelling_len) { - // Report all words being correctly spelled. - *misspelling_start = 0; - *misspelling_len = 0; - return true; -} - bool IsPluginRunningInRendererProcess() { return true; } diff --git a/libcef/browser_webkit_glue.h b/libcef/browser_webkit_glue.h index 10958be1d..6c8105d6e 100644 --- a/libcef/browser_webkit_glue.h +++ b/libcef/browser_webkit_glue.h @@ -30,7 +30,7 @@ BOOL SaveBitmapToFile(HBITMAP hBmp, HDC hDC, LPCTSTR file, LPBYTE lpBits); void InitializeTextEncoding(); // This is called indirectly by the network layer to access resources. -StringPiece NetResourceProvider(int key); +base::StringPiece NetResourceProvider(int key); // Retrieve the V8 context associated with the frame. v8::Handle GetV8Context(WebKit::WebFrame* frame); diff --git a/libcef/browser_webkit_init.h b/libcef/browser_webkit_init.h index a56bf8ae2..5b2c11f52 100644 --- a/libcef/browser_webkit_init.h +++ b/libcef/browser_webkit_init.h @@ -8,6 +8,7 @@ #include "base/file_util.h" #include "base/path_service.h" +#include "base/scoped_temp_dir.h" #include "base/stats_counters.h" #include "base/string_util.h" #include "media/base/media.h" @@ -31,7 +32,7 @@ class BrowserWebKitInit : public webkit_glue::WebKitClientImpl { public: - BrowserWebKitInit() { + explicit BrowserWebKitInit() { v8::V8::SetCounterFunction(StatsTable::FindLocation); WebKit::initialize(this); @@ -42,7 +43,6 @@ class BrowserWebKitInit : public webkit_glue::WebKitClientImpl { ASCIIToUTF16(webkit_glue::GetUIResourceProtocol())); WebKit::registerExtension(extensions_v8::GearsExtension::Get()); WebKit::registerExtension(extensions_v8::IntervalExtension::Get()); - appcache_system_.Initialize(); // Load libraries for media and enable the media player. FilePath module_path; @@ -50,6 +50,12 @@ class BrowserWebKitInit : public webkit_glue::WebKitClientImpl { media::InitializeMediaLibrary(module_path)) { WebKit::enableMediaPlayer(); } + + // Construct and initialize an appcache system for this scope. + // A new empty temp directory is created to house any cached + // content during the run. Upon exit that directory is deleted. + if (appcache_dir_.CreateUniqueTempDir()) + BrowserAppCacheSystem::InitializeOnUIThread(appcache_dir_.path()); } ~BrowserWebKitInit() { @@ -72,13 +78,15 @@ class BrowserWebKitInit : public webkit_glue::WebKitClientImpl { return false; } - virtual bool getFileSize(const WebKit::WebString& path, long long& result) { + virtual bool getFileSize(const WebKit::WebString& path, + long long& result) { return file_util::GetFileSize( FilePath(webkit_glue::WebStringToFilePathString(path)), reinterpret_cast(&result)); } - virtual unsigned long long visitedLinkHash(const char* canonicalURL, size_t length) { + virtual unsigned long long visitedLinkHash(const char* canonicalURL, + size_t length) { return 0; } @@ -142,13 +150,13 @@ class BrowserWebKitInit : public webkit_glue::WebKitClientImpl { virtual WebKit::WebApplicationCacheHost* createApplicationCacheHost( WebKit::WebApplicationCacheHostClient* client) { - return new appcache::WebApplicationCacheHostImpl( - client, appcache_system_.backend()); + return BrowserAppCacheSystem::CreateApplicationCacheHost(client); } private: webkit_glue::SimpleWebMimeRegistryImpl mime_registry_; webkit_glue::WebClipboardImpl clipboard_; + ScopedTempDir appcache_dir_; BrowserAppCacheSystem appcache_system_; }; diff --git a/libcef/browser_webview_delegate.cc b/libcef/browser_webview_delegate.cc index 0ba429055..f83a6c150 100644 --- a/libcef/browser_webview_delegate.cc +++ b/libcef/browser_webview_delegate.cc @@ -26,6 +26,8 @@ #include "base/string_util.h" #include "base/trace_event.h" #include "net/base/net_errors.h" +#include "webkit/api/public/WebConsoleMessage.h" +#include "webkit/api/public/WebCString.h" #include "webkit/appcache/appcache_interfaces.h" #include "webkit/api/public/WebData.h" #include "webkit/api/public/WebDataSource.h" @@ -33,6 +35,10 @@ #include "webkit/api/public/WebFrame.h" #include "webkit/api/public/WebHistoryItem.h" #include "webkit/api/public/WebKit.h" +#include "webkit/api/public/WebNode.h" +#include "webkit/api/public/WebPoint.h" +#include "webkit/api/public/WebPopupMenu.h" +#include "webkit/api/public/WebRange.h" #include "webkit/api/public/WebScreenInfo.h" #include "webkit/api/public/WebString.h" #include "webkit/api/public/WebURL.h" @@ -45,6 +51,7 @@ #include "webkit/glue/media/media_resource_loader_bridge_factory.h" #include "webkit/glue/media/simple_data_source.h" #include "webkit/glue/webdropdata.h" +#include "webkit/glue/webplugin_impl.h" #include "webkit/glue/webpreferences.h" #include "webkit/glue/webkit_glue.h" #include "webkit/glue/webview.h" @@ -60,15 +67,31 @@ #include "browser_drop_delegate.h" #endif +using WebKit::WebConsoleMessage; using WebKit::WebData; using WebKit::WebDataSource; using WebKit::WebDragData; +using WebKit::WebDragOperationsMask; +using WebKit::WebEditingAction; +using WebKit::WebForm; +using WebKit::WebFrame; using WebKit::WebHistoryItem; +using WebKit::WebMediaPlayer; +using WebKit::WebMediaPlayerClient; +using WebKit::WebNavigationType; using WebKit::WebNavigationPolicy; +using WebKit::WebNode; +using WebKit::WebPlugin; +using WebKit::WebPluginParams; +using WebKit::WebPoint; +using WebKit::WebPopupMenu; +using WebKit::WebRange; using WebKit::WebRect; using WebKit::WebScreenInfo; using WebKit::WebSize; using WebKit::WebString; +using WebKit::WebTextAffinity; +using WebKit::WebTextDirection; using WebKit::WebURL; using WebKit::WebURLError; using WebKit::WebURLRequest; @@ -85,56 +108,49 @@ int next_page_id_ = 1; // WebViewDelegate ----------------------------------------------------------- -WebView* BrowserWebViewDelegate::CreateWebView(WebView* webview, - bool user_gesture, - const GURL& creator_url) { +void BrowserWebViewDelegate::SetUserStyleSheetEnabled(bool is_enabled) { + WebPreferences* prefs = _Context->GetWebPreferences(); + prefs->user_style_sheet_enabled = is_enabled; + prefs->Apply(browser_->GetWebView()); +} + +void BrowserWebViewDelegate::SetUserStyleSheetLocation(const GURL& location) { + WebPreferences* prefs = _Context->GetWebPreferences(); + prefs->user_style_sheet_enabled = true; + prefs->user_style_sheet_location = location; + prefs->Apply(browser_->GetWebView()); +} + +// WebViewClient ------------------------------------------------------------- + +WebView* BrowserWebViewDelegate::createView(WebFrame* creator) { CefRefPtr browser = browser_->UIT_CreatePopupWindow(std::wstring()); return browser.get() ? browser->GetWebView() : NULL; } -WebKit::WebWidget* BrowserWebViewDelegate::CreatePopupWidget( - WebView* webview, +WebWidget* BrowserWebViewDelegate::createPopupMenu( bool activatable) { - return browser_->UIT_CreatePopupWidget(webview); + // TODO(darin): Should we honor activatable? + return browser_->UIT_CreatePopupWidget(); } -WebKit::WebMediaPlayer* BrowserWebViewDelegate::CreateWebMediaPlayer( - WebKit::WebMediaPlayerClient* client) { - scoped_refptr factory = - new media::FilterFactoryCollection(); - - // TODO(hclam): this is the same piece of code as in RenderView, maybe they - // should be grouped together. - webkit_glue::MediaResourceLoaderBridgeFactory* bridge_factory = - new webkit_glue::MediaResourceLoaderBridgeFactory( - GURL::EmptyGURL(), // referrer - "null", // frame origin - "null", // main_frame_origin - base::GetCurrentProcId(), - appcache::kNoHostId, - 0); - factory->AddFactory(webkit_glue::BufferedDataSource::CreateFactory( - MessageLoop::current(), bridge_factory)); - return new webkit_glue::WebMediaPlayerImpl(client, factory); +void BrowserWebViewDelegate::didAddMessageToConsole( + const WebConsoleMessage& message, const WebString& source_name, + unsigned source_line) { + logging::LogMessage("CONSOLE", 0).stream() << "\"" + << message.text.utf8().data() + << ",\" source: " + << source_name.utf8().data() + << "(" + << source_line + << ")"; } -WebWorker* BrowserWebViewDelegate::CreateWebWorker(WebWorkerClient* client) { - return NULL; +void BrowserWebViewDelegate::printPage(WebFrame* frame) { } -void BrowserWebViewDelegate::OpenURL(WebView* webview, const GURL& url, - const GURL& referrer, - WebNavigationPolicy policy) { - DCHECK_NE(policy, WebKit::WebNavigationPolicyCurrentTab); - CefRefPtr browser = - browser_->UIT_CreatePopupWindow(UTF8ToWide(url.spec())); - - if(browser.get()) - browser->UIT_Show(policy); -} - -void BrowserWebViewDelegate::DidStartLoading(WebView* webview) { +void BrowserWebViewDelegate::didStartLoading() { // clear the title so we can tell if it wasn't provided by the page browser_->UIT_SetTitle(std::wstring()); @@ -145,7 +161,7 @@ void BrowserWebViewDelegate::DidStartLoading(WebView* webview) { } } -void BrowserWebViewDelegate::DidStopLoading(WebView* webview) { +void BrowserWebViewDelegate::didStopLoading() { if(browser_->UIT_GetTitle().empty()) { // no title was provided by the page, so send a blank string to the client CefRefPtr handler = browser_->GetHandler(); @@ -162,30 +178,267 @@ void BrowserWebViewDelegate::DidStopLoading(WebView* webview) { } } -void BrowserWebViewDelegate::WindowObjectCleared(WebKit::WebFrame* webframe) { +void BrowserWebViewDelegate::runModalAlertDialog( + WebFrame* frame, const WebString& message) { + std::wstring messageStr = UTF16ToWideHack(message); + CefHandler::RetVal rv = RV_CONTINUE; CefRefPtr handler = browser_->GetHandler(); if(handler.get()) { - v8::HandleScope handle_scope; - v8::Handle context = webkit_glue::GetV8Context(webframe); - if(context.IsEmpty()) - return; + rv = handler->HandleJSAlert(browser_, browser_->GetCefFrame(frame), + messageStr); + } + if(rv != RV_HANDLED) + ShowJavaScriptAlert(frame, messageStr); +} - v8::Context::Scope scope(context); +bool BrowserWebViewDelegate::runModalConfirmDialog( + WebFrame* frame, const WebString& message) { + std::wstring messageStr = UTF16ToWideHack(message); + CefHandler::RetVal rv = RV_CONTINUE; + bool retval = false; + CefRefPtr handler = browser_->GetHandler(); + if(handler.get()) { + rv = handler->HandleJSConfirm(browser_, browser_->GetCefFrame(frame), + messageStr, retval); + } + if(rv != RV_HANDLED) + retval = ShowJavaScriptConfirm(frame, messageStr); + return retval; +} - CefRefPtr frame(browser_->GetCefFrame(webframe)); - CefRefPtr object = new CefV8ValueImpl(context->Global()); - handler->HandleJSBinding(browser_, frame, object); +bool BrowserWebViewDelegate::runModalPromptDialog( + WebFrame* frame, const WebString& message, const WebString& default_value, + WebString* actual_value) { + std::wstring wmessage = UTF16ToWideHack(message); + std::wstring wdefault = UTF16ToWideHack(default_value); + std::wstring wresult; + + if(actual_value) + wresult = UTF16ToWideHack(*actual_value); + + CefHandler::RetVal rv = RV_CONTINUE; + bool retval = false; + CefRefPtr handler = browser_->GetHandler(); + if(handler.get()) { + rv = handler->HandleJSPrompt(browser_, browser_->GetCefFrame(frame), + wmessage, wdefault, retval, wresult); + } + if(rv != RV_HANDLED) + retval = ShowJavaScriptPrompt(frame, wmessage, wdefault, &wresult); + + if(actual_value && !wresult.empty()) + *actual_value = WideToUTF16Hack(wresult); + + return retval; +} + +bool BrowserWebViewDelegate::runModalBeforeUnloadDialog( + WebFrame* frame, const WebString& message) { + return true; // Allow window closure. +} + +void BrowserWebViewDelegate::setStatusText(const WebString& text) { +} + +void BrowserWebViewDelegate::setMouseOverURL(const WebURL& url) { +} + +void BrowserWebViewDelegate::setToolTipText( + const WebString& text, WebTextDirection hint) { +} + +void BrowserWebViewDelegate::startDragging( + const WebPoint& mouse_coords, const WebDragData& data, + WebDragOperationsMask mask) { + // TODO(tc): Drag and drop is disabled in the test shell because we need + // to be able to convert from WebDragData to an IDataObject. + //if (!drag_delegate_) + // drag_delegate_ = new BrowserDragDelegate(shell_->webViewWnd(), + // shell_->webView()); + //const DWORD ok_effect = DROPEFFECT_COPY | DROPEFFECT_LINK | DROPEFFECT_MOVE; + //DWORD effect; + //HRESULT res = DoDragDrop(drop_data.data_object, drag_delegate_.get(), + // ok_effect, &effect); + //DCHECK(DRAGDROP_S_DROP == res || DRAGDROP_S_CANCEL == res); + browser_->GetWebView()->DragSourceSystemDragEnded(); +} + +void BrowserWebViewDelegate::focusNext() { + CefRefPtr handler = browser_->GetHandler(); + if(handler.get()) { + // Notify the handler that it should take a focus + handler->HandleTakeFocus(browser_, false); } } -WebNavigationPolicy BrowserWebViewDelegate::PolicyForNavigationAction( - WebView* webview, - WebKit::WebFrame* frame, - const WebKit::WebURLRequest& request, - WebKit::WebNavigationType type, - WebNavigationPolicy default_policy, +void BrowserWebViewDelegate::focusPrevious() { + CefRefPtr handler = browser_->GetHandler(); + if(handler.get()) { + // Notify the handler that it should take a focus + handler->HandleTakeFocus(browser_, true); + } +} + +void BrowserWebViewDelegate::navigateBackForwardSoon(int offset) { + browser_->UIT_GetNavigationController()->GoToOffset(offset); +} + +int BrowserWebViewDelegate::historyBackListCount() { + int current_index = + browser_->UIT_GetNavigationController()->GetLastCommittedEntryIndex(); + return current_index; +} + +int BrowserWebViewDelegate::historyForwardListCount() { + int current_index = + browser_->UIT_GetNavigationController()->GetLastCommittedEntryIndex(); + return browser_->UIT_GetNavigationController()->GetEntryCount() + - current_index - 1; +} + +void BrowserWebViewDelegate::didAddHistoryItem() { +} + +// WebWidgetClient ----------------------------------------------------------- + +void BrowserWebViewDelegate::didInvalidateRect(const WebRect& rect) { + if (WebWidgetHost* host = GetWidgetHost()) + host->DidInvalidateRect(rect); +} + +void BrowserWebViewDelegate::didScrollRect(int dx, int dy, + const WebRect& clip_rect) { + if (WebWidgetHost* host = GetWidgetHost()) + host->DidScrollRect(dx, dy, clip_rect); +} + +void BrowserWebViewDelegate::didFocus() { + if (WebWidgetHost* host = GetWidgetHost()) { + CefRefPtr handler = browser_->GetHandler(); + if (handler.get() && handler->HandleSetFocus(browser_, true) == RV_CONTINUE) + browser_->UIT_SetFocus(host, true); + } +} + +void BrowserWebViewDelegate::didBlur() { + if (WebWidgetHost* host = GetWidgetHost()) + browser_->UIT_SetFocus(host, false); +} + +WebScreenInfo BrowserWebViewDelegate::screenInfo() { + if (WebWidgetHost* host = GetWidgetHost()) + return host->GetScreenInfo(); + + return WebScreenInfo(); +} + +// WebEditingClient ---------------------------------------------------------- +// The output from these methods in layout test mode should match that +// expected by the layout tests. See EditingDelegate.m in DumpRenderTree. + +bool BrowserWebViewDelegate::shouldBeginEditing(const WebRange& range) { + return browser_->UIT_AllowEditing(); +} + +bool BrowserWebViewDelegate::shouldEndEditing(const WebRange& range) { + return browser_->UIT_AllowEditing(); +} + +bool BrowserWebViewDelegate::shouldInsertNode(const WebNode& node, + const WebRange& range, + WebEditingAction action) { + return browser_->UIT_AllowEditing(); +} + +bool BrowserWebViewDelegate::shouldInsertText(const WebString& text, + const WebRange& range, + WebEditingAction action) { + return browser_->UIT_AllowEditing(); +} + +bool BrowserWebViewDelegate::shouldChangeSelectedRange(const WebRange& from_range, + const WebRange& to_range, + WebTextAffinity affinity, + bool still_selecting) { + return browser_->UIT_AllowEditing(); +} + +bool BrowserWebViewDelegate::shouldDeleteRange(const WebRange& range) { + return browser_->UIT_AllowEditing(); +} + +bool BrowserWebViewDelegate::shouldApplyStyle(const WebString& style, + const WebRange& range) { + return browser_->UIT_AllowEditing(); +} + +bool BrowserWebViewDelegate::isSmartInsertDeleteEnabled() { + return smart_insert_delete_enabled_; +} + +bool BrowserWebViewDelegate::isSelectTrailingWhitespaceEnabled() { + return select_trailing_whitespace_enabled_; +} + +void BrowserWebViewDelegate::didBeginEditing() { +} + +void BrowserWebViewDelegate::didChangeSelection(bool is_empty_selection) { +} + +void BrowserWebViewDelegate::didChangeContents() { +} + +void BrowserWebViewDelegate::didEndEditing() { +} + +// WebFrameClient ------------------------------------------------------------ + +WebPlugin* BrowserWebViewDelegate::createPlugin( + WebFrame* frame, const WebPluginParams& params) { + return new webkit_glue::WebPluginImpl(frame, params, AsWeakPtr()); +} + +WebWorker* BrowserWebViewDelegate::createWorker( + WebFrame* frame, WebWorkerClient* client) { + return NULL; +} + +WebMediaPlayer* BrowserWebViewDelegate::createMediaPlayer( + WebFrame* frame, WebMediaPlayerClient* client) { + scoped_refptr factory = + new media::FilterFactoryCollection(); + + // TODO(hclam): this is the same piece of code as in RenderView, maybe they + // should be grouped together. + webkit_glue::MediaResourceLoaderBridgeFactory* bridge_factory = + new webkit_glue::MediaResourceLoaderBridgeFactory( + GURL::EmptyGURL(), // referrer + "null", // frame origin + "null", // main_frame_origin + base::GetCurrentProcId(), + appcache::kNoHostId, + 0); + factory->AddFactory(webkit_glue::BufferedDataSource::CreateFactory( + MessageLoop::current(), bridge_factory)); + // TODO(hclam): Use command line switch to determine which data source to use. + return new webkit_glue::WebMediaPlayerImpl(client, factory); +} + +void BrowserWebViewDelegate::willClose(WebFrame* frame) { +} + +void BrowserWebViewDelegate::loadURLExternally( + WebFrame* frame, const WebURLRequest& request, + WebNavigationPolicy policy) { + DCHECK_NE(policy, WebKit::WebNavigationPolicyCurrentTab); + browser_->UIT_CreatePopupWindow(UTF8ToWide(request.url().spec().data())); +} + +WebNavigationPolicy BrowserWebViewDelegate::decidePolicyForNavigation( + WebFrame* frame, const WebURLRequest& request, + WebNavigationType type, WebNavigationPolicy default_policy, bool is_redirect) { - CefRefPtr handler = browser_->GetHandler(); if(handler.get()) { // Gather browse request information @@ -229,71 +482,42 @@ WebNavigationPolicy BrowserWebViewDelegate::PolicyForNavigationAction( return result; } -void BrowserWebViewDelegate::AssignIdentifierToRequest( - WebKit::WebFrame* webframe, - uint32 identifier, - const WebURLRequest& request) { +void BrowserWebViewDelegate::willSubmitForm(WebFrame* frame, const WebForm&) { + // Ignore } -void BrowserWebViewDelegate::WillSendRequest( - WebKit::WebFrame* webframe, - uint32 identifier, - WebURLRequest* request, - const WebURLResponse& redirect_response) { - if (!redirect_response.isNull() && block_redirects_) { - // To block the request, we set its URL to an empty one. - request->setURL(WebURL()); - return; - } - - // The requestor ID is used by the resource loader bridge to locate the - // browser that originated the request. - request->setRequestorID(browser_->UIT_GetUniqueID()); +void BrowserWebViewDelegate::willPerformClientRedirect( + WebFrame* frame, const WebURL& from, const WebURL& to, + double interval, double fire_time) { } -void BrowserWebViewDelegate::DidReceiveResponse( - WebKit::WebFrame* webframe, - uint32 identifier, - const WebURLResponse& response) { - +void BrowserWebViewDelegate::didCancelClientRedirect(WebFrame* frame) { } -void BrowserWebViewDelegate::DidFinishLoading(WebKit::WebFrame* webframe, - uint32 identifier) { - +void BrowserWebViewDelegate::didCompleteClientRedirect( + WebFrame* frame, const WebURL& from) { } -void BrowserWebViewDelegate::DidFailLoadingWithError(WebKit::WebFrame* webframe, - uint32 identifier, - const WebURLError& error) { - -} - -void BrowserWebViewDelegate::DidCreateDataSource(WebKit::WebFrame* frame, - WebDataSource* ds) { +void BrowserWebViewDelegate::didCreateDataSource( + WebFrame* frame, WebDataSource* ds) { ds->setExtraData(pending_extra_data_.release()); } -void BrowserWebViewDelegate::DidStartProvisionalLoadForFrame( - WebView* webview, - WebKit::WebFrame* frame, - NavigationGesture gesture) { +void BrowserWebViewDelegate::didStartProvisionalLoad(WebFrame* frame) { if (!top_loading_frame_) { top_loading_frame_ = frame; } - UpdateAddressBar(webview); + + UpdateAddressBar(frame->view()); } -void BrowserWebViewDelegate::DidReceiveProvisionalLoadServerRedirect( - WebView* webview, - WebKit::WebFrame* frame) { - UpdateAddressBar(webview); +void BrowserWebViewDelegate::didReceiveServerRedirectForProvisionalLoad( + WebFrame* frame) { + UpdateAddressBar(frame->view()); } -void BrowserWebViewDelegate::DidFailProvisionalLoadWithError( - WebView* webview, - const WebURLError& error, - WebKit::WebFrame* frame) { +void BrowserWebViewDelegate::didFailProvisionalLoad( + WebFrame* frame, const WebURLError& error) { LocationChangeDone(frame); // error codes are defined in net\base\net_error_list.h @@ -332,9 +556,14 @@ void BrowserWebViewDelegate::DidFailProvisionalLoadWithError( error_text, GURL("testshell-error:"), error.unreachableURL, replace); } -void BrowserWebViewDelegate::DidCommitLoadForFrame(WebView* webview, - WebKit::WebFrame* frame, - bool is_new_navigation) { +void BrowserWebViewDelegate::didReceiveDocumentData( + WebFrame* frame, const char* data, size_t length, + bool& preventDefault) { + // Ignore +} + +void BrowserWebViewDelegate::didCommitProvisionalLoad( + WebFrame* frame, bool is_new_navigation) { UpdateForCommittedLoad(frame, is_new_navigation); CefRefPtr handler = browser_->GetHandler(); if(handler.get()) { @@ -343,20 +572,51 @@ void BrowserWebViewDelegate::DidCommitLoadForFrame(WebView* webview, } } -void BrowserWebViewDelegate::DidReceiveTitle(WebView* webview, - const std::wstring& title, - WebKit::WebFrame* frame) { - browser_->UIT_SetTitle(title); +void BrowserWebViewDelegate::didClearWindowObject(WebFrame* frame) { CefRefPtr handler = browser_->GetHandler(); if(handler.get()) { - // Notify the handler of a page title change - handler->HandleTitleChange(browser_, title); + v8::HandleScope handle_scope; + v8::Handle context = webkit_glue::GetV8Context(frame); + if(context.IsEmpty()) + return; + + v8::Context::Scope scope(context); + + CefRefPtr cframe(browser_->GetCefFrame(frame)); + CefRefPtr object = new CefV8ValueImpl(context->Global()); + handler->HandleJSBinding(browser_, cframe, object); } } -void BrowserWebViewDelegate::DidFinishLoadForFrame(WebView* webview, - WebKit::WebFrame* frame) { - UpdateAddressBar(webview); +void BrowserWebViewDelegate::didCreateDocumentElement(WebFrame* frame) { + // Ignore +} + +void BrowserWebViewDelegate::didReceiveTitle( + WebFrame* frame, const WebString& title) { + std::wstring wtitle = UTF16ToWideHack(title); + + browser_->UIT_SetTitle(wtitle); + CefRefPtr handler = browser_->GetHandler(); + if(handler.get()) { + // Notify the handler of a page title change + handler->HandleTitleChange(browser_, wtitle); + } +} + +void BrowserWebViewDelegate::didFinishDocumentLoad(WebFrame* frame) { +} + +void BrowserWebViewDelegate::didHandleOnloadEvents(WebFrame* frame) { +} + +void BrowserWebViewDelegate::didFailLoad( + WebFrame* frame, const WebURLError& error) { + LocationChangeDone(frame); +} + +void BrowserWebViewDelegate::didFinishLoad(WebFrame* frame) { + UpdateAddressBar(frame->view()); LocationChangeDone(frame); CefRefPtr handler = browser_->GetHandler(); if(handler.get()) { @@ -365,233 +625,89 @@ void BrowserWebViewDelegate::DidFinishLoadForFrame(WebView* webview, } } -void BrowserWebViewDelegate::DidFailLoadWithError(WebView* webview, - const WebURLError& error, - WebKit::WebFrame* frame) { - LocationChangeDone(frame); -} - -void BrowserWebViewDelegate::DidFinishDocumentLoadForFrame( - WebView* webview, - WebKit::WebFrame* frame) { - -} - -void BrowserWebViewDelegate::DidHandleOnloadEventsForFrame( - WebView* webview, - WebKit::WebFrame* frame) { - -} - -void BrowserWebViewDelegate::DidChangeLocationWithinPageForFrame( - WebView* webview, WebKit::WebFrame* frame, bool is_new_navigation) { +void BrowserWebViewDelegate::didChangeLocationWithinPage( + WebFrame* frame, bool is_new_navigation) { frame->dataSource()->setExtraData(pending_extra_data_.release()); UpdateForCommittedLoad(frame, is_new_navigation); } -void BrowserWebViewDelegate::DidReceiveIconForFrame(WebView* webview, - WebKit::WebFrame* frame) { - +void BrowserWebViewDelegate::assignIdentifierToRequest( + WebFrame* frame, unsigned identifier, const WebURLRequest& request) { } -void BrowserWebViewDelegate::WillPerformClientRedirect( - WebView* webview, - WebKit::WebFrame* frame, - const GURL& src_url, - const GURL& dest_url, - unsigned int delay_seconds, - unsigned int fire_date) { - -} - -void BrowserWebViewDelegate::DidCancelClientRedirect(WebView* webview, - WebKit::WebFrame* frame) { - -} - -void BrowserWebViewDelegate::AddMessageToConsole( - WebView* webview, - const std::wstring& message, - unsigned int line_no, - const std::wstring& source_id) { - logging::LogMessage("CONSOLE", 0).stream() << "\"" - << message.c_str() - << ",\" source: " - << source_id.c_str() - << "(" - << line_no - << ")"; -} - -void BrowserWebViewDelegate::RunJavaScriptAlert(WebKit::WebFrame* webframe, - const std::wstring& message) { - CefHandler::RetVal rv = RV_CONTINUE; - CefRefPtr handler = browser_->GetHandler(); - if(handler.get()) { - rv = handler->HandleJSAlert(browser_, browser_->GetCefFrame(webframe), - message); +void BrowserWebViewDelegate::willSendRequest( + WebFrame* frame, unsigned identifier, WebURLRequest& request, + const WebURLResponse& redirect_response) { + if (!redirect_response.isNull() && block_redirects_) { + // To block the request, we set its URL to an empty one. + request.setURL(WebURL()); + return; } - if(rv != RV_HANDLED) - ShowJavaScriptAlert(webframe, message); + + // The requestor ID is used by the resource loader bridge to locate the + // browser that originated the request. + request.setRequestorID(browser_->UIT_GetUniqueID()); } -bool BrowserWebViewDelegate::RunJavaScriptConfirm(WebKit::WebFrame* webframe, - const std::wstring& message) { - CefHandler::RetVal rv = RV_CONTINUE; - bool retval = false; - CefRefPtr handler = browser_->GetHandler(); - if(handler.get()) { - rv = handler->HandleJSConfirm(browser_, browser_->GetCefFrame(webframe), - message, retval); - } - if(rv != RV_HANDLED) - retval = ShowJavaScriptConfirm(webframe, message); - return retval; +void BrowserWebViewDelegate::didReceiveResponse( + WebFrame* frame, unsigned identifier, const WebURLResponse& response) { } -bool BrowserWebViewDelegate::RunJavaScriptPrompt( - WebKit::WebFrame* webframe, - const std::wstring& message, - const std::wstring& default_value, - std::wstring* result) { - CefHandler::RetVal rv = RV_CONTINUE; - bool retval = false; - CefRefPtr handler = browser_->GetHandler(); - if(handler.get()) { - rv = handler->HandleJSPrompt(browser_, browser_->GetCefFrame(webframe), - message, default_value, retval, *result); - } - if(rv != RV_HANDLED) - retval = ShowJavaScriptPrompt(webframe, message, default_value, result); - return retval; +void BrowserWebViewDelegate::didFinishResourceLoad( + WebFrame* frame, unsigned identifier) { } -void BrowserWebViewDelegate::SetStatusbarText(WebView* webview, - const std::wstring& message) { - +void BrowserWebViewDelegate::didFailResourceLoad( + WebFrame* frame, unsigned identifier, const WebURLError& error) { } -void BrowserWebViewDelegate::StartDragging(WebView* webview, - const WebDragData& drag_data) { +void BrowserWebViewDelegate::didLoadResourceFromMemoryCache( + WebFrame* frame, const WebURLRequest&, + const WebURLResponse&) { +} + +void BrowserWebViewDelegate::didDisplayInsecureContent(WebFrame* frame) { +} + +void BrowserWebViewDelegate::didRunInsecureContent( + WebFrame* frame, const WebString& security_origin) { +} + +void BrowserWebViewDelegate::didExhaustMemoryAvailableForScript(WebFrame* frame) { +} + +void BrowserWebViewDelegate::didChangeContentsSize( + WebFrame* frame, const WebSize&) { +} + + +// Public methods ------------------------------------------------------------ + +BrowserWebViewDelegate::BrowserWebViewDelegate(CefBrowserImpl* browser) + : policy_delegate_enabled_(false), + policy_delegate_is_permissive_(false), + policy_delegate_should_notify_done_(false), + browser_(browser), + top_loading_frame_(NULL), + page_id_(-1), + last_page_id_updated_(-1), + smart_insert_delete_enabled_(true), #if defined(OS_WIN) - // TODO(port): make this work on all platforms. - if (!drag_delegate_) { - drag_delegate_ = new BrowserDragDelegate( - browser_->GetWebViewWndHandle(), - browser_->GetWebView()); - } - // TODO(tc): Drag and drop is disabled in the test shell because we need - // to be able to convert from WebDragData to an IDataObject. - //const DWORD ok_effect = DROPEFFECT_COPY | DROPEFFECT_LINK | DROPEFFECT_MOVE; - //DWORD effect; - //HRESULT res = DoDragDrop(drag_data.data_object, drag_delegate_.get(), - // ok_effect, &effect); - //DCHECK(DRAGDROP_S_DROP == res || DRAGDROP_S_CANCEL == res); - webview->DragSourceSystemDragEnded(); + select_trailing_whitespace_enabled_(true), +#else + select_trailing_whitespace_enabled_(false), #endif + block_redirects_(false) { } -// The output from these methods in non-interactive mode should match that -// expected by the layout tests. See EditingDelegate.m in DumpRenderTree. -bool BrowserWebViewDelegate::ShouldBeginEditing(WebView* webview, - std::wstring range) { - return browser_->UIT_AllowEditing(); +BrowserWebViewDelegate::~BrowserWebViewDelegate() { } -bool BrowserWebViewDelegate::ShouldEndEditing(WebView* webview, - std::wstring range) { - return browser_->UIT_AllowEditing(); -} - -bool BrowserWebViewDelegate::ShouldInsertNode(WebView* webview, - std::wstring node, - std::wstring range, - std::wstring action) { - return browser_->UIT_AllowEditing(); -} - -bool BrowserWebViewDelegate::ShouldInsertText(WebView* webview, - std::wstring text, - std::wstring range, - std::wstring action) { - return browser_->UIT_AllowEditing(); -} - -bool BrowserWebViewDelegate::ShouldChangeSelectedRange(WebView* webview, - std::wstring fromRange, - std::wstring toRange, - std::wstring affinity, - bool stillSelecting) { - return browser_->UIT_AllowEditing(); -} - -bool BrowserWebViewDelegate::ShouldDeleteRange(WebView* webview, - std::wstring range) { - return browser_->UIT_AllowEditing(); -} - -bool BrowserWebViewDelegate::ShouldApplyStyle(WebView* webview, - std::wstring style, - std::wstring range) { - return browser_->UIT_AllowEditing(); -} - -bool BrowserWebViewDelegate::SmartInsertDeleteEnabled() { - return true; -} - -void BrowserWebViewDelegate::DidBeginEditing() { - -} - -void BrowserWebViewDelegate::DidChangeSelection() { - -} - -void BrowserWebViewDelegate::DidChangeContents() { - -} - -void BrowserWebViewDelegate::DidEndEditing() { - -} - -void BrowserWebViewDelegate::NavigateBackForwardSoon(int offset) { - browser_->UIT_GetNavigationController()->GoToOffset(offset); -} - -int BrowserWebViewDelegate::GetHistoryBackListCount() { - int current_index = - browser_->UIT_GetNavigationController()->GetLastCommittedEntryIndex(); - return current_index; -} - -int BrowserWebViewDelegate::GetHistoryForwardListCount() { - int current_index = - browser_->UIT_GetNavigationController()->GetLastCommittedEntryIndex(); - return browser_->UIT_GetNavigationController()->GetEntryCount() - - current_index - 1; -} - -void BrowserWebViewDelegate::TakeFocus(WebView* webview, bool reverse) { - CefRefPtr handler = browser_->GetHandler(); - if(handler.get()) { - // Notify the handler that it should take a focus - handler->HandleTakeFocus(browser_, reverse); - } -} - -void BrowserWebViewDelegate::SetUserStyleSheetEnabled(bool is_enabled) { - WebPreferences* prefs = _Context->GetWebPreferences(); - prefs->user_style_sheet_enabled = is_enabled; - prefs->Apply(browser_->GetWebView()); -} - -void BrowserWebViewDelegate::SetUserStyleSheetLocation(const GURL& location) { - WebPreferences* prefs = _Context->GetWebPreferences(); - prefs->user_style_sheet_enabled = true; - prefs->user_style_sheet_location = location; - prefs->Apply(browser_->GetWebView()); +void BrowserWebViewDelegate::Reset() { + // Do a little placement new dance... + CefBrowserImpl* browser = browser_; + this->~BrowserWebViewDelegate(); + new (this) BrowserWebViewDelegate(browser); } void BrowserWebViewDelegate::SetSmartInsertDeleteEnabled(bool enabled) { @@ -631,83 +747,15 @@ void BrowserWebViewDelegate::SetCustomPolicyDelegate(bool is_custom, void BrowserWebViewDelegate::WaitForPolicyDelegate() { policy_delegate_enabled_ = true; -} - -// WebWidgetClient --------------------------------------------------------- - -void BrowserWebViewDelegate::didInvalidateRect(const WebRect& rect) { - if (WebWidgetHost* host = GetWidgetHost()) - host->DidInvalidateRect(rect); -} - -void BrowserWebViewDelegate::didScrollRect(int dx, int dy, - const WebRect& clip_rect) { - if (WebWidgetHost* host = GetWidgetHost()) - host->DidScrollRect(dx, dy, clip_rect); -} - -void BrowserWebViewDelegate::didFocus() { - if (WebWidgetHost* host = GetWidgetHost()) { - CefRefPtr handler = browser_->GetHandler(); - if (handler.get() && handler->HandleSetFocus(browser_, true) == RV_CONTINUE) - browser_->UIT_SetFocus(host, true); - } -} - -void BrowserWebViewDelegate::didBlur() { - if (WebWidgetHost* host = GetWidgetHost()) - browser_->UIT_SetFocus(host, false); -} - -WebScreenInfo BrowserWebViewDelegate::screenInfo() { - if (WebWidgetHost* host = GetWidgetHost()) - return host->GetScreenInfo(); - - return WebScreenInfo(); -} - -// Public methods ----------------------------------------------------------- - -BrowserWebViewDelegate::BrowserWebViewDelegate(CefBrowserImpl* browser) - : policy_delegate_enabled_(false), - policy_delegate_is_permissive_(false), - browser_(browser), - top_loading_frame_(NULL), - page_id_(-1), - last_page_id_updated_(-1), - smart_insert_delete_enabled_(true) -#if defined(OS_WIN) - , select_trailing_whitespace_enabled_(true) -#else - , select_trailing_whitespace_enabled_(false) -#endif -#if defined(OS_LINUX) - , cursor_type_(GDK_X_CURSOR) -#endif - , block_redirects_(false) -{ -} - -void BrowserWebViewDelegate::Reset() { - *this = BrowserWebViewDelegate(browser_); + policy_delegate_should_notify_done_ = true; } // Private methods ----------------------------------------------------------- void BrowserWebViewDelegate::UpdateAddressBar(WebView* webView) { -/* - WebKit::WebFrame* mainFrame = webView->UIT_GetMainFrame(); - WebDataSource* dataSource = mainFrame->dataSource(); - if (!dataSource) - dataSource = mainFrame->provisionalDataSource(); - if (!dataSource) - return; - - GURL gUrl = dataSource->request().firstPartyForCookies(); -*/ } -void BrowserWebViewDelegate::LocationChangeDone(WebKit::WebFrame* frame) { +void BrowserWebViewDelegate::LocationChangeDone(WebFrame* frame) { if (frame == top_loading_frame_) top_loading_frame_ = NULL; } @@ -720,10 +768,8 @@ WebWidgetHost* BrowserWebViewDelegate::GetWidgetHost() { return NULL; } -void BrowserWebViewDelegate::UpdateForCommittedLoad(WebKit::WebFrame* frame, +void BrowserWebViewDelegate::UpdateForCommittedLoad(WebFrame* frame, bool is_new_navigation) { - WebView* webview = browser_->GetWebView(); - // Code duplicated from RenderView::DidCommitLoadForFrame. BrowserExtraData* extra_data = static_cast( frame->dataSource()->extraData()); @@ -746,7 +792,7 @@ void BrowserWebViewDelegate::UpdateForCommittedLoad(WebKit::WebFrame* frame, UpdateURL(frame); } -void BrowserWebViewDelegate::UpdateURL(WebKit::WebFrame* frame) { +void BrowserWebViewDelegate::UpdateURL(WebFrame* frame) { WebDataSource* ds = frame->dataSource(); DCHECK(ds); @@ -781,7 +827,7 @@ void BrowserWebViewDelegate::UpdateURL(WebKit::WebFrame* frame) { last_page_id_updated_ = std::max(last_page_id_updated_, page_id_); } -void BrowserWebViewDelegate::UpdateSessionHistory(WebKit::WebFrame* frame) { +void BrowserWebViewDelegate::UpdateSessionHistory(WebFrame* frame) { // If we have a valid page ID at this point, then it corresponds to the page // we are navigating away from. Otherwise, this is the first navigation, so // there is no past session history to record. diff --git a/libcef/browser_webview_delegate.h b/libcef/browser_webview_delegate.h index 1fbc47877..2c3c7f394 100644 --- a/libcef/browser_webview_delegate.h +++ b/libcef/browser_webview_delegate.h @@ -19,8 +19,12 @@ #endif #include "base/basictypes.h" -#include "base/linked_ptr.h" +#include "base/scoped_ptr.h" +#include "base/weak_ptr.h" +#include "webkit/api/public/WebEditingClient.h" +#include "webkit/api/public/WebFrameClient.h" #include "webkit/glue/webcursor.h" +#include "webkit/glue/webplugin_page_delegate.h" #include "webkit/glue/webview_delegate.h" #if defined(OS_WIN) #include "browser_drag_delegate.h" @@ -34,50 +38,13 @@ struct WebPreferences; class GURL; class WebWidgetHost; -class BrowserWebViewDelegate : public WebViewDelegate { +class BrowserWebViewDelegate : public WebViewDelegate, + public WebKit::WebEditingClient, + public WebKit::WebFrameClient, + public webkit_glue::WebPluginPageDelegate, + public base::SupportsWeakPtr { public: - BrowserWebViewDelegate(CefBrowserImpl* browser); - virtual ~BrowserWebViewDelegate() {} - - void Reset(); - // WebViewDelegate - virtual WebView* CreateWebView(WebView* webview, - bool user_gesture, - const GURL& creator_url); - virtual WebKit::WebWidget* CreatePopupWidget( - WebView* webview, - bool activatable); - virtual WebPluginDelegate* CreatePluginDelegate( - WebView* webview, - const GURL& url, - const std::string& mime_type, - const std::string& clsid, - std::string* actual_mime_type); - virtual WebKit::WebMediaPlayer* CreateWebMediaPlayer( - WebKit::WebMediaPlayerClient* client); - virtual WebKit::WebWorker* CreateWebWorker(WebKit::WebWorkerClient* client); - virtual void OpenURL(WebView* webview, - const GURL& url, - const GURL& referrer, - WebKit::WebNavigationPolicy policy); - virtual void DidMovePlugin(const WebPluginGeometry& move); - virtual void RunJavaScriptAlert(WebKit::WebFrame* webframe, - const std::wstring& message); - virtual bool RunJavaScriptConfirm(WebKit::WebFrame* webframe, - const std::wstring& message); - virtual bool RunJavaScriptPrompt(WebKit::WebFrame* webframe, - const std::wstring& message, - const std::wstring& default_value, - std::wstring* result); - virtual void SetStatusbarText(WebView* webview, - const std::wstring& message); - virtual void AddMessageToConsole(WebView* webview, - const std::wstring& message, - unsigned int line_no, - const std::wstring& source_id); - virtual void StartDragging(WebView* webview, - const WebKit::WebDragData& drop_data); virtual void ShowContextMenu(WebView* webview, ContextNodeType node_type, int x, @@ -92,106 +59,42 @@ class BrowserWebViewDelegate : public WebViewDelegate { int edit_flags, const std::string& security_info, const std::string& frame_charset); - virtual void DidCreateDataSource(WebKit::WebFrame* frame, - WebKit::WebDataSource* ds); - virtual void DidStartProvisionalLoadForFrame( - WebView* webview, - WebKit::WebFrame* frame, - NavigationGesture gesture); - virtual void DidReceiveProvisionalLoadServerRedirect( - WebView* webview, WebKit::WebFrame* frame); - virtual void DidFailProvisionalLoadWithError( - WebView* webview, - const WebKit::WebURLError& error, - WebKit::WebFrame* frame); - virtual void DidCommitLoadForFrame( - WebView* webview, - WebKit::WebFrame* frame, - bool is_new_navigation); - virtual void DidReceiveTitle(WebView* webview, - const std::wstring& title, - WebKit::WebFrame* frame); - virtual void DidFinishDocumentLoadForFrame(WebView* webview, - WebKit::WebFrame* frame); - virtual void DidHandleOnloadEventsForFrame(WebView* webview, - WebKit::WebFrame* frame); - virtual void DidChangeLocationWithinPageForFrame(WebView* webview, - WebKit::WebFrame* frame, - bool is_new_navigation); - virtual void DidReceiveIconForFrame(WebView* webview, - WebKit::WebFrame* frame); - - virtual void WillPerformClientRedirect(WebView* webview, - WebKit::WebFrame* frame, - const GURL& src_url, - const GURL& dest_url, - unsigned int delay_seconds, - unsigned int fire_date); - virtual void DidCancelClientRedirect(WebView* webview, - WebKit::WebFrame* frame); - - virtual void DidFinishLoadForFrame(WebView* webview, WebKit::WebFrame* frame); - virtual void DidFailLoadWithError(WebView* webview, - const WebKit::WebURLError& error, - WebKit::WebFrame* for_frame); - - virtual void AssignIdentifierToRequest(WebKit::WebFrame* webframe, - uint32 identifier, - const WebKit::WebURLRequest& request); - virtual void WillSendRequest(WebKit::WebFrame* webframe, - uint32 identifier, - WebKit::WebURLRequest* request, - const WebKit::WebURLResponse& redirect_response); - virtual void DidFinishLoading(WebKit::WebFrame* webframe, uint32 identifier); - virtual void DidFailLoadingWithError(WebKit::WebFrame* webframe, - uint32 identifier, - const WebKit::WebURLError& error); - virtual void DidReceiveResponse(WebKit::WebFrame* webframe, - uint32 identifier, - const WebKit::WebURLResponse& response); - - virtual bool ShouldBeginEditing(WebView* webview, std::wstring range); - virtual bool ShouldEndEditing(WebView* webview, std::wstring range); - virtual bool ShouldInsertNode(WebView* webview, - std::wstring node, - std::wstring range, - std::wstring action); - virtual bool ShouldInsertText(WebView* webview, - std::wstring text, - std::wstring range, - std::wstring action); - virtual bool ShouldChangeSelectedRange(WebView* webview, - std::wstring fromRange, - std::wstring toRange, - std::wstring affinity, - bool stillSelecting); - virtual bool ShouldDeleteRange(WebView* webview, std::wstring range); - virtual bool ShouldApplyStyle(WebView* webview, - std::wstring style, - std::wstring range); - virtual bool SmartInsertDeleteEnabled(); - virtual void DidBeginEditing(); - virtual void DidChangeSelection(); - virtual void DidChangeContents(); - virtual void DidEndEditing(); - - virtual void DidStartLoading(WebView* webview); - virtual void DidStopLoading(WebView* webview); - - virtual void WindowObjectCleared(WebKit::WebFrame* webframe); - virtual WebKit::WebNavigationPolicy PolicyForNavigationAction( - WebView* webview, - WebKit::WebFrame* frame, - const WebKit::WebURLRequest& request, - WebKit::WebNavigationType type, - WebKit::WebNavigationPolicy default_policy, - bool is_redirect); - virtual void NavigateBackForwardSoon(int offset); - virtual int GetHistoryBackListCount(); - virtual int GetHistoryForwardListCount(); - virtual void TakeFocus(WebView* webview, bool reverse); - - // WebWidgetClient + + // WebKit::WebViewClient + virtual WebView* createView(WebKit::WebFrame* creator); + virtual WebKit::WebWidget* createPopupMenu(bool activatable); + virtual WebKit::WebWidget* createPopupMenu( + const WebKit::WebPopupMenuInfo& info); + virtual void didAddMessageToConsole( + const WebKit::WebConsoleMessage& message, + const WebKit::WebString& source_name, unsigned source_line); + virtual void printPage(WebKit::WebFrame* frame); + virtual void didStartLoading(); + virtual void didStopLoading(); + virtual void runModalAlertDialog( + WebKit::WebFrame* frame, const WebKit::WebString& message); + virtual bool runModalConfirmDialog( + WebKit::WebFrame* frame, const WebKit::WebString& message); + virtual bool runModalPromptDialog( + WebKit::WebFrame* frame, const WebKit::WebString& message, + const WebKit::WebString& default_value, WebKit::WebString* actual_value); + virtual bool runModalBeforeUnloadDialog( + WebKit::WebFrame* frame, const WebKit::WebString& message); + virtual void setStatusText(const WebKit::WebString& text); + virtual void setMouseOverURL(const WebKit::WebURL& url); + virtual void setToolTipText( + const WebKit::WebString& text, WebKit::WebTextDirection hint); + virtual void startDragging( + const WebKit::WebPoint& from, const WebKit::WebDragData& data, + WebKit::WebDragOperationsMask mask); + virtual void focusNext(); + virtual void focusPrevious(); + virtual void navigateBackForwardSoon(int offset); + virtual int historyBackListCount(); + virtual int historyForwardListCount(); + virtual void didAddHistoryItem(); + + // WebKit::WebWidgetClient virtual void didInvalidateRect(const WebKit::WebRect& rect); virtual void didScrollRect(int dx, int dy, const WebKit::WebRect& clip_rect); @@ -207,6 +110,119 @@ class BrowserWebViewDelegate : public WebViewDelegate { virtual WebKit::WebRect windowResizerRect(); virtual WebKit::WebScreenInfo screenInfo(); + // WebKit::WebEditingClient + virtual bool shouldBeginEditing(const WebKit::WebRange& range); + virtual bool shouldEndEditing(const WebKit::WebRange& range); + virtual bool shouldInsertNode( + const WebKit::WebNode& node, const WebKit::WebRange& range, + WebKit::WebEditingAction action); + virtual bool shouldInsertText( + const WebKit::WebString& text, const WebKit::WebRange& range, + WebKit::WebEditingAction action); + virtual bool shouldChangeSelectedRange( + const WebKit::WebRange& from, const WebKit::WebRange& to, + WebKit::WebTextAffinity affinity, bool still_selecting); + virtual bool shouldDeleteRange(const WebKit::WebRange& range); + virtual bool shouldApplyStyle( + const WebKit::WebString& style, const WebKit::WebRange& range); + virtual bool isSmartInsertDeleteEnabled(); + virtual bool isSelectTrailingWhitespaceEnabled(); + virtual void setInputMethodEnabled(bool enabled) {} + virtual void didBeginEditing(); + virtual void didChangeSelection(bool is_selection_empty); + virtual void didChangeContents(); + virtual void didExecuteCommand(const WebKit::WebString& command_name) {} + virtual void didEndEditing(); + + // WebKit::WebFrameClient + virtual WebKit::WebPlugin* createPlugin( + WebKit::WebFrame*, const WebKit::WebPluginParams&); + virtual WebKit::WebWorker* createWorker( + WebKit::WebFrame*, WebKit::WebWorkerClient*); + virtual WebKit::WebMediaPlayer* createMediaPlayer( + WebKit::WebFrame*, WebKit::WebMediaPlayerClient*); + virtual void willClose(WebKit::WebFrame*); + virtual void loadURLExternally( + WebKit::WebFrame*, const WebKit::WebURLRequest&, + WebKit::WebNavigationPolicy); + virtual WebKit::WebNavigationPolicy decidePolicyForNavigation( + WebKit::WebFrame*, const WebKit::WebURLRequest&, + WebKit::WebNavigationType, WebKit::WebNavigationPolicy default_policy, + bool isRedirect); + virtual void willSubmitForm(WebKit::WebFrame*, const WebKit::WebForm&); + virtual void willPerformClientRedirect( + WebKit::WebFrame*, const WebKit::WebURL& from, const WebKit::WebURL& to, + double interval, double fire_time); + virtual void didCancelClientRedirect(WebKit::WebFrame*); + virtual void didCompleteClientRedirect( + WebKit::WebFrame*, const WebKit::WebURL& from); + virtual void didCreateDataSource( + WebKit::WebFrame*, WebKit::WebDataSource*); + virtual void didStartProvisionalLoad(WebKit::WebFrame*); + virtual void didReceiveServerRedirectForProvisionalLoad(WebKit::WebFrame*); + virtual void didFailProvisionalLoad( + WebKit::WebFrame*, const WebKit::WebURLError&); + virtual void didReceiveDocumentData( + WebKit::WebFrame*, const char* data, size_t length, + bool& preventDefault); + virtual void didCommitProvisionalLoad( + WebKit::WebFrame*, bool is_new_navigation); + virtual void didClearWindowObject(WebKit::WebFrame*); + virtual void didCreateDocumentElement(WebKit::WebFrame*); + virtual void didReceiveTitle( + WebKit::WebFrame*, const WebKit::WebString& title); + virtual void didFinishDocumentLoad(WebKit::WebFrame*); + virtual void didHandleOnloadEvents(WebKit::WebFrame*); + virtual void didFailLoad( + WebKit::WebFrame*, const WebKit::WebURLError&); + virtual void didFinishLoad(WebKit::WebFrame*); + virtual void didChangeLocationWithinPage( + WebKit::WebFrame*, bool isNewNavigation); + virtual void didUpdateCurrentHistoryItem(WebKit::WebFrame*) {} + virtual void assignIdentifierToRequest( + WebKit::WebFrame*, unsigned identifier, const WebKit::WebURLRequest&); + virtual void willSendRequest( + WebKit::WebFrame*, unsigned identifier, WebKit::WebURLRequest&, + const WebKit::WebURLResponse& redirectResponse); + virtual void didReceiveResponse( + WebKit::WebFrame*, unsigned identifier, const WebKit::WebURLResponse&); + virtual void didFinishResourceLoad( + WebKit::WebFrame*, unsigned identifier); + virtual void didFailResourceLoad( + WebKit::WebFrame*, unsigned identifier, const WebKit::WebURLError&); + virtual void didLoadResourceFromMemoryCache( + WebKit::WebFrame*, const WebKit::WebURLRequest&, + const WebKit::WebURLResponse&); + virtual void didDisplayInsecureContent(WebKit::WebFrame* frame); + virtual void didRunInsecureContent( + WebKit::WebFrame* frame, const WebKit::WebString& security_origin); + virtual void didExhaustMemoryAvailableForScript(WebKit::WebFrame*); + virtual void didChangeContentsSize( + WebKit::WebFrame*, const WebKit::WebSize&); + + // webkit_glue::WebPluginPageDelegate + virtual webkit_glue::WebPluginDelegate* CreatePluginDelegate( + const GURL& url, + const std::string& mime_type, + std::string* actual_mime_type); + virtual void CreatedPluginWindow( + gfx::PluginWindowHandle handle); + virtual void WillDestroyPluginWindow( + gfx::PluginWindowHandle handle); + virtual void DidMovePlugin( + const webkit_glue::WebPluginGeometry& move); + virtual void DidStartLoadingForPlugin() {} + virtual void DidStopLoadingForPlugin() {} + virtual void ShowModalHTMLDialogForPlugin( + const GURL& url, + const gfx::Size& size, + const std::string& json_arguments, + std::string* json_retval) {} + + BrowserWebViewDelegate(CefBrowserImpl* browser); + ~BrowserWebViewDelegate(); + void Reset(); + void SetSmartInsertDeleteEnabled(bool enabled); void SetSelectTrailingWhitespaceEnabled(bool enabled); @@ -279,6 +295,9 @@ class BrowserWebViewDelegate : public WebViewDelegate { // will be allowed. Otherwise, they will be ignored (dropped). bool policy_delegate_is_permissive_; + // If true, the policy delegate will signal layout test completion. + bool policy_delegate_should_notify_done_; + // Non-owning pointer. The delegate is owned by the host. CefBrowserImpl* browser_; @@ -289,7 +308,7 @@ class BrowserWebViewDelegate : public WebViewDelegate { int page_id_; int last_page_id_updated_; - linked_ptr pending_extra_data_; + scoped_ptr pending_extra_data_; WebCursor current_cursor_; #if defined(OS_WIN) @@ -313,6 +332,8 @@ class BrowserWebViewDelegate : public WebViewDelegate { // true if we should block any redirects bool block_redirects_; + + DISALLOW_COPY_AND_ASSIGN(BrowserWebViewDelegate); }; #endif // _BROWSER_WEBVIEW_DELEGATE_H diff --git a/libcef/browser_webview_delegate_win.cc b/libcef/browser_webview_delegate_win.cc index 38da9713e..06dd9da4a 100644 --- a/libcef/browser_webview_delegate_win.cc +++ b/libcef/browser_webview_delegate_win.cc @@ -41,47 +41,158 @@ using WebKit::WebCursorInfo; using WebKit::WebFrame; using WebKit::WebNavigationPolicy; +using WebKit::WebPopupMenuInfo; using WebKit::WebRect; +using WebKit::WebWidget; -// WebViewDelegate ----------------------------------------------------------- +// WebViewClient -------------------------------------------------------------- -WebPluginDelegate* BrowserWebViewDelegate::CreatePluginDelegate( - WebView* webview, +WebWidget* BrowserWebViewDelegate::createPopupMenu( + const WebPopupMenuInfo& info) { + NOTREACHED(); + return NULL; +} + +// WebWidgetClient ------------------------------------------------------------ + +void BrowserWebViewDelegate::show(WebNavigationPolicy) { + if (WebWidgetHost* host = GetWidgetHost()) { + HWND root = GetAncestor(host->view_handle(), GA_ROOT); + ShowWindow(root, SW_SHOW); + UpdateWindow(root); + } +} + +void BrowserWebViewDelegate::closeWidgetSoon() { + if (this == browser_->GetWebViewDelegate()) { + PostMessage(browser_->GetMainWndHandle(), WM_CLOSE, 0, 0); + } else if (this == browser_->GetPopupDelegate()) { + browser_->UIT_ClosePopupWidget(); + } +} + +void BrowserWebViewDelegate::didChangeCursor(const WebCursorInfo& cursor_info) { + if (WebWidgetHost* host = GetWidgetHost()) { + current_cursor_.InitFromCursorInfo(cursor_info); + HINSTANCE mod_handle = GetModuleHandle(NULL); + host->SetCursor(current_cursor_.GetCursor(mod_handle)); + } +} + +WebRect BrowserWebViewDelegate::windowRect() { + if (WebWidgetHost* host = GetWidgetHost()) { + RECT rect; + ::GetWindowRect(host->view_handle(), &rect); + return gfx::Rect(rect); + } + return WebRect(); +} + +void BrowserWebViewDelegate::setWindowRect(const WebRect& rect) { + if (this == browser_->GetWebViewDelegate()) { + // ignored + } else if (this == browser_->GetPopupDelegate()) { + MoveWindow(browser_->GetPopupWndHandle(), + rect.x, rect.y, rect.width, rect.height, FALSE); + } +} + +WebRect BrowserWebViewDelegate::rootWindowRect() { + if (WebWidgetHost* host = GetWidgetHost()) { + RECT rect; + HWND root_window = ::GetAncestor(host->view_handle(), GA_ROOT); + ::GetWindowRect(root_window, &rect); + return gfx::Rect(rect); + } + return WebRect(); +} + +WebRect BrowserWebViewDelegate::windowResizerRect() { + // Not necessary on Windows. + return WebRect(); +} + +void BrowserWebViewDelegate::runModal() { + WebWidgetHost* host = GetWidgetHost(); + if (!host) + return; + + show(WebKit::WebNavigationPolicyNewWindow); + + CefContext::BrowserList *list; + CefContext::BrowserList::const_iterator i; + + _Context->Lock(); + list = _Context->GetBrowserList(); + i = list->begin(); + for (; i != list->end(); ++i) { + if (i->get()->IsPopup()) + EnableWindow(i->get()->GetMainWndHandle(), FALSE); + } + _Context->Unlock(); + + browser_->UIT_SetIsModal(true); + MessageLoop::current()->Run(); + + _Context->Lock(); + list = _Context->GetBrowserList(); + i = list->begin(); + for (; i != list->end(); ++i) + EnableWindow(i->get()->GetMainWndHandle(), TRUE); + _Context->Unlock(); +} + +// WebPluginPageDelegate ------------------------------------------------------ + +webkit_glue::WebPluginDelegate* BrowserWebViewDelegate::CreatePluginDelegate( const GURL& url, const std::string& mime_type, - const std::string& clsid, std::string* actual_mime_type) { HWND hwnd = browser_->GetWebViewHost()->view_handle(); if (!hwnd) return NULL; bool allow_wildcard = true; - - // first, look for plugins using the normal plugin list WebPluginInfo info; - if (NPAPI::PluginList::Singleton()->GetPluginInfo(url, mime_type, clsid, - allow_wildcard, &info, - actual_mime_type)) { - if (actual_mime_type && !actual_mime_type->empty()) - return WebPluginDelegateImpl::Create(info.path, *actual_mime_type, hwnd); - else - return WebPluginDelegateImpl::Create(info.path, mime_type, hwnd); + if (!NPAPI::PluginList::Singleton()->GetPluginInfo( + url, mime_type, allow_wildcard, &info, actual_mime_type)) { + return NULL; } - return NULL; + if (actual_mime_type && !actual_mime_type->empty()) + return WebPluginDelegateImpl::Create(info.path, *actual_mime_type, hwnd); + else + return WebPluginDelegateImpl::Create(info.path, mime_type, hwnd); } -void BrowserWebViewDelegate::DidMovePlugin(const WebPluginGeometry& move) { - HRGN hrgn = ::CreateRectRgn(move.clip_rect.x(), - move.clip_rect.y(), - move.clip_rect.right(), - move.clip_rect.bottom()); - gfx::SubtractRectanglesFromRegion(hrgn, move.cutout_rects); +void BrowserWebViewDelegate::CreatedPluginWindow( + gfx::PluginWindowHandle handle) { + // ignored +} - // Note: System will own the hrgn after we call SetWindowRgn, - // so we don't need to call DeleteObject(hrgn) - ::SetWindowRgn(move.window, hrgn, FALSE); +void BrowserWebViewDelegate::WillDestroyPluginWindow( + gfx::PluginWindowHandle handle) { + // ignored +} + +void BrowserWebViewDelegate::DidMovePlugin( + const webkit_glue::WebPluginGeometry& move) { unsigned long flags = 0; + + if (move.rects_valid) { + HRGN hrgn = ::CreateRectRgn(move.clip_rect.x(), + move.clip_rect.y(), + move.clip_rect.right(), + move.clip_rect.bottom()); + gfx::SubtractRectanglesFromRegion(hrgn, move.cutout_rects); + + // Note: System will own the hrgn after we call SetWindowRgn, + // so we don't need to call DeleteObject(hrgn) + ::SetWindowRgn(move.window, hrgn, FALSE); + } else { + flags |= (SWP_NOSIZE | SWP_NOMOVE); + } + if (move.visible) flags |= SWP_SHOWWINDOW; else @@ -265,97 +376,7 @@ end: MessageLoop::current()->SetNestableTasksAllowed(old_state); } -// WebWidgetClient --------------------------------------------------------- - -void BrowserWebViewDelegate::show(WebNavigationPolicy) { - if (WebWidgetHost* host = GetWidgetHost()) { - HWND root = GetAncestor(host->view_handle(), GA_ROOT); - ShowWindow(root, SW_SHOW); - UpdateWindow(root); - } -} - -void BrowserWebViewDelegate::closeWidgetSoon() { - if (this == browser_->GetWebViewDelegate()) { - PostMessage(browser_->GetMainWndHandle(), WM_CLOSE, 0, 0); - } else if (this == browser_->GetPopupDelegate()) { - browser_->UIT_ClosePopupWidget(); - } -} - -void BrowserWebViewDelegate::didChangeCursor( - const WebCursorInfo& cursor_info) { - if (WebWidgetHost* host = GetWidgetHost()) { - current_cursor_.InitFromCursorInfo(cursor_info); - HINSTANCE mod_handle = GetModuleHandle(NULL); - host->SetCursor(current_cursor_.GetCursor(mod_handle)); - } -} - -WebRect BrowserWebViewDelegate::windowRect() { - if (WebWidgetHost* host = GetWidgetHost()) { - RECT rect; - ::GetWindowRect(host->view_handle(), &rect); - return gfx::Rect(rect); - } - return WebRect(); -} - -void BrowserWebViewDelegate::setWindowRect(const WebRect& rect) { - if (this == browser_->GetWebViewDelegate()) { - // ignored - } else if (this == browser_->GetPopupDelegate()) { - MoveWindow(browser_->GetPopupWndHandle(), - rect.x, rect.y, rect.width, rect.height, FALSE); - } -} - -WebRect BrowserWebViewDelegate::rootWindowRect() { - if (WebWidgetHost* host = GetWidgetHost()) { - RECT rect; - HWND root_window = ::GetAncestor(host->view_handle(), GA_ROOT); - ::GetWindowRect(root_window, &rect); - return gfx::Rect(rect); - } - return WebRect(); -} - -WebRect BrowserWebViewDelegate::windowResizerRect() { - // Not necessary on Windows. - return WebRect(); -} - -void BrowserWebViewDelegate::runModal() { - WebWidgetHost* host = GetWidgetHost(); - if (!host) - return; - - show(WebKit::WebNavigationPolicyNewWindow); - - CefContext::BrowserList *list; - CefContext::BrowserList::const_iterator i; - - _Context->Lock(); - list = _Context->GetBrowserList(); - i = list->begin(); - for (; i != list->end(); ++i) { - if (i->get()->IsPopup()) - EnableWindow(i->get()->GetMainWndHandle(), FALSE); - } - _Context->Unlock(); - - browser_->UIT_SetIsModal(true); - MessageLoop::current()->Run(); - - _Context->Lock(); - list = _Context->GetBrowserList(); - i = list->begin(); - for (; i != list->end(); ++i) - EnableWindow(i->get()->GetMainWndHandle(), TRUE); - _Context->Unlock(); -} - -// Private methods ----------------------------------------------------------- +// Private methods ------------------------------------------------------------ void BrowserWebViewDelegate::ShowJavaScriptAlert(WebFrame* webframe, const std::wstring& message) diff --git a/libcef/context.cc b/libcef/context.cc index 6f31e8c7b..737d1af4f 100644 --- a/libcef/context.cc +++ b/libcef/context.cc @@ -332,7 +332,7 @@ bool CefContext::Initialize(bool multi_threaded_message_loop, webprefs_->cursive_font_family = L"Comic Sans MS"; webprefs_->fantasy_font_family = L"Impact"; #endif - webprefs_->default_encoding = L"ISO-8859-1"; + webprefs_->default_encoding = "ISO-8859-1"; webprefs_->default_font_size = 16; webprefs_->default_fixed_font_size = 13; webprefs_->minimum_font_size = 1; diff --git a/libcef/libcef.vcproj b/libcef/libcef.vcproj index 8aedcd207..2dc50826a 100644 --- a/libcef/libcef.vcproj +++ b/libcef/libcef.vcproj @@ -191,6 +191,10 @@ > + + diff --git a/libcef/libcef_webkit.vsprops b/libcef/libcef_webkit.vsprops index 5aba0e688..6a859291e 100644 --- a/libcef/libcef_webkit.vsprops +++ b/libcef/libcef_webkit.vsprops @@ -3,6 +3,6 @@ ProjectType="Visual C++" Version="8.00" Name="webkit_common" - InheritedPropertySheets=".\libcef_webkit_includes.vsprops;.\libcef_webkit_defines.vsprops;.\libcef_webkit_v8bindings.vsprops;$(SolutionDir)..\third_party\npapi\using_npapi.vsprops;$(SolutionDir)..\skia\using_skia.vsprops;$(SolutionDir)..\build\external_code.vsprops;$(SolutionDir)..\third_party\icu38\build\using_icu.vsprops" + InheritedPropertySheets=".\libcef_webkit_includes.vsprops;.\libcef_webkit_defines.vsprops;.\libcef_webkit_v8bindings.vsprops;$(SolutionDir)..\third_party\npapi\using_npapi.vsprops;$(SolutionDir)..\skia\using_skia.vsprops;$(SolutionDir)..\build\external_code.vsprops;$(SolutionDir)..\third_party\icu\build\using_icu.vsprops" > diff --git a/libcef/simple_clipboard_impl.cc b/libcef/simple_clipboard_impl.cc index fd6264a74..077f8da15 100644 --- a/libcef/simple_clipboard_impl.cc +++ b/libcef/simple_clipboard_impl.cc @@ -34,21 +34,22 @@ Clipboard* ClipboardGetClipboard() { return clipboard.Pointer(); } -bool ClipboardIsFormatAvailable(const Clipboard::FormatType& format) { - return ClipboardGetClipboard()->IsFormatAvailable(format); +bool ClipboardIsFormatAvailable(const Clipboard::FormatType& format, + Clipboard::Buffer buffer) { + return ClipboardGetClipboard()->IsFormatAvailable(format, buffer); } -void ClipboardReadText(string16* result) { - ClipboardGetClipboard()->ReadText(result); +void ClipboardReadText(Clipboard::Buffer buffer, string16* result) { + ClipboardGetClipboard()->ReadText(buffer, result); } -void ClipboardReadAsciiText(std::string* result) { - ClipboardGetClipboard()->ReadAsciiText(result); +void ClipboardReadAsciiText(Clipboard::Buffer buffer, std::string* result) { + ClipboardGetClipboard()->ReadAsciiText(buffer, result); } -void ClipboardReadHTML(string16* markup, GURL* url) { +void ClipboardReadHTML(Clipboard::Buffer buffer, string16* markup, GURL* url) { std::string url_str; - ClipboardGetClipboard()->ReadHTML(markup, url ? &url_str : NULL); + ClipboardGetClipboard()->ReadHTML(buffer, markup, url ? &url_str : NULL); if (url) *url = GURL(url_str); } diff --git a/libcef/webview_host.cc b/libcef/webview_host.cc index 4d59d4b19..bce3fa70d 100644 --- a/libcef/webview_host.cc +++ b/libcef/webview_host.cc @@ -4,6 +4,7 @@ #include "precompiled_libcef.h" #include "webview_host.h" +#include "browser_webview_delegate.h" #include "base/gfx/platform_canvas.h" #include "base/gfx/rect.h" @@ -16,7 +17,7 @@ static const wchar_t kWindowClassName[] = L"WebViewHost"; /*static*/ WebViewHost* WebViewHost::Create(HWND parent_view, - WebViewDelegate* delegate, + BrowserWebViewDelegate* delegate, const WebPreferences& prefs) { WebViewHost* host = new WebViewHost(); @@ -39,8 +40,8 @@ WebViewHost* WebViewHost::Create(HWND parent_view, GetModuleHandle(NULL), NULL); win_util::SetWindowUserData(host->view_, host); - host->webwidget_ = WebView::Create(); - prefs.Apply(host->webview()); + host->webwidget_ = WebView::Create(delegate, delegate); + prefs.Apply(host->webview()); host->webview()->InitializeMainFrame(delegate); return host; diff --git a/libcef/webview_host.h b/libcef/webview_host.h index c8b0c5e66..d735aad99 100644 --- a/libcef/webview_host.h +++ b/libcef/webview_host.h @@ -12,7 +12,7 @@ struct WebPreferences; class WebView; -class WebViewDelegate; +class BrowserWebViewDelegate; // This class is a simple ViewHandle-based host for a WebView class WebViewHost : public WebWidgetHost { @@ -21,7 +21,7 @@ class WebViewHost : public WebWidgetHost { // The newly created window should be resized after it is created, using the // MoveWindow (or equivalent) function. static WebViewHost* Create(gfx::NativeView parent_window, - WebViewDelegate* delegate, + BrowserWebViewDelegate* delegate, const WebPreferences& prefs); WebView* webview() const; diff --git a/patch/patches/webkit_glue_plugins.patch b/patch/patches/webkit_glue_plugins.patch index e705b3587..9e19c5b89 100644 --- a/patch/patches/webkit_glue_plugins.patch +++ b/patch/patches/webkit_glue_plugins.patch @@ -1,37 +1,35 @@ Index: plugin_list.cc =================================================================== ---- plugin_list.cc (revision 23814) +--- plugin_list.cc (revision 26359) +++ plugin_list.cc (working copy) -@@ -50,7 +50,7 @@ +@@ -141,6 +141,7 @@ + // other methods if they're called on other threads. + std::vector extra_plugin_paths; + std::vector extra_plugin_dirs; ++ std::vector internal_plugins; + { + AutoLock lock(lock_); + if (plugins_loaded_ && !refresh) +@@ -148,6 +149,7 @@ - void PluginList::RegisterInternalPlugin(const PluginVersionInfo& info) { - AutoLock lock(lock_); -- internal_plugins_.push_back(info); -+ internal_plugins_.insert(internal_plugins_.begin(), info); - } + extra_plugin_paths = extra_plugin_paths_; + extra_plugin_dirs = extra_plugin_dirs_; ++ internal_plugins = internal_plugins_; + } - bool PluginList::ReadPluginInfo(const FilePath &filename, -Index: plugin_list_win.cc -=================================================================== ---- plugin_list_win.cc (revision 23814) -+++ plugin_list_win.cc (working copy) -@@ -356,10 +356,15 @@ - } + base::TimeTicks start_time = base::TimeTicks::Now(); +@@ -157,6 +159,14 @@ + std::vector directories_to_scan; + GetPluginDirectories(&directories_to_scan); - void PluginList::LoadInternalPlugins(std::vector* plugins) { -- if (!use_internal_activex_shim_) -- return; -- LoadPlugin(FilePath(kActiveXShimFileName), plugins); -- LoadPlugin(FilePath(kActiveXShimFileNameForMediaPlayer), plugins); -+ for (size_t i = 0; i < internal_plugins_.size(); ++i) { -+ if (!use_internal_activex_shim_ && -+ (internal_plugins_[i].path.value() == kActiveXShimFileName || -+ internal_plugins_[i].path.value() == -+ kActiveXShimFileNameForMediaPlayer)) { ++ for (size_t i = 0; i < internal_plugins.size(); ++i) { ++#if defined(OS_WIN) ++ if (internal_plugins[i].path.value() == kDefaultPluginLibraryName) + continue; -+ } -+ LoadPlugin(internal_plugins_[i].path, plugins); ++#endif ++ LoadPlugin(internal_plugins[i].path, &new_plugins); + } - } ++ + for (size_t i = 0; i < extra_plugin_paths.size(); ++i) + LoadPlugin(extra_plugin_paths[i], &new_plugins); - } // namespace NPAPI