M128 stage 8

This commit is contained in:
Alexander Frick 2024-10-03 14:04:20 -05:00
parent 314b17e659
commit a178dd9004
34 changed files with 2080 additions and 3712 deletions

View file

@ -231,7 +231,7 @@
<DT><A HREF="https://source.chromium.org/chromium/chromium/src/+/refs/tags/128.0.6613.181:third_party/xnnpack/;bpv=1" ADD_DATE="1691750173" ICON="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAADIUlEQVQ4jW1TXWwUZRQ955ufnZ3dlm4VpE2Q+lND1cSQYDBaKY2VEkUFa1d9K4laBROEIg+mDfvkg5Bu9MWoD/hkTJdqJBFCMRENEqONRkMbIiWGWn5SjWw7OzO7szPf9UFCCnrebu7JuTc55xA3QURYKkEtXw7+1gDm0mDWBtMm+GcAnb+P0VI+lw4fTIp7C6O7dU3nlKFyisxp0TmDRpMmmyDSCqLY96D1HUQIUsxrd9nfD3VrHDbDTi/ENi5V/TCdtmlQ0Y60dmwANNXT0HpodEx+2kNUb/4e45PSUhBR/1lcw6Gvf3fGf4gmJn6NBgGgUBBFAHj+vepdKSvp2r5m/pPu7juqA4fEOTcXvhaG2KAMVjOp5MjJ4eynBOTIz7Vnzs5Jcfoiej9+1TlHAHjyneArKrl/XcVtnQLcS/A/b23J9DzUBgQRcPo84JX90VOF7JCIGFsOBLMCTB/dl3lc9b+7uA1O+jHb4OuFAvVl+oOtLZmekc1JbUc36nt7pb6zK0mslL2n6+3wUZJJyuIuOm7Ps8Xyc8qP3Q+TMDj+2W73MABUatK5vg26vcVQf3navOqL+Ui7kay53dJeEG8AgPE33PEkDI6HSfZ9BRFAQJF/LSVYDSIQEBiKsE0lsRaGNSiTEl43X4SAQKWN8GUj427qG/XyAJB15IvTM+CJKW04FuoiEpd+1Grmj8BvzPIYAGwten2mm9mUsauDBIAnDvgnAHQMrHZX5/NMOguLBy07NXTPKhvVGnDhb0BH3pvfDjcelDExnpoNLormmS/3uT0KAFY0xDs2dhiLqXZsBoBThca9QK1z8mxlZPpCZZeq+2dMqi2AcGYtzOZG9dayrHoFACgiJCkTU9FAJZCtCxX7he3dvCFl60b8ta6lh2/T2Rdf2oam3gc4f2MXRLi7NOd0tq34iFS/aNFHIwBhJLGVSLRqZd3rWNYQfj+L5igOdb6YvoISNEC5LgBSDk9G6ynYScgVrbGgFMsQKSdiLIhIWSe6rGifzz/M8H/bCABjU2L781BeOCMrK5FcvfNeuexB8M1J7N+/MSEpS/n/AGH0clblBN69AAAAAElFTkSuQmCC">xnnpack - Chromium Code Search</A>
<DT><A HREF="https://source.chromium.org/chromium/chromium/src/+/refs/tags/128.0.6613.181:extensions/browser/extension_prefs.cc;bpv=1" ADD_DATE="1691750173" ICON="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAADIUlEQVQ4jW1TXWwUZRQ955ufnZ3dlm4VpE2Q+lND1cSQYDBaKY2VEkUFa1d9K4laBROEIg+mDfvkg5Bu9MWoD/hkTJdqJBFCMRENEqONRkMbIiWGWn5SjWw7OzO7szPf9UFCCnrebu7JuTc55xA3QURYKkEtXw7+1gDm0mDWBtMm+GcAnb+P0VI+lw4fTIp7C6O7dU3nlKFyisxp0TmDRpMmmyDSCqLY96D1HUQIUsxrd9nfD3VrHDbDTi/ENi5V/TCdtmlQ0Y60dmwANNXT0HpodEx+2kNUb/4e45PSUhBR/1lcw6Gvf3fGf4gmJn6NBgGgUBBFAHj+vepdKSvp2r5m/pPu7juqA4fEOTcXvhaG2KAMVjOp5MjJ4eynBOTIz7Vnzs5Jcfoiej9+1TlHAHjyneArKrl/XcVtnQLcS/A/b23J9DzUBgQRcPo84JX90VOF7JCIGFsOBLMCTB/dl3lc9b+7uA1O+jHb4OuFAvVl+oOtLZmekc1JbUc36nt7pb6zK0mslL2n6+3wUZJJyuIuOm7Ps8Xyc8qP3Q+TMDj+2W73MABUatK5vg26vcVQf3navOqL+Ui7kay53dJeEG8AgPE33PEkDI6HSfZ9BRFAQJF/LSVYDSIQEBiKsE0lsRaGNSiTEl43X4SAQKWN8GUj427qG/XyAJB15IvTM+CJKW04FuoiEpd+1Grmj8BvzPIYAGwten2mm9mUsauDBIAnDvgnAHQMrHZX5/NMOguLBy07NXTPKhvVGnDhb0BH3pvfDjcelDExnpoNLormmS/3uT0KAFY0xDs2dhiLqXZsBoBThca9QK1z8mxlZPpCZZeq+2dMqi2AcGYtzOZG9dayrHoFACgiJCkTU9FAJZCtCxX7he3dvCFl60b8ta6lh2/T2Rdf2oam3gc4f2MXRLi7NOd0tq34iFS/aNFHIwBhJLGVSLRqZd3rWNYQfj+L5igOdb6YvoISNEC5LgBSDk9G6ynYScgVrbGgFMsQKSdiLIhIWSe6rGifzz/M8H/bCABjU2L781BeOCMrK5FcvfNeuexB8M1J7N+/MSEpS/n/AGH0clblBN69AAAAAElFTkSuQmCC">extension_prefs.cc - Chromium Code Search</A>
<DT><A HREF="https://source.chromium.org/chromium/chromium/src/+/refs/tags/128.0.6613.181:extensions/common/extension.cc;bpv=1" ADD_DATE="1691750173" ICON="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAADIUlEQVQ4jW1TXWwUZRQ955ufnZ3dlm4VpE2Q+lND1cSQYDBaKY2VEkUFa1d9K4laBROEIg+mDfvkg5Bu9MWoD/hkTJdqJBFCMRENEqONRkMbIiWGWn5SjWw7OzO7szPf9UFCCnrebu7JuTc55xA3QURYKkEtXw7+1gDm0mDWBtMm+GcAnb+P0VI+lw4fTIp7C6O7dU3nlKFyisxp0TmDRpMmmyDSCqLY96D1HUQIUsxrd9nfD3VrHDbDTi/ENi5V/TCdtmlQ0Y60dmwANNXT0HpodEx+2kNUb/4e45PSUhBR/1lcw6Gvf3fGf4gmJn6NBgGgUBBFAHj+vepdKSvp2r5m/pPu7juqA4fEOTcXvhaG2KAMVjOp5MjJ4eynBOTIz7Vnzs5Jcfoiej9+1TlHAHjyneArKrl/XcVtnQLcS/A/b23J9DzUBgQRcPo84JX90VOF7JCIGFsOBLMCTB/dl3lc9b+7uA1O+jHb4OuFAvVl+oOtLZmekc1JbUc36nt7pb6zK0mslL2n6+3wUZJJyuIuOm7Ps8Xyc8qP3Q+TMDj+2W73MABUatK5vg26vcVQf3navOqL+Ui7kay53dJeEG8AgPE33PEkDI6HSfZ9BRFAQJF/LSVYDSIQEBiKsE0lsRaGNSiTEl43X4SAQKWN8GUj427qG/XyAJB15IvTM+CJKW04FuoiEpd+1Grmj8BvzPIYAGwten2mm9mUsauDBIAnDvgnAHQMrHZX5/NMOguLBy07NXTPKhvVGnDhb0BH3pvfDjcelDExnpoNLormmS/3uT0KAFY0xDs2dhiLqXZsBoBThca9QK1z8mxlZPpCZZeq+2dMqi2AcGYtzOZG9dayrHoFACgiJCkTU9FAJZCtCxX7he3dvCFl60b8ta6lh2/T2Rdf2oam3gc4f2MXRLi7NOd0tq34iFS/aNFHIwBhJLGVSLRqZd3rWNYQfj+L5igOdb6YvoISNEC5LgBSDk9G6ynYScgVrbGgFMsQKSdiLIhIWSe6rGifzz/M8H/bCABjU2L781BeOCMrK5FcvfNeuexB8M1J7N+/MSEpS/n/AGH0clblBN69AAAAAElFTkSuQmCC">extension.cc - Chromium Code Search</A>
<DT><A HREF="https://source.chromium.org/chromium/chromium/src/+/refs/tags/128.0.6613.181:chrome/browser/ui/views/tab_search_bubble_host.cc;bpv=1" ADD_DATE="1691750173" ICON="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAADIUlEQVQ4jW1TXWwUZRQ955ufnZ3dlm4VpE2Q+lND1cSQYDBaKY2VEkUFa1d9K4laBROEIg+mDfvkg5Bu9MWoD/hkTJdqJBFCMRENEqONRkMbIiWGWn5SjWw7OzO7szPf9UFCCnrebu7JuTc55xA3QURYKkEtXw7+1gDm0mDWBtMm+GcAnb+P0VI+lw4fTIp7C6O7dU3nlKFyisxp0TmDRpMmmyDSCqLY96D1HUQIUsxrd9nfD3VrHDbDTi/ENi5V/TCdtmlQ0Y60dmwANNXT0HpodEx+2kNUb/4e45PSUhBR/1lcw6Gvf3fGf4gmJn6NBgGgUBBFAHj+vepdKSvp2r5m/pPu7juqA4fEOTcXvhaG2KAMVjOp5MjJ4eynBOTIz7Vnzs5Jcfoiej9+1TlHAHjyneArKrl/XcVtnQLcS/A/b23J9DzUBgQRcPo84JX90VOF7JCIGFsOBLMCTB/dl3lc9b+7uA1O+jHb4OuFAvVl+oOtLZmekc1JbUc36nt7pb6zK0mslL2n6+3wUZJJyuIuOm7Ps8Xyc8qP3Q+TMDj+2W73MABUatK5vg26vcVQf3navOqL+Ui7kay53dJeEG8AgPE33PEkDI6HSfZ9BRFAQJF/LSVYDSIQEBiKsE0lsRaGNSiTEl43X4SAQKWN8GUj427qG/XyAJB15IvTM+CJKW04FuoiEpd+1Grmj8BvzPIYAGwten2mm9mUsauDBIAnDvgnAHQMrHZX5/NMOguLBy07NXTPKhvVGnDhb0BH3pvfDjcelDExnpoNLormmS/3uT0KAFY0xDs2dhiLqXZsBoBThca9QK1z8mxlZPpCZZeq+2dMqi2AcGYtzOZG9dayrHoFACgiJCkTU9FAJZCtCxX7he3dvCFl60b8ta6lh2/T2Rdf2oam3gc4f2MXRLi7NOd0tq34iFS/aNFHIwBhJLGVSLRqZd3rWNYQfj+L5igOdb6YvoISNEC5LgBSDk9G6ynYScgVrbGgFMsQKSdiLIhIWSe6rGifzz/M8H/bCABjU2L781BeOCMrK5FcvfNeuexB8M1J7N+/MSEpS/n/AGH0clblBN69AAAAAElFTkSuQmCC">tab_search_bubble_host.cc - Chromium Code Search</A>
<DT><A HREF="https://source.chromium.org/chromium/chromium/src/+/refs/tags/128.0.6613.181:chrome/browser/ui/tabs/tab_strip_prefs.cc;bpv=1" ADD_DATE="1691750173" ICON="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAADIUlEQVQ4jW1TXWwUZRQ955ufnZ3dlm4VpE2Q+lND1cSQYDBaKY2VEkUFa1d9K4laBROEIg+mDfvkg5Bu9MWoD/hkTJdqJBFCMRENEqONRkMbIiWGWn5SjWw7OzO7szPf9UFCCnrebu7JuTc55xA3QURYKkEtXw7+1gDm0mDWBtMm+GcAnb+P0VI+lw4fTIp7C6O7dU3nlKFyisxp0TmDRpMmmyDSCqLY96D1HUQIUsxrd9nfD3VrHDbDTi/ENi5V/TCdtmlQ0Y60dmwANNXT0HpodEx+2kNUb/4e45PSUhBR/1lcw6Gvf3fGf4gmJn6NBgGgUBBFAHj+vepdKSvp2r5m/pPu7juqA4fEOTcXvhaG2KAMVjOp5MjJ4eynBOTIz7Vnzs5Jcfoiej9+1TlHAHjyneArKrl/XcVtnQLcS/A/b23J9DzUBgQRcPo84JX90VOF7JCIGFsOBLMCTB/dl3lc9b+7uA1O+jHb4OuFAvVl+oOtLZmekc1JbUc36nt7pb6zK0mslL2n6+3wUZJJyuIuOm7Ps8Xyc8qP3Q+TMDj+2W73MABUatK5vg26vcVQf3navOqL+Ui7kay53dJeEG8AgPE33PEkDI6HSfZ9BRFAQJF/LSVYDSIQEBiKsE0lsRaGNSiTEl43X4SAQKWN8GUj427qG/XyAJB15IvTM+CJKW04FuoiEpd+1Grmj8BvzPIYAGwten2mm9mUsauDBIAnDvgnAHQMrHZX5/NMOguLBy07NXTPKhvVGnDhb0BH3pvfDjcelDExnpoNLormmS/3uT0KAFY0xDs2dhiLqXZsBoBThca9QK1z8mxlZPpCZZeq+2dMqi2AcGYtzOZG9dayrHoFACgiJCkTU9FAJZCtCxX7he3dvCFl60b8ta6lh2/T2Rdf2oam3gc4f2MXRLi7NOd0tq34iFS/aNFHIwBhJLGVSLRqZd3rWNYQfj+L5igOdb6YvoISNEC5LgBSDk9G6ynYScgVrbGgFMsQKSdiLIhIWSe6rGifzz/M8H/bCABjU2L781BeOCMrK5FcvfNeuexB8M1J7N+/MSEpS/n/AGH0clblBN69AAAAAElFTkSuQmCC">tab_strip_prefs.cc - Chromium Code Search</A>
<DT><H3 ADD_DATE="1706580118" LAST_MODIFIED="1706580342">VectorIcons</H3>
<DL><p>
<DT><A HREF="https://source.chromium.org/chromium/chromium/src/+/refs/tags/128.0.6613.181:chrome/app/vector_icons/BUILD.gn;bpv=1" ADD_DATE="1706580199" ICON="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAADIUlEQVQ4jW1TXWwUZRQ955ufnZ3dlm4VpE2Q+lND1cSQYDBaKY2VEkUFa1d9K4laBROEIg+mDfvkg5Bu9MWoD/hkTJdqJBFCMRENEqONRkMbIiWGWn5SjWw7OzO7szPf9UFCCnrebu7JuTc55xA3QURYKkEtXw7+1gDm0mDWBtMm+GcAnb+P0VI+lw4fTIp7C6O7dU3nlKFyisxp0TmDRpMmmyDSCqLY96D1HUQIUsxrd9nfD3VrHDbDTi/ENi5V/TCdtmlQ0Y60dmwANNXT0HpodEx+2kNUb/4e45PSUhBR/1lcw6Gvf3fGf4gmJn6NBgGgUBBFAHj+vepdKSvp2r5m/pPu7juqA4fEOTcXvhaG2KAMVjOp5MjJ4eynBOTIz7Vnzs5Jcfoiej9+1TlHAHjyneArKrl/XcVtnQLcS/A/b23J9DzUBgQRcPo84JX90VOF7JCIGFsOBLMCTB/dl3lc9b+7uA1O+jHb4OuFAvVl+oOtLZmekc1JbUc36nt7pb6zK0mslL2n6+3wUZJJyuIuOm7Ps8Xyc8qP3Q+TMDj+2W73MABUatK5vg26vcVQf3navOqL+Ui7kay53dJeEG8AgPE33PEkDI6HSfZ9BRFAQJF/LSVYDSIQEBiKsE0lsRaGNSiTEl43X4SAQKWN8GUj427qG/XyAJB15IvTM+CJKW04FuoiEpd+1Grmj8BvzPIYAGwten2mm9mUsauDBIAnDvgnAHQMrHZX5/NMOguLBy07NXTPKhvVGnDhb0BH3pvfDjcelDExnpoNLormmS/3uT0KAFY0xDs2dhiLqXZsBoBThca9QK1z8mxlZPpCZZeq+2dMqi2AcGYtzOZG9dayrHoFACgiJCkTU9FAJZCtCxX7he3dvCFl60b8ta6lh2/T2Rdf2oam3gc4f2MXRLi7NOd0tq34iFS/aNFHIwBhJLGVSLRqZd3rWNYQfj+L5igOdb6YvoISNEC5LgBSDk9G6ynYScgVrbGgFMsQKSdiLIhIWSe6rGifzz/M8H/bCABjU2L781BeOCMrK5FcvfNeuexB8M1J7N+/MSEpS/n/AGH0clblBN69AAAAAElFTkSuQmCC">BUILD.gn - Chromium Code Search</A>
@ -241,8 +241,9 @@
<DT><A HREF="https://source.chromium.org/chromium/chromium/src/+/refs/tags/128.0.6613.181:chrome/browser/ui/views/toolbar/home_button.cc;bpv=1" ADD_DATE="1706580255" ICON="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAADIUlEQVQ4jW1TXWwUZRQ955ufnZ3dlm4VpE2Q+lND1cSQYDBaKY2VEkUFa1d9K4laBROEIg+mDfvkg5Bu9MWoD/hkTJdqJBFCMRENEqONRkMbIiWGWn5SjWw7OzO7szPf9UFCCnrebu7JuTc55xA3QURYKkEtXw7+1gDm0mDWBtMm+GcAnb+P0VI+lw4fTIp7C6O7dU3nlKFyisxp0TmDRpMmmyDSCqLY96D1HUQIUsxrd9nfD3VrHDbDTi/ENi5V/TCdtmlQ0Y60dmwANNXT0HpodEx+2kNUb/4e45PSUhBR/1lcw6Gvf3fGf4gmJn6NBgGgUBBFAHj+vepdKSvp2r5m/pPu7juqA4fEOTcXvhaG2KAMVjOp5MjJ4eynBOTIz7Vnzs5Jcfoiej9+1TlHAHjyneArKrl/XcVtnQLcS/A/b23J9DzUBgQRcPo84JX90VOF7JCIGFsOBLMCTB/dl3lc9b+7uA1O+jHb4OuFAvVl+oOtLZmekc1JbUc36nt7pb6zK0mslL2n6+3wUZJJyuIuOm7Ps8Xyc8qP3Q+TMDj+2W73MABUatK5vg26vcVQf3navOqL+Ui7kay53dJeEG8AgPE33PEkDI6HSfZ9BRFAQJF/LSVYDSIQEBiKsE0lsRaGNSiTEl43X4SAQKWN8GUj427qG/XyAJB15IvTM+CJKW04FuoiEpd+1Grmj8BvzPIYAGwten2mm9mUsauDBIAnDvgnAHQMrHZX5/NMOguLBy07NXTPKhvVGnDhb0BH3pvfDjcelDExnpoNLormmS/3uT0KAFY0xDs2dhiLqXZsBoBThca9QK1z8mxlZPpCZZeq+2dMqi2AcGYtzOZG9dayrHoFACgiJCkTU9FAJZCtCxX7he3dvCFl60b8ta6lh2/T2Rdf2oam3gc4f2MXRLi7NOd0tq34iFS/aNFHIwBhJLGVSLRqZd3rWNYQfj+L5igOdb6YvoISNEC5LgBSDk9G6ynYScgVrbGgFMsQKSdiLIhIWSe6rGifzz/M8H/bCABjU2L781BeOCMrK5FcvfNeuexB8M1J7N+/MSEpS/n/AGH0clblBN69AAAAAElFTkSuQmCC">home_button.cc - Chromium Code Search</A>
<DT><A HREF="https://source.chromium.org/chromium/chromium/src/+/refs/tags/128.0.6613.181:chrome/browser/ui/views/toolbar/side_panel_toolbar_button.cc;bpv=1" ADD_DATE="1706580257" ICON="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAADIUlEQVQ4jW1TXWwUZRQ955ufnZ3dlm4VpE2Q+lND1cSQYDBaKY2VEkUFa1d9K4laBROEIg+mDfvkg5Bu9MWoD/hkTJdqJBFCMRENEqONRkMbIiWGWn5SjWw7OzO7szPf9UFCCnrebu7JuTc55xA3QURYKkEtXw7+1gDm0mDWBtMm+GcAnb+P0VI+lw4fTIp7C6O7dU3nlKFyisxp0TmDRpMmmyDSCqLY96D1HUQIUsxrd9nfD3VrHDbDTi/ENi5V/TCdtmlQ0Y60dmwANNXT0HpodEx+2kNUb/4e45PSUhBR/1lcw6Gvf3fGf4gmJn6NBgGgUBBFAHj+vepdKSvp2r5m/pPu7juqA4fEOTcXvhaG2KAMVjOp5MjJ4eynBOTIz7Vnzs5Jcfoiej9+1TlHAHjyneArKrl/XcVtnQLcS/A/b23J9DzUBgQRcPo84JX90VOF7JCIGFsOBLMCTB/dl3lc9b+7uA1O+jHb4OuFAvVl+oOtLZmekc1JbUc36nt7pb6zK0mslL2n6+3wUZJJyuIuOm7Ps8Xyc8qP3Q+TMDj+2W73MABUatK5vg26vcVQf3navOqL+Ui7kay53dJeEG8AgPE33PEkDI6HSfZ9BRFAQJF/LSVYDSIQEBiKsE0lsRaGNSiTEl43X4SAQKWN8GUj427qG/XyAJB15IvTM+CJKW04FuoiEpd+1Grmj8BvzPIYAGwten2mm9mUsauDBIAnDvgnAHQMrHZX5/NMOguLBy07NXTPKhvVGnDhb0BH3pvfDjcelDExnpoNLormmS/3uT0KAFY0xDs2dhiLqXZsBoBThca9QK1z8mxlZPpCZZeq+2dMqi2AcGYtzOZG9dayrHoFACgiJCkTU9FAJZCtCxX7he3dvCFl60b8ta6lh2/T2Rdf2oam3gc4f2MXRLi7NOd0tq34iFS/aNFHIwBhJLGVSLRqZd3rWNYQfj+L5igOdb6YvoISNEC5LgBSDk9G6ynYScgVrbGgFMsQKSdiLIhIWSe6rGifzz/M8H/bCABjU2L781BeOCMrK5FcvfNeuexB8M1J7N+/MSEpS/n/AGH0clblBN69AAAAAElFTkSuQmCC">side_panel_toolbar_button.cc - Chromium Code Search</A>
<DT><A HREF="https://source.chromium.org/chromium/chromium/src/+/refs/tags/128.0.6613.181:ui/base/ui_base_features.cc;bpv=1" ADD_DATE="1706580257" ICON="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAADIUlEQVQ4jW1TXWwUZRQ955ufnZ3dlm4VpE2Q+lND1cSQYDBaKY2VEkUFa1d9K4laBROEIg+mDfvkg5Bu9MWoD/hkTJdqJBFCMRENEqONRkMbIiWGWn5SjWw7OzO7szPf9UFCCnrebu7JuTc55xA3QURYKkEtXw7+1gDm0mDWBtMm+GcAnb+P0VI+lw4fTIp7C6O7dU3nlKFyisxp0TmDRpMmmyDSCqLY96D1HUQIUsxrd9nfD3VrHDbDTi/ENi5V/TCdtmlQ0Y60dmwANNXT0HpodEx+2kNUb/4e45PSUhBR/1lcw6Gvf3fGf4gmJn6NBgGgUBBFAHj+vepdKSvp2r5m/pPu7juqA4fEOTcXvhaG2KAMVjOp5MjJ4eynBOTIz7Vnzs5Jcfoiej9+1TlHAHjyneArKrl/XcVtnQLcS/A/b23J9DzUBgQRcPo84JX90VOF7JCIGFsOBLMCTB/dl3lc9b+7uA1O+jHb4OuFAvVl+oOtLZmekc1JbUc36nt7pb6zK0mslL2n6+3wUZJJyuIuOm7Ps8Xyc8qP3Q+TMDj+2W73MABUatK5vg26vcVQf3navOqL+Ui7kay53dJeEG8AgPE33PEkDI6HSfZ9BRFAQJF/LSVYDSIQEBiKsE0lsRaGNSiTEl43X4SAQKWN8GUj427qG/XyAJB15IvTM+CJKW04FuoiEpd+1Grmj8BvzPIYAGwten2mm9mUsauDBIAnDvgnAHQMrHZX5/NMOguLBy07NXTPKhvVGnDhb0BH3pvfDjcelDExnpoNLormmS/3uT0KAFY0xDs2dhiLqXZsBoBThca9QK1z8mxlZPpCZZeq+2dMqi2AcGYtzOZG9dayrHoFACgiJCkTU9FAJZCtCxX7he3dvCFl60b8ta6lh2/T2Rdf2oam3gc4f2MXRLi7NOd0tq34iFS/aNFHIwBhJLGVSLRqZd3rWNYQfj+L5igOdb6YvoISNEC5LgBSDk9G6ynYScgVrbGgFMsQKSdiLIhIWSe6rGifzz/M8H/bCABjU2L781BeOCMrK5FcvfNeuexB8M1J7N+/MSEpS/n/AGH0clblBN69AAAAAElFTkSuQmCC">ui_base_features.cc - Chromium Code Search</A>
<DT><A HREF="https://source.chromium.org/chromium/chromium/src/+/refs/tags/126.0.6478.225:chrome/browser/extensions/extension_management_internal.h;bpv=1" ADD_DATE="1706580257" ICON="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAADIUlEQVQ4jW1TXWwUZRQ955ufnZ3dlm4VpE2Q+lND1cSQYDBaKY2VEkUFa1d9K4laBROEIg+mDfvkg5Bu9MWoD/hkTJdqJBFCMRENEqONRkMbIiWGWn5SjWw7OzO7szPf9UFCCnrebu7JuTc55xA3QURYKkEtXw7+1gDm0mDWBtMm+GcAnb+P0VI+lw4fTIp7C6O7dU3nlKFyisxp0TmDRpMmmyDSCqLY96D1HUQIUsxrd9nfD3VrHDbDTi/ENi5V/TCdtmlQ0Y60dmwANNXT0HpodEx+2kNUb/4e45PSUhBR/1lcw6Gvf3fGf4gmJn6NBgGgUBBFAHj+vepdKSvp2r5m/pPu7juqA4fEOTcXvhaG2KAMVjOp5MjJ4eynBOTIz7Vnzs5Jcfoiej9+1TlHAHjyneArKrl/XcVtnQLcS/A/b23J9DzUBgQRcPo84JX90VOF7JCIGFsOBLMCTB/dl3lc9b+7uA1O+jHb4OuFAvVl+oOtLZmekc1JbUc36nt7pb6zK0mslL2n6+3wUZJJyuIuOm7Ps8Xyc8qP3Q+TMDj+2W73MABUatK5vg26vcVQf3navOqL+Ui7kay53dJeEG8AgPE33PEkDI6HSfZ9BRFAQJF/LSVYDSIQEBiKsE0lsRaGNSiTEl43X4SAQKWN8GUj427qG/XyAJB15IvTM+CJKW04FuoiEpd+1Grmj8BvzPIYAGwten2mm9mUsauDBIAnDvgnAHQMrHZX5/NMOguLBy07NXTPKhvVGnDhb0BH3pvfDjcelDExnpoNLormmS/3uT0KAFY0xDs2dhiLqXZsBoBThca9QK1z8mxlZPpCZZeq+2dMqi2AcGYtzOZG9dayrHoFACgiJCkTU9FAJZCtCxX7he3dvCFl60b8ta6lh2/T2Rdf2oam3gc4f2MXRLi7NOd0tq34iFS/aNFHIwBhJLGVSLRqZd3rWNYQfj+L5igOdb6YvoISNEC5LgBSDk9G6ynYScgVrbGgFMsQKSdiLIhIWSe6rGifzz/M8H/bCABjU2L781BeOCMrK5FcvfNeuexB8M1J7N+/MSEpS/n/AGH0clblBN69AAAAAElFTkSuQmCC">extension_management_internal.h - Chromium Code Search</A>
<DT><A HREF="https://source.chromium.org/chromium/chromium/src/+/refs/tags/126.0.6478.225:chrome/browser/extensions/component_extensions_allowlist/allowlist.cc;bpv=1" ADD_DATE="1706580257" ICON="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAADIUlEQVQ4jW1TXWwUZRQ955ufnZ3dlm4VpE2Q+lND1cSQYDBaKY2VEkUFa1d9K4laBROEIg+mDfvkg5Bu9MWoD/hkTJdqJBFCMRENEqONRkMbIiWGWn5SjWw7OzO7szPf9UFCCnrebu7JuTc55xA3QURYKkEtXw7+1gDm0mDWBtMm+GcAnb+P0VI+lw4fTIp7C6O7dU3nlKFyisxp0TmDRpMmmyDSCqLY96D1HUQIUsxrd9nfD3VrHDbDTi/ENi5V/TCdtmlQ0Y60dmwANNXT0HpodEx+2kNUb/4e45PSUhBR/1lcw6Gvf3fGf4gmJn6NBgGgUBBFAHj+vepdKSvp2r5m/pPu7juqA4fEOTcXvhaG2KAMVjOp5MjJ4eynBOTIz7Vnzs5Jcfoiej9+1TlHAHjyneArKrl/XcVtnQLcS/A/b23J9DzUBgQRcPo84JX90VOF7JCIGFsOBLMCTB/dl3lc9b+7uA1O+jHb4OuFAvVl+oOtLZmekc1JbUc36nt7pb6zK0mslL2n6+3wUZJJyuIuOm7Ps8Xyc8qP3Q+TMDj+2W73MABUatK5vg26vcVQf3navOqL+Ui7kay53dJeEG8AgPE33PEkDI6HSfZ9BRFAQJF/LSVYDSIQEBiKsE0lsRaGNSiTEl43X4SAQKWN8GUj427qG/XyAJB15IvTM+CJKW04FuoiEpd+1Grmj8BvzPIYAGwten2mm9mUsauDBIAnDvgnAHQMrHZX5/NMOguLBy07NXTPKhvVGnDhb0BH3pvfDjcelDExnpoNLormmS/3uT0KAFY0xDs2dhiLqXZsBoBThca9QK1z8mxlZPpCZZeq+2dMqi2AcGYtzOZG9dayrHoFACgiJCkTU9FAJZCtCxX7he3dvCFl60b8ta6lh2/T2Rdf2oam3gc4f2MXRLi7NOd0tq34iFS/aNFHIwBhJLGVSLRqZd3rWNYQfj+L5igOdb6YvoISNEC5LgBSDk9G6ynYScgVrbGgFMsQKSdiLIhIWSe6rGifzz/M8H/bCABjU2L781BeOCMrK5FcvfNeuexB8M1J7N+/MSEpS/n/AGH0clblBN69AAAAAElFTkSuQmCC">allowlist.cc - Chromium Code Search</A>
<DT><A HREF="https://source.chromium.org/chromium/chromium/src/+/refs/tags/128.0.6613.181:ui/base/ui_base_features.h;bpv=1" ADD_DATE="1706580257" ICON="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAADIUlEQVQ4jW1TXWwUZRQ955ufnZ3dlm4VpE2Q+lND1cSQYDBaKY2VEkUFa1d9K4laBROEIg+mDfvkg5Bu9MWoD/hkTJdqJBFCMRENEqONRkMbIiWGWn5SjWw7OzO7szPf9UFCCnrebu7JuTc55xA3QURYKkEtXw7+1gDm0mDWBtMm+GcAnb+P0VI+lw4fTIp7C6O7dU3nlKFyisxp0TmDRpMmmyDSCqLY96D1HUQIUsxrd9nfD3VrHDbDTi/ENi5V/TCdtmlQ0Y60dmwANNXT0HpodEx+2kNUb/4e45PSUhBR/1lcw6Gvf3fGf4gmJn6NBgGgUBBFAHj+vepdKSvp2r5m/pPu7juqA4fEOTcXvhaG2KAMVjOp5MjJ4eynBOTIz7Vnzs5Jcfoiej9+1TlHAHjyneArKrl/XcVtnQLcS/A/b23J9DzUBgQRcPo84JX90VOF7JCIGFsOBLMCTB/dl3lc9b+7uA1O+jHb4OuFAvVl+oOtLZmekc1JbUc36nt7pb6zK0mslL2n6+3wUZJJyuIuOm7Ps8Xyc8qP3Q+TMDj+2W73MABUatK5vg26vcVQf3navOqL+Ui7kay53dJeEG8AgPE33PEkDI6HSfZ9BRFAQJF/LSVYDSIQEBiKsE0lsRaGNSiTEl43X4SAQKWN8GUj427qG/XyAJB15IvTM+CJKW04FuoiEpd+1Grmj8BvzPIYAGwten2mm9mUsauDBIAnDvgnAHQMrHZX5/NMOguLBy07NXTPKhvVGnDhb0BH3pvfDjcelDExnpoNLormmS/3uT0KAFY0xDs2dhiLqXZsBoBThca9QK1z8mxlZPpCZZeq+2dMqi2AcGYtzOZG9dayrHoFACgiJCkTU9FAJZCtCxX7he3dvCFl60b8ta6lh2/T2Rdf2oam3gc4f2MXRLi7NOd0tq34iFS/aNFHIwBhJLGVSLRqZd3rWNYQfj+L5igOdb6YvoISNEC5LgBSDk9G6ynYScgVrbGgFMsQKSdiLIhIWSe6rGifzz/M8H/bCABjU2L781BeOCMrK5FcvfNeuexB8M1J7N+/MSEpS/n/AGH0clblBN69AAAAAElFTkSuQmCC">ui_base_features.h - Chromium Code Search</A>
<DT><A HREF="https://source.chromium.org/chromium/chromium/src/+/refs/tags/128.0.6613.181:chrome/browser/extensions/extension_management_internal.h;bpv=1" ADD_DATE="1706580257" ICON="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAADIUlEQVQ4jW1TXWwUZRQ955ufnZ3dlm4VpE2Q+lND1cSQYDBaKY2VEkUFa1d9K4laBROEIg+mDfvkg5Bu9MWoD/hkTJdqJBFCMRENEqONRkMbIiWGWn5SjWw7OzO7szPf9UFCCnrebu7JuTc55xA3QURYKkEtXw7+1gDm0mDWBtMm+GcAnb+P0VI+lw4fTIp7C6O7dU3nlKFyisxp0TmDRpMmmyDSCqLY96D1HUQIUsxrd9nfD3VrHDbDTi/ENi5V/TCdtmlQ0Y60dmwANNXT0HpodEx+2kNUb/4e45PSUhBR/1lcw6Gvf3fGf4gmJn6NBgGgUBBFAHj+vepdKSvp2r5m/pPu7juqA4fEOTcXvhaG2KAMVjOp5MjJ4eynBOTIz7Vnzs5Jcfoiej9+1TlHAHjyneArKrl/XcVtnQLcS/A/b23J9DzUBgQRcPo84JX90VOF7JCIGFsOBLMCTB/dl3lc9b+7uA1O+jHb4OuFAvVl+oOtLZmekc1JbUc36nt7pb6zK0mslL2n6+3wUZJJyuIuOm7Ps8Xyc8qP3Q+TMDj+2W73MABUatK5vg26vcVQf3navOqL+Ui7kay53dJeEG8AgPE33PEkDI6HSfZ9BRFAQJF/LSVYDSIQEBiKsE0lsRaGNSiTEl43X4SAQKWN8GUj427qG/XyAJB15IvTM+CJKW04FuoiEpd+1Grmj8BvzPIYAGwten2mm9mUsauDBIAnDvgnAHQMrHZX5/NMOguLBy07NXTPKhvVGnDhb0BH3pvfDjcelDExnpoNLormmS/3uT0KAFY0xDs2dhiLqXZsBoBThca9QK1z8mxlZPpCZZeq+2dMqi2AcGYtzOZG9dayrHoFACgiJCkTU9FAJZCtCxX7he3dvCFl60b8ta6lh2/T2Rdf2oam3gc4f2MXRLi7NOd0tq34iFS/aNFHIwBhJLGVSLRqZd3rWNYQfj+L5igOdb6YvoISNEC5LgBSDk9G6ynYScgVrbGgFMsQKSdiLIhIWSe6rGifzz/M8H/bCABjU2L781BeOCMrK5FcvfNeuexB8M1J7N+/MSEpS/n/AGH0clblBN69AAAAAElFTkSuQmCC">extension_management_internal.h - Chromium Code Search</A>
<DT><A HREF="https://source.chromium.org/chromium/chromium/src/+/refs/tags/128.0.6613.181:chrome/browser/extensions/component_extensions_allowlist/allowlist.cc;bpv=1" ADD_DATE="1706580257" ICON="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAADIUlEQVQ4jW1TXWwUZRQ955ufnZ3dlm4VpE2Q+lND1cSQYDBaKY2VEkUFa1d9K4laBROEIg+mDfvkg5Bu9MWoD/hkTJdqJBFCMRENEqONRkMbIiWGWn5SjWw7OzO7szPf9UFCCnrebu7JuTc55xA3QURYKkEtXw7+1gDm0mDWBtMm+GcAnb+P0VI+lw4fTIp7C6O7dU3nlKFyisxp0TmDRpMmmyDSCqLY96D1HUQIUsxrd9nfD3VrHDbDTi/ENi5V/TCdtmlQ0Y60dmwANNXT0HpodEx+2kNUb/4e45PSUhBR/1lcw6Gvf3fGf4gmJn6NBgGgUBBFAHj+vepdKSvp2r5m/pPu7juqA4fEOTcXvhaG2KAMVjOp5MjJ4eynBOTIz7Vnzs5Jcfoiej9+1TlHAHjyneArKrl/XcVtnQLcS/A/b23J9DzUBgQRcPo84JX90VOF7JCIGFsOBLMCTB/dl3lc9b+7uA1O+jHb4OuFAvVl+oOtLZmekc1JbUc36nt7pb6zK0mslL2n6+3wUZJJyuIuOm7Ps8Xyc8qP3Q+TMDj+2W73MABUatK5vg26vcVQf3navOqL+Ui7kay53dJeEG8AgPE33PEkDI6HSfZ9BRFAQJF/LSVYDSIQEBiKsE0lsRaGNSiTEl43X4SAQKWN8GUj427qG/XyAJB15IvTM+CJKW04FuoiEpd+1Grmj8BvzPIYAGwten2mm9mUsauDBIAnDvgnAHQMrHZX5/NMOguLBy07NXTPKhvVGnDhb0BH3pvfDjcelDExnpoNLormmS/3uT0KAFY0xDs2dhiLqXZsBoBThca9QK1z8mxlZPpCZZeq+2dMqi2AcGYtzOZG9dayrHoFACgiJCkTU9FAJZCtCxX7he3dvCFl60b8ta6lh2/T2Rdf2oam3gc4f2MXRLi7NOd0tq34iFS/aNFHIwBhJLGVSLRqZd3rWNYQfj+L5igOdb6YvoISNEC5LgBSDk9G6ynYScgVrbGgFMsQKSdiLIhIWSe6rGifzz/M8H/bCABjU2L781BeOCMrK5FcvfNeuexB8M1J7N+/MSEpS/n/AGH0clblBN69AAAAAElFTkSuQmCC">allowlist.cc - Chromium Code Search</A>
</DL><p>
</DL><p>
<DT><A HREF="https://source.chromium.org/" ADD_DATE="1661054752" ICON="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAADIUlEQVQ4jW1TXWwUZRQ955ufnZ3dlm4VpE2Q+lND1cSQYDBaKY2VEkUFa1d9K4laBROEIg+mDfvkg5Bu9MWoD/hkTJdqJBFCMRENEqONRkMbIiWGWn5SjWw7OzO7szPf9UFCCnrebu7JuTc55xA3QURYKkEtXw7+1gDm0mDWBtMm+GcAnb+P0VI+lw4fTIp7C6O7dU3nlKFyisxp0TmDRpMmmyDSCqLY96D1HUQIUsxrd9nfD3VrHDbDTi/ENi5V/TCdtmlQ0Y60dmwANNXT0HpodEx+2kNUb/4e45PSUhBR/1lcw6Gvf3fGf4gmJn6NBgGgUBBFAHj+vepdKSvp2r5m/pPu7juqA4fEOTcXvhaG2KAMVjOp5MjJ4eynBOTIz7Vnzs5Jcfoiej9+1TlHAHjyneArKrl/XcVtnQLcS/A/b23J9DzUBgQRcPo84JX90VOF7JCIGFsOBLMCTB/dl3lc9b+7uA1O+jHb4OuFAvVl+oOtLZmekc1JbUc36nt7pb6zK0mslL2n6+3wUZJJyuIuOm7Ps8Xyc8qP3Q+TMDj+2W73MABUatK5vg26vcVQf3navOqL+Ui7kay53dJeEG8AgPE33PEkDI6HSfZ9BRFAQJF/LSVYDSIQEBiKsE0lsRaGNSiTEl43X4SAQKWN8GUj427qG/XyAJB15IvTM+CJKW04FuoiEpd+1Grmj8BvzPIYAGwten2mm9mUsauDBIAnDvgnAHQMrHZX5/NMOguLBy07NXTPKhvVGnDhb0BH3pvfDjcelDExnpoNLormmS/3uT0KAFY0xDs2dhiLqXZsBoBThca9QK1z8mxlZPpCZZeq+2dMqi2AcGYtzOZG9dayrHoFACgiJCkTU9FAJZCtCxX7he3dvCFl60b8ta6lh2/T2Rdf2oam3gc4f2MXRLi7NOd0tq34iFS/aNFHIwBhJLGVSLRqZd3rWNYQfj+L5igOdb6YvoISNEC5LgBSDk9G6ynYScgVrbGgFMsQKSdiLIhIWSe6rGifzz/M8H/bCABjU2L781BeOCMrK5FcvfNeuexB8M1J7N+/MSEpS/n/AGH0clblBN69AAAAAElFTkSuQmCC">Chromium Code Search</A>

View file

@ -8,6 +8,7 @@
#include "base/functional/callback.h"
#include "base/no_destructor.h"
#include "media/base/media_switches.h"
#include "ui/events/event_constants.h"
namespace ash {
@ -112,6 +113,8 @@ const AcceleratorData kAcceleratorData[] = {
AcceleratorAction::kToggleHighContrast},
{true, ui::VKEY_Z, ui::EF_CONTROL_DOWN | ui::EF_ALT_DOWN,
AcceleratorAction::kToggleSpokenFeedback},
{true, ui::VKEY_S, ui::EF_COMMAND_DOWN,
AcceleratorAction::kEnableSelectToSpeak},
{true, ui::VKEY_D, ui::EF_COMMAND_DOWN,
AcceleratorAction::kEnableOrToggleDictation},
{true, ui::VKEY_DICTATE, ui::EF_NONE,
@ -126,6 +129,7 @@ const AcceleratorData kAcceleratorData[] = {
{false, ui::VKEY_RSHIFT, ui::EF_NONE, AcceleratorAction::kDisableCapsLock},
{true, ui::VKEY_C, ui::EF_COMMAND_DOWN, AcceleratorAction::kToggleCalendar},
// Accelerators to toggle Caps Lock.
{true, ui::VKEY_CAPITAL, ui::EF_NONE, AcceleratorAction::kToggleCapsLock},
// The following is triggered when Search is released while Alt is still
// down. The key_code here is LWIN (for search) and Alt is a modifier.
{false, ui::VKEY_LWIN, ui::EF_ALT_DOWN, AcceleratorAction::kToggleCapsLock},
@ -242,7 +246,7 @@ const AcceleratorData kAcceleratorData[] = {
{true, ui::VKEY_BROWSER_BACK, ui::EF_NONE,
AcceleratorAction::kMinimizeTopWindowOnBack},
{true, ui::VKEY_G, ui::EF_SHIFT_DOWN | ui::EF_COMMAND_DOWN,
AcceleratorAction::kToggleSnapGroupWindowsGroupAndUngroup},
AcceleratorAction::kCreateSnapGroup},
{true, ui::VKEY_D, ui::EF_SHIFT_DOWN | ui::EF_COMMAND_DOWN,
AcceleratorAction::kToggleSnapGroupWindowsMinimizeAndRestore},
{true, ui::VKEY_Z, ui::EF_COMMAND_DOWN,
@ -258,6 +262,9 @@ const AcceleratorData kAcceleratorData[] = {
{true, ui::VKEY_M, ui::EF_COMMAND_DOWN | ui::EF_CONTROL_DOWN,
AcceleratorAction::kToggleFullscreenMagnifier},
{true, ui::VKEY_M, ui::EF_COMMAND_DOWN | ui::EF_SHIFT_DOWN,
AcceleratorAction::kToggleMouseKeys},
// Media Player shortcuts.
{true, ui::VKEY_MEDIA_NEXT_TRACK, ui::EF_NONE,
AcceleratorAction::kMediaNextTrack},
@ -401,20 +408,26 @@ const size_t kToggleGameDashboardAcceleratorDataLength =
std::size(kToggleGameDashboardAcceleratorData);
const AcceleratorData kTogglePickerAcceleratorData[] = {
{true, ui::VKEY_RIGHT_ALT, ui::EF_NONE, AcceleratorAction::kTogglePicker},
{false, ui::VKEY_RIGHT_ALT, ui::EF_NONE, AcceleratorAction::kTogglePicker},
{true, ui::VKEY_F, ui::EF_COMMAND_DOWN, AcceleratorAction::kTogglePicker},
};
const size_t kTogglePickerAcceleratorDataLength =
std::size(kTogglePickerAcceleratorData);
const AcceleratorData kTogglePickerFlipAcceleratorData[] = {
{false, ui::VKEY_RIGHT_ALT, ui::EF_NONE, AcceleratorAction::kTogglePicker},
{true, ui::VKEY_F, ui::EF_COMMAND_DOWN, AcceleratorAction::kTogglePicker},
const AcceleratorData kTilingWindowResizeAcceleratorData[] = {
{true, ui::VKEY_OEM_COMMA, ui::EF_COMMAND_DOWN | ui::EF_CONTROL_DOWN,
AcceleratorAction::kTilingWindowResizeLeft},
{true, ui::VKEY_OEM_PERIOD, ui::EF_COMMAND_DOWN | ui::EF_CONTROL_DOWN,
AcceleratorAction::kTilingWindowResizeRight},
{true, ui::VKEY_OEM_1, ui::EF_COMMAND_DOWN | ui::EF_CONTROL_DOWN,
AcceleratorAction::kTilingWindowResizeUp},
{true, ui::VKEY_OEM_2, ui::EF_COMMAND_DOWN | ui::EF_CONTROL_DOWN,
AcceleratorAction::kTilingWindowResizeDown},
};
const size_t kTogglePickerFlipAcceleratorDataLength =
std::size(kTogglePickerAcceleratorData);
const size_t kTilingWindowResizeAcceleratorDataLength =
std::size(kTilingWindowResizeAcceleratorData);
// static
AcceleratorController* AcceleratorController::Get() {

View file

@ -14,29 +14,21 @@ aggregate_vector_icons("chrome_vector_icons") {
sources = [
# go/keep-sorted start
"account_add_chrome_refresh.icon",
"account_box.icon",
"account_child.icon",
"account_child_circle.icon",
"account_circle.icon",
"account_circle_chrome_refresh.icon",
"account_manage_chrome_refresh.icon",
"add.icon",
"add_chrome_refresh.icon",
"apps.icon",
"auto_tab_groups.icon",
"autofill/local_offer_flipped.icon",
"autofill/local_offer_flipped_refresh.icon",
"autofill/webauthn_dialog_header.icon",
"autofill/webauthn_dialog_header_dark.icon",
"back_arrow_touch.icon",
"backspace.icon",
"battery_saver.icon",
"battery_saver_refresh.icon",
"blocked_redirect.icon",
"bookmark_all_tabs_chrome_refresh.icon",
"bookmarkbar_overflow_refresh.icon",
"bookmarkbar_touch_overflow.icon",
"bookmarks_chrome_refresh.icon",
"bookmarks_lists_menu.icon",
"bookmarks_manager.icon",
"bookmarks_side_panel.icon",
@ -51,9 +43,7 @@ aggregate_vector_icons("chrome_vector_icons") {
"cast_chrome_refresh.icon",
"chevron_right.icon",
"chevron_right_chrome_refresh.icon",
"chrome_labs.icon",
"chrome_labs_chrome_refresh.icon",
"chrome_labs_touch.icon",
"chromium_minimize.icon",
"click_to_call_illustration.icon",
"click_to_call_illustration_dark.icon",
"close_chrome_refresh.icon",
@ -73,7 +63,6 @@ aggregate_vector_icons("chrome_vector_icons") {
"developer_tools.icon",
"devices.icon",
"devices_chrome_refresh.icon",
"download_in_progress.icon",
"download_in_progress_chrome_refresh.icon",
"download_in_progress_touch.icon",
"download_menu.icon",
@ -84,7 +73,6 @@ aggregate_vector_icons("chrome_vector_icons") {
"drag_handle.icon",
"drive_shortcut_chrome_refresh.icon",
"edit_chrome_refresh.icon",
"eol.icon",
"exit_menu.icon",
"extension_crashed.icon",
"file_download_shelf.icon",
@ -97,26 +85,24 @@ aggregate_vector_icons("chrome_vector_icons") {
"fullscreen_refresh.icon",
"generic_stop.icon",
"globe.icon",
"guardian.icon",
"guest_menu_art.icon",
"hardware_computer.icon",
"hardware_computer_small.icon",
"hardware_smartphone.icon",
"help_menu.icon",
"history.icon",
"horizontal_menu.icon",
"incognito.icon",
"incognito_menu_art.icon",
"incognito_profile.icon",
"incognito_refresh_menu.icon",
"info.icon",
"ink_highlighter.icon",
"input.icon",
"install_desktop_chrome_refresh.icon",
"journeys.icon",
"keep_pin_chrome_refresh.icon",
"keep_pin_filled_chrome_refresh.icon",
"key.icon",
"key_chrome_refresh.icon",
"keyboard_arrow_down.icon",
"keyboard_arrow_down_chrome_refresh.icon",
"keyboard_arrow_right.icon",
@ -128,7 +114,6 @@ aggregate_vector_icons("chrome_vector_icons") {
"link_chrome_refresh.icon",
"media_controls_arrow_drop_down.icon",
"media_controls_arrow_drop_up.icon",
"media_toolbar_button.icon",
"media_toolbar_button_chrome_refresh.icon",
"media_toolbar_button_touch.icon",
"memory_saver.icon",
@ -148,17 +133,14 @@ aggregate_vector_icons("chrome_vector_icons") {
"new_tab_in_group_refresh.icon",
"new_tab_refresh.icon",
"new_window.icon",
"nfc.icon",
"note_outline.icon",
"notes.icon",
"open_in_browser.icon",
"open_in_new.icon",
"open_in_new_chrome_refresh.icon",
"open_in_new_off_chrome_refresh.icon",
"overflow_button.icon",
"overflow_button_touch.icon",
"overflow_chevron.icon",
"paintbrush.icon",
"palette.icon",
"paste_menu.icon",
"payments/save_card_and_vcn_success_confirmation.icon",
"payments/save_card_and_vcn_success_confirmation_dark.icon",
@ -166,30 +148,17 @@ aggregate_vector_icons("chrome_vector_icons") {
"person.icon",
"person_filled_padded_large.icon",
"person_filled_padded_small.icon",
"photo_camera.icon",
"picture_in_picture_alt.icon",
"picture_in_picture_control_background.icon",
"print_menu.icon",
"privacy_tip.icon",
"qr_code_chrome_refresh.icon",
"qrcode_generator.icon",
"quick_commands.icon",
"read_anything_letter_spacing.icon",
"read_anything_letter_spacing_standard.icon",
"read_anything_letter_spacing_very_wide.icon",
"read_anything_letter_spacing_wide.icon",
"read_anything_line_spacing.icon",
"read_anything_line_spacing_loose.icon",
"read_anything_line_spacing_standard.icon",
"read_anything_line_spacing_very_loose.icon",
"read_anything_links_disabled.icon",
"read_anything_links_enabled.icon",
"read_later_add.icon",
"reading_list.icon",
"release_alert.icon",
"reload_touch.icon",
"remove.icon",
"remove_box.icon",
"report.icon",
"request_mobile_site_checked.icon",
"request_mobile_site_unchecked.icon",
@ -200,67 +169,43 @@ aggregate_vector_icons("chrome_vector_icons") {
"save_group_refresh.icon",
"save_page.icon",
"saved_tab_group_bar_everything.icon",
"science.icon",
"search_menu.icon",
"security.icon",
"settings_menu.icon",
"sharing_hub_screenshot.icon",
"side_panel.icon",
"side_panel_chrome_refresh.icon",
"side_panel_left.icon",
"side_panel_left_chrome_refresh.icon",
"side_panel_left_touch.icon",
"side_panel_touch.icon",
"sign_out.icon",
"signin_button_drop_down_arrow.icon",
"smartphone.icon",
"smartphone_refresh.icon",
"speaker.icon",
"speaker_group.icon",
"submit_feedback.icon",
"supervisor_account.icon",
"supervisor_account_circle.icon",
"sync_chrome_refresh.icon",
"sync_circle.icon",
"sync_disabled_chrome_refresh.icon",
"sync_error_circle.icon",
"sync_paused.icon",
"sync_paused_circle.icon",
"sync_problem.icon",
"sync_refresh.icon",
"sync_switch_account.icon",
"tab.icon",
"tab_audio.icon",
"tab_audio_muting.icon",
"tab_audio_muting_rounded.icon",
"tab_audio_rounded.icon",
"tab_bluetooth_connected.icon",
"tab_bluetooth_scan_active.icon",
"tab_close_normal.icon",
"tab_group.icon",
"tab_groups_sync.icon",
"tab_media_capturing.icon",
"tab_media_capturing_with_arrow.icon",
"tab_media_recording.icon",
"tab_search.icon",
"tab_usb_connected.icon",
"tablet.icon",
"task_manager.icon",
"text_decrease.icon",
"text_increase.icon",
"toolbar_chrome_refresh.icon",
"trailing_scroll.icon",
"translate.icon",
"trash_can.icon",
"trash_can_light.icon",
"trash_can_refresh.icon",
"tv.icon",
"unbranded_translate.icon",
"ungroup_refresh.icon",
"usb_cable.icon",
"user_account_avatar.icon",
"user_account_avatar_refresh.icon",
"user_menu_guest.icon",
"user_menu_right_arrow.icon",
"web.icon",
"webauthn/icloud_keychain.icon",
"webauthn/passkey_aoa.icon",
@ -278,13 +223,11 @@ aggregate_vector_icons("chrome_vector_icons") {
"webauthn/usb_security_key.icon",
"webauthn/webauthn_error.icon",
"webauthn/webauthn_error_dark.icon",
"webauthn/windows_hello.icon",
"webid_globe.icon",
"zoom_in.icon",
"zoom_minus.icon",
"zoom_minus_chrome_refresh.icon",
"zoom_minus_menu_refresh.icon",
"zoom_plus.icon",
"zoom_plus_chrome_refresh.icon",
"zoom_plus_menu_refresh.icon",
@ -299,6 +242,7 @@ aggregate_vector_icons("chrome_vector_icons") {
"thorium/chrome_labs_chrome_refresh_thorium.icon",
"thorium/navigate_home_thorium.icon",
"thorium/navigate_home_chrome_refresh_thorium.icon",
"thorium/science_thorium.icon",
"thorium/side_panel_left_thorium.icon",
"thorium/side_panel_left_chrome_refresh_thorium.icon",
"thorium/side_panel_left_touch_thorium.icon",
@ -309,10 +253,7 @@ aggregate_vector_icons("chrome_vector_icons") {
}
if (is_mac) {
sources += [
"default_favicon.icon",
"new_tab_mac_touchbar.icon",
]
sources += [ "new_tab_mac_touchbar.icon" ]
}
if (is_win) {
@ -337,7 +278,6 @@ aggregate_vector_icons("chrome_vector_icons") {
if (is_chromeos) {
sources += [
"crostini_mascot.icon",
"notification_download.icon",
"terminal_ssh.icon",
]
}
@ -387,10 +327,6 @@ aggregate_vector_icons("chrome_vector_icons") {
sources += [ "nearby_share.icon" ]
}
if ((enable_vr && !is_android) || is_chromeos_ash) {
sources += [ "open_in_browser.icon" ]
}
if (enable_webui_tab_strip) {
sources += [ "new_tab_toolbar_button.icon" ]
}

View file

@ -0,0 +1,105 @@
// Copyright 2024 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
CANVAS_DIMENSIONS, 24,
FILL_RULE_NONZERO,
PATH_COLOR_ARGB, 0xFF, 0x87, 0xFF, 0xC5,
MOVE_TO, 5, 21,
R_CUBIC_TO, -0.85f, 0, -1.45f, -0.38f, -1.81f, -1.14f,
R_CUBIC_TO, -0.36f, -0.76f, -0.27f, -1.46f, 0.26f, -2.11f,
LINE_TO, 9, 11,
V_LINE_TO, 5,
H_LINE_TO, 8,
R_ARC_TO, 0.96f, 0.96f, 0, 0, 1, -0.71f, -0.29f,
ARC_TO, 0.96f, 0.96f, 0, 0, 1, 7, 4,
R_CUBIC_TO, 0, -0.28f, 0.1f, -0.52f, 0.29f, -0.71f,
ARC_TO, 0.96f, 0.96f, 0, 0, 1, 8, 3,
R_H_LINE_TO, 8,
R_CUBIC_TO, 0.28f, 0, 0.52f, 0.1f, 0.71f, 0.29f,
R_CUBIC_TO, 0.19f, 0.19f, 0.29f, 0.43f, 0.29f, 0.71f,
R_CUBIC_TO, 0, 0.28f, -0.1f, 0.52f, -0.29f, 0.71f,
ARC_TO, 0.96f, 0.96f, 0, 0, 1, 16, 5,
R_H_LINE_TO, -1,
R_V_LINE_TO, 6,
R_LINE_TO, 5.55f, 6.75f,
R_CUBIC_TO, 0.53f, 0.65f, 0.62f, 1.36f, 0.26f, 2.11f,
CUBIC_TO, 20.45f, 20.62f, 19.85f, 21, 19, 21,
CLOSE,
R_MOVE_TO, 0, -2,
R_H_LINE_TO, 14,
R_LINE_TO, -6, -7.3f,
V_LINE_TO, 5,
R_H_LINE_TO, -2,
R_V_LINE_TO, 6.7f,
CLOSE,
R_MOVE_TO, 7, -7,
CLOSE
CANVAS_DIMENSIONS, 20,
FILL_RULE_NONZERO,
PATH_COLOR_ARGB, 0xFF, 0x87, 0xFF, 0xC5,
MOVE_TO, 4.5f, 17,
R_CUBIC_TO, -0.64f, 0, -1.1f, -0.28f, -1.37f, -0.84f,
R_CUBIC_TO, -0.28f, -0.56f, -0.21f, -1.09f, 0.19f, -1.58f,
LINE_TO, 7.5f, 9.5f,
R_V_LINE_TO, -5,
R_H_LINE_TO, -0.75f,
R_CUBIC_TO, -0.21f, 0, -0.39f, -0.07f, -0.53f, -0.21f,
ARC_TO, 0.72f, 0.72f, 0, 0, 1, 6, 3.75f,
R_CUBIC_TO, 0, -0.21f, 0.07f, -0.39f, 0.22f, -0.53f,
ARC_TO, 0.73f, 0.73f, 0, 0, 1, 6.75f, 3,
R_H_LINE_TO, 6.5f,
R_CUBIC_TO, 0.21f, 0, 0.39f, 0.07f, 0.54f, 0.22f,
R_CUBIC_TO, 0.14f, 0.14f, 0.22f, 0.32f, 0.22f, 0.53f,
R_CUBIC_TO, 0, 0.21f, -0.07f, 0.39f, -0.21f, 0.54f,
R_ARC_TO, 0.73f, 0.73f, 0, 0, 1, -0.53f, 0.22f,
R_H_LINE_TO, -0.75f,
R_V_LINE_TO, 5,
R_LINE_TO, 4.19f, 5.08f,
R_CUBIC_TO, 0.39f, 0.49f, 0.45f, 1.01f, 0.17f, 1.57f,
R_CUBIC_TO, -0.28f, 0.56f, -0.73f, 0.84f, -1.35f, 0.84f,
CLOSE,
R_MOVE_TO, 0, -1.5f,
R_H_LINE_TO, 11,
LINE_TO, 11, 10,
V_LINE_TO, 4.5f,
H_LINE_TO, 9,
V_LINE_TO, 10,
CLOSE,
R_MOVE_TO, 5.52f, -5.5f,
CLOSE
CANVAS_DIMENSIONS, 16,
FILL_RULE_NONZERO,
PATH_COLOR_ARGB, 0xFF, 0x87, 0xFF, 0xC5,
MOVE_TO, 3.6f, 13.73f,
R_CUBIC_TO, -0.57f, 0, -0.98f, -0.25f, -1.22f, -0.75f,
R_CUBIC_TO, -0.25f, -0.5f, -0.19f, -0.97f, 0.17f, -1.41f,
R_LINE_TO, 3.32f, -4.03f,
V_LINE_TO, 3.69f,
R_H_LINE_TO, -0.47f,
R_ARC_TO, 0.68f, 0.68f, 0, 0, 1, -0.49f, -0.2f,
R_ARC_TO, 0.67f, 0.67f, 0, 0, 1, -0.2f, -0.49f,
R_ARC_TO, 0.67f, 0.67f, 0, 0, 1, 0.2f, -0.49f,
R_ARC_TO, 0.66f, 0.66f, 0, 0, 1, 0.49f, -0.2f,
R_H_LINE_TO, 5.23f,
R_CUBIC_TO, 0.19f, 0, 0.36f, 0.07f, 0.49f, 0.2f,
R_ARC_TO, 0.66f, 0.66f, 0, 0, 1, 0.2f, 0.49f,
R_ARC_TO, 0.67f, 0.67f, 0, 0, 1, -0.2f, 0.49f,
R_ARC_TO, 0.66f, 0.66f, 0, 0, 1, -0.49f, 0.2f,
R_H_LINE_TO, -0.48f,
R_V_LINE_TO, 3.86f,
R_LINE_TO, 3.32f, 4.03f,
R_CUBIC_TO, 0.35f, 0.43f, 0.4f, 0.9f, 0.15f, 1.4f,
R_CUBIC_TO, -0.25f, 0.5f, -0.65f, 0.75f, -1.21f, 0.75f,
CLOSE,
R_MOVE_TO, 0.1f, -1.38f,
R_H_LINE_TO, 8.59f,
LINE_TO, 8.75f, 8.02f,
V_LINE_TO, 3.69f,
H_LINE_TO, 7.25f,
V_LINE_TO, 8.02f,
CLOSE,
MOVE_TO, 8.02f, 8.02f,
CLOSE

View file

@ -13,7 +13,6 @@
#include "chrome/common/pref_names.h"
#include "components/prefs/pref_service.h"
#include "components/safe_browsing/core/common/features.h"
#include "ui/base/ui_base_features.h"
namespace download {
@ -26,7 +25,7 @@ static const bool disable_bubble = base::CommandLine::ForCurrentProcess()->HasSw
#if BUILDFLAG(IS_CHROMEOS_ASH)
return false;
#else
if (disable_bubble || features::IsThorium2024()) {
if (disable_bubble) {
return false;
} else {
return true;

View file

@ -20,6 +20,7 @@
#include "base/metrics/field_trial_params.h"
#include "base/metrics/histogram_functions.h"
#include "base/metrics/histogram_macros.h"
#include "base/not_fatal_until.h"
#include "base/path_service.h"
#include "base/rand_util.h"
#include "base/strings/utf_string_conversions.h"
@ -51,6 +52,7 @@
#include "chrome/browser/platform_util.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/safe_browsing/safe_browsing_service.h"
#include "chrome/browser/tab_group_sync/tab_group_sync_tab_state.h"
#include "chrome/browser/ui/chrome_pages.h"
#include "chrome/browser/ui/scoped_tabbed_browser_displayer.h"
#include "chrome/common/buildflags.h"
@ -63,6 +65,7 @@
#include "components/download/public/common/download_features.h"
#include "components/download/public/common/download_interrupt_reasons.h"
#include "components/download/public/common/download_item.h"
#include "components/download/public/common/download_item_rename_handler.h"
#include "components/download/public/common/download_stats.h"
#include "components/offline_pages/buildflags/buildflags.h"
#include "components/pdf/common/constants.h"
@ -77,6 +80,7 @@
#include "components/safe_browsing/content/common/file_type_policies.h"
#include "components/safe_browsing/core/common/features.h"
#include "components/safe_search_api/safe_search_util.h"
#include "components/saved_tab_groups/features.h"
#include "components/services/quarantine/public/mojom/quarantine.mojom.h"
#include "components/services/quarantine/quarantine_impl.h"
#include "content/public/browser/browser_task_traits.h"
@ -99,6 +103,7 @@
#include "base/android/build_info.h"
#include "base/android/content_uri_utils.h"
#include "base/android/path_utils.h"
#include "base/process/process_handle.h"
#include "chrome/browser/android/tab_android.h"
#include "chrome/browser/download/android/chrome_duplicate_download_infobar_delegate.h"
#include "chrome/browser/download/android/download_controller.h"
@ -110,10 +115,12 @@
#include "chrome/browser/download/android/duplicate_download_dialog_bridge_delegate.h"
#include "chrome/browser/download/android/insecure_download_dialog_bridge.h"
#include "chrome/browser/download/android/insecure_download_infobar_delegate.h"
#include "chrome/browser/download/android/new_navigation_observer.h"
#include "chrome/browser/flags/android/chrome_feature_list.h"
#include "chrome/browser/ui/android/pdf/pdf_jni_headers/PdfUtils_jni.h"
#include "chrome/browser/ui/android/tab_model/tab_model.h"
#include "chrome/browser/ui/android/tab_model/tab_model_list.h"
#include "components/download/public/common/download_task_runner.h"
#include "components/infobars/content/content_infobar_manager.h"
#include "content/public/common/content_features.h"
#include "net/http/http_content_disposition.h"
@ -146,6 +153,10 @@
#include "chrome/browser/safe_browsing/download_protection/download_protection_util.h"
#endif
#if BUILDFLAG(IS_CHROMEOS_ASH)
#include "chrome/browser/ash/policy/skyvault/skyvault_rename_handler.h"
#endif
using content::BrowserThread;
using content::DownloadManager;
using download::DownloadItem;
@ -327,6 +338,12 @@ void OnDownloadDialogClosed(
break;
}
}
base::FilePath GetTempPdfDir() {
base::FilePath cache_dir;
base::android::GetCacheDirectory(&cache_dir);
return cache_dir.Append(kPdfDirName);
}
#endif // BUILDFLAG(IS_ANDROID)
void OnCheckExistingDownloadPathDone(download::DownloadTargetInfo target_info,
@ -447,7 +464,7 @@ download::DownloadDangerType SavePackageDangerType(
return download::DOWNLOAD_DANGER_TYPE_BLOCKED_SCAN_FAILED;
default:
NOTREACHED();
NOTREACHED_IN_MIGRATION();
return download::DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS;
}
}
@ -478,6 +495,12 @@ void LogCancelEphemeralWarningEvent(CancelEphemeralWarningEvent event) {
}
#endif // !BUILDFLAG(IS_ANDROID)
void OnCheckDownloadAllowedFailed(
content::CheckDownloadAllowedCallback check_download_allowed_cb) {
base::SingleThreadTaskRunner::GetCurrentDefault()->PostTask(
FROM_HERE, base::BindOnce(std::move(check_download_allowed_cb), false));
}
} // namespace
ChromeDownloadManagerDelegate::ChromeDownloadManagerDelegate(Profile* profile)
@ -629,15 +652,19 @@ bool ChromeDownloadManagerDelegate::DetermineDownloadTarget(
if (download->IsTransient()) {
if (download_path.empty() && download->GetMimeType() == pdf::kPDFMimeType &&
!download->IsMustDownload()) {
base::FilePath generated_filename = net::GenerateFileName(
download->GetURL(), download->GetContentDisposition(),
profile_->GetPrefs()->GetString(prefs::kDefaultCharset),
download->GetSuggestedFilename(), download->GetMimeType(),
l10n_util::GetStringUTF8(IDS_DEFAULT_DOWNLOAD_FILENAME));
base::FilePath cache_dir;
base::android::GetCacheDirectory(&cache_dir);
download_path = cache_dir.Append(kPdfDirName).Append(generated_filename);
action = DownloadPathReservationTracker::UNIQUIFY;
if (profile_->IsOffTheRecord() && download->GetDownloadFile() &&
download->GetDownloadFile()->IsMemoryFile()) {
download_path = download->GetDownloadFile()->FullPath();
action = DownloadPathReservationTracker::OVERWRITE;
} else {
base::FilePath generated_filename = net::GenerateFileName(
download->GetURL(), download->GetContentDisposition(),
profile_->GetPrefs()->GetString(prefs::kDefaultCharset),
download->GetSuggestedFilename(), download->GetMimeType(),
l10n_util::GetStringUTF8(IDS_DEFAULT_DOWNLOAD_FILENAME));
download_path = GetTempPdfDir().Append(generated_filename);
action = DownloadPathReservationTracker::UNIQUIFY;
}
} else {
action = DownloadPathReservationTracker::OVERWRITE;
}
@ -1087,8 +1114,20 @@ void ChromeDownloadManagerDelegate::GetInsecureDownloadStatus(
const base::FilePath& virtual_path,
GetInsecureDownloadStatusCallback callback) {
DCHECK(download);
std::move(callback).Run(
GetInsecureDownloadStatusForDownload(profile_, virtual_path, download));
DownloadItem::InsecureDownloadStatus status =
GetInsecureDownloadStatusForDownload(profile_, virtual_path, download);
#if BUILDFLAG(IS_ANDROID)
// Allow insecure PDF download to go through if it is displayed inline.
if (download->IsTransient() && download->GetMimeType() == pdf::kPDFMimeType &&
!download->IsMustDownload()) {
if (ShouldOpenPdfInline() &&
base::FeatureList::IsEnabled(
download::features::kAllowedMixedContentInlinePdf)) {
status = DownloadItem::InsecureDownloadStatus::SAFE;
}
}
#endif // BUILDFLAG(IS_ANDROID)
std::move(callback).Run(status);
}
void ChromeDownloadManagerDelegate::NotifyExtensions(
@ -1627,7 +1666,7 @@ void ChromeDownloadManagerDelegate::CheckSavePackageScanningDone(
// These other results should never be returned, but if they are somehow
// then scanning policies are fail-open, so the save package should be
// allowed to complete.
NOTREACHED();
NOTREACHED_IN_MIGRATION();
enterprise_connectors::RunSavePackageScanningCallback(item,
/*allowed*/ true);
break;
@ -1645,7 +1684,7 @@ void ChromeDownloadManagerDelegate::OnInstallerDone(
{
auto iter = running_crx_installs_.find(token);
DCHECK(iter != running_crx_installs_.end());
CHECK(iter != running_crx_installs_.end(), base::NotFatalUntil::M130);
installer = iter->second;
running_crx_installs_.erase(iter);
}
@ -1838,6 +1877,8 @@ void ChromeDownloadManagerDelegate::CheckDownloadAllowed(
std::optional<url::Origin> request_initiator,
bool from_download_cross_origin_redirect,
bool content_initiated,
const std::string& mime_type,
std::optional<ui::PageTransition> page_transition,
content::CheckDownloadAllowedCallback check_download_allowed_cb) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || \
@ -1850,17 +1891,39 @@ void ChromeDownloadManagerDelegate::CheckDownloadAllowed(
base::FilePath::StringType extension = path.Extension();
if (!extension.empty() && base::FilePath::CompareEqualIgnoreCase(
extension, FILE_PATH_LITERAL(".pdf"))) {
base::SingleThreadTaskRunner::GetCurrentDefault()->PostTask(
FROM_HERE,
base::BindOnce(std::move(check_download_allowed_cb), false));
OnCheckDownloadAllowedFailed(std::move(check_download_allowed_cb));
return;
}
}
#endif
content::WebContents* web_contents = web_contents_getter.Run();
if (!web_contents) {
OnCheckDownloadAllowedFailed(std::move(check_download_allowed_cb));
return;
}
// Check whether download is restricted for saved tab groups.
if (tab_groups::RestrictDownloadOnSyncedTabs() &&
TabGroupSyncTabState::FromWebContents(web_contents)) {
OnCheckDownloadAllowedFailed(std::move(check_download_allowed_cb));
return;
}
CanDownloadCallback cb = base::BindOnce(
&ChromeDownloadManagerDelegate::OnCheckDownloadAllowedComplete,
weak_ptr_factory_.GetWeakPtr(), std::move(check_download_allowed_cb));
#if BUILDFLAG(IS_ANDROID)
if (ShouldOpenPdfInline() && mime_type == pdf::kPDFMimeType) {
// If this is a forward/back navigation, the native page should trigger a
// download with default page transition type. Otherwise, we should cancel
// the download.
if (page_transition.has_value() &&
(page_transition.value() & ui::PAGE_TRANSITION_FORWARD_BACK)) {
OnCheckDownloadAllowedFailed(std::move(check_download_allowed_cb));
return;
}
NewNavigationObserver::GetInstance()->StartObserving(web_contents);
}
DownloadControllerBase::Get()->AcquireFileAccessPermission(
web_contents_getter,
base::BindOnce(&OnDownloadAcquireFileAccessPermissionDone,
@ -1879,6 +1942,16 @@ ChromeDownloadManagerDelegate::GetQuarantineConnectionCallback() {
&ChromeDownloadManagerDelegate::ConnectToQuarantineService);
}
std::unique_ptr<download::DownloadItemRenameHandler>
ChromeDownloadManagerDelegate::GetRenameHandlerForDownload(
download::DownloadItem* download_item) {
#if BUILDFLAG(IS_CHROMEOS_ASH)
return policy::SkyvaultRenameHandler::CreateIfNeeded(download_item);
#else
return nullptr;
#endif // BUILDFLAG(IS_CHROMEOS_ASH)
}
void ChromeDownloadManagerDelegate::CheckSavePackageAllowed(
download::DownloadItem* download_item,
base::flat_map<base::FilePath, base::FilePath> save_package_files,
@ -1998,7 +2071,12 @@ void ChromeDownloadManagerDelegate::ConnectToQuarantineService(
}
void ChromeDownloadManagerDelegate::OnManagerInitialized() {
#if !BUILDFLAG(IS_ANDROID)
#if BUILDFLAG(IS_ANDROID)
if (ShouldOpenPdfInline()) {
download::GetDownloadTaskRunner()->PostTask(
FROM_HERE, base::BindOnce([]() { base::DeleteFile(GetTempPdfDir()); }));
}
#else
CancelAllEphemeralWarnings();
#endif
}

View file

@ -12,6 +12,7 @@
#include "base/files/file_path.h"
#include "base/functional/bind.h"
#include "base/location.h"
#include "base/metrics/histogram_functions.h"
#include "base/rand_util.h"
#include "base/strings/stringprintf.h"
#include "base/strings/utf_string_conversions.h"
@ -75,6 +76,10 @@
#include "chrome/browser/chromeos/policy/dlp/dlp_rules_manager_factory.h"
#endif
#if BUILDFLAG(IS_ANDROID)
#include "components/safe_browsing/android/safe_browsing_api_handler_bridge.h"
#endif
using content::BrowserThread;
using download::DownloadItem;
using download::DownloadPathReservationTracker;
@ -198,6 +203,11 @@ void DownloadTargetDeterminer::DoLoop() {
case STATE_CHECK_DOWNLOAD_URL:
result = DoCheckDownloadUrl();
break;
#if BUILDFLAG(IS_ANDROID)
case STATE_CHECK_APP_VERIFICATION:
result = DoCheckAppVerification();
break;
#endif
case STATE_CHECK_VISITED_REFERRER_BEFORE:
result = DoCheckVisitedReferrerBefore();
break;
@ -205,7 +215,7 @@ void DownloadTargetDeterminer::DoLoop() {
result = DoDetermineIntermediatePath();
break;
case STATE_NONE:
NOTREACHED();
NOTREACHED_IN_MIGRATION();
return;
}
} while (result == CONTINUE);
@ -499,7 +509,7 @@ void DownloadTargetDeterminer::ReserveVirtualPathDone(
conflict_action_ == DownloadPathReservationTracker::UNIQUIFY);
break;
case download::PathValidationResult::COUNT:
NOTREACHED();
NOTREACHED_IN_MIGRATION();
}
} else {
virtual_path_ = path;
@ -527,7 +537,7 @@ void DownloadTargetDeterminer::ReserveVirtualPathDone(
confirmation_reason_ = DownloadConfirmationReason::TARGET_CONFLICT;
break;
case download::PathValidationResult::COUNT:
NOTREACHED();
NOTREACHED_IN_MIGRATION();
}
}
@ -553,8 +563,15 @@ DownloadTargetDeterminer::Result
DownloadTargetDeterminer::DoRequestConfirmation() {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
DCHECK(!virtual_path_.empty());
#if BUILDFLAG(IS_ANDROID)
DCHECK(!download_->IsTransient() ||
confirmation_reason_ == DownloadConfirmationReason::NONE ||
// On Android we return here a second time after prompting the user.
confirmation_reason_ == DownloadConfirmationReason::PREFERENCE);
#else
DCHECK(!download_->IsTransient() ||
confirmation_reason_ == DownloadConfirmationReason::NONE);
#endif
next_state_ = STATE_DETERMINE_LOCAL_PATH;
@ -607,7 +624,8 @@ DownloadTargetDeterminer::DoRequestConfirmation() {
content::DownloadItemUtils::GetBrowserContext(download_);
bool isOffTheRecord =
Profile::FromBrowserContext(browser_context)->IsOffTheRecord();
if (isOffTheRecord) {
if (isOffTheRecord &&
(!download_->IsTransient() || download_->IsMustDownload())) {
delegate_->RequestIncognitoWarningConfirmation(base::BindOnce(
&DownloadTargetDeterminer::RequestIncognitoWarningConfirmationDone,
weak_ptr_factory_.GetWeakPtr()));
@ -656,7 +674,9 @@ void DownloadTargetDeterminer::RequestConfirmationDone(
if (result == DownloadConfirmationResult::CONFIRMED_WITH_DIALOG) {
// Double check the user-selected path is valid by looping back.
is_checking_dialog_confirmed_path_ = true;
confirmation_reason_ = DownloadConfirmationReason::NONE;
if (confirmation_reason_ != DownloadConfirmationReason::PREFERENCE) {
confirmation_reason_ = DownloadConfirmationReason::NONE;
}
next_state_ = STATE_RESERVE_VIRTUAL_PATH;
}
#endif
@ -932,7 +952,15 @@ DownloadTargetDeterminer::Result
DownloadTargetDeterminer::DoCheckDownloadUrl() {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
DCHECK(!virtual_path_.empty());
#if BUILDFLAG(IS_ANDROID)
if (base::FeatureList::IsEnabled(safe_browsing::kGooglePlayProtectPrompt)) {
next_state_ = STATE_CHECK_APP_VERIFICATION;
} else {
next_state_ = STATE_CHECK_VISITED_REFERRER_BEFORE;
}
#else
next_state_ = STATE_CHECK_VISITED_REFERRER_BEFORE;
#endif
// If user has validated a dangerous download, don't check.
if (danger_type_ == download::DOWNLOAD_DANGER_TYPE_USER_VALIDATED)
@ -949,11 +977,44 @@ void DownloadTargetDeterminer::CheckDownloadUrlDone(
download::DownloadDangerType danger_type) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
DVLOG(20) << "URL Check Result:" << danger_type;
#if BUILDFLAG(IS_ANDROID)
DCHECK_EQ(
base::FeatureList::IsEnabled(safe_browsing::kGooglePlayProtectPrompt)
? STATE_CHECK_APP_VERIFICATION
: STATE_CHECK_VISITED_REFERRER_BEFORE,
next_state_);
#else
DCHECK_EQ(STATE_CHECK_VISITED_REFERRER_BEFORE, next_state_);
#endif
danger_type_ = danger_type;
DoLoop();
}
#if BUILDFLAG(IS_ANDROID)
DownloadTargetDeterminer::Result
DownloadTargetDeterminer::DoCheckAppVerification() {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
next_state_ = STATE_CHECK_VISITED_REFERRER_BEFORE;
safe_browsing::SafeBrowsingApiHandlerBridge::GetInstance()
.StartIsVerifyAppsEnabled(
base::BindOnce(&DownloadTargetDeterminer::CheckAppVerificationDone,
weak_ptr_factory_.GetWeakPtr()));
return QUIT_DOLOOP;
}
void DownloadTargetDeterminer::CheckAppVerificationDone(
safe_browsing::VerifyAppsEnabledResult result) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
DCHECK_EQ(STATE_CHECK_VISITED_REFERRER_BEFORE, next_state_);
base::UmaHistogramEnumeration("SBClientDownload.AndroidAppVerificationResult",
result);
is_app_verification_enabled_ =
result == safe_browsing::VerifyAppsEnabledResult::SUCCESS_ENABLED;
DoLoop();
}
#endif
DownloadTargetDeterminer::Result
DownloadTargetDeterminer::DoCheckVisitedReferrerBefore() {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
@ -986,6 +1047,13 @@ DownloadTargetDeterminer::Result
return CONTINUE;
if (danger_level_ == DownloadFileType::ALLOW_ON_USER_GESTURE) {
#if BUILDFLAG(IS_ANDROID)
if (base::FeatureList::IsEnabled(safe_browsing::kGooglePlayProtectPrompt) &&
is_app_verification_enabled_) {
return CONTINUE;
}
#endif
// HistoryServiceFactory redirects incognito profiles to on-record profiles.
// There's no history for on-record profiles in unit_tests.
history::HistoryService* history_service =
@ -1134,6 +1202,10 @@ void DownloadTargetDeterminer::ScheduleCallbackAndDeleteSelf(
// If |virtual_path_| is content URI, there is no need to prompt the user.
if (local_path_.IsContentUri() && !virtual_path_.IsContentUri()) {
target_info.display_name = virtual_path_.BaseName();
} else if (download_->GetDownloadFile() &&
download_->GetDownloadFile()->IsMemoryFile()) {
// Memory file doesn't have a proper display name. Generate one here.
target_info.display_name = GenerateFileName();
}
#endif
target_info.mime_type = mime_type_;

View file

@ -144,7 +144,7 @@ std::string GetDownloadBlockingExtensionMetricName(
kInsecureDownloadExtensionInitiatorInferredInsecure,
kInsecureDownloadHistogramTargetInsecure);
case InsecureDownloadSecurityStatus::kDownloadIgnored:
NOTREACHED();
NOTREACHED_IN_MIGRATION();
break;
case InsecureDownloadSecurityStatus::kInitiatorInsecureNonUniqueFileSecure:
return GetDLBlockingHistogramName(
@ -156,7 +156,7 @@ std::string GetDownloadBlockingExtensionMetricName(
kInsecureDownloadExtensionInitiatorInsecureNonUnique,
kInsecureDownloadHistogramTargetInsecure);
}
NOTREACHED();
NOTREACHED_IN_MIGRATION();
return std::string();
}
@ -436,7 +436,7 @@ bool IsDownloadPermittedByContentSettings(
return setting.GetContentSetting() == CONTENT_SETTING_ALLOW;
}
}
NOTREACHED();
NOTREACHED_IN_MIGRATION();
#endif
return false;

View file

@ -6,6 +6,7 @@
#include <stddef.h>
#include "base/containers/fixed_flat_set.h"
#include "base/logging.h"
#include "base/notreached.h"
#include "build/branding_buildflags.h"
@ -33,41 +34,40 @@ namespace extensions {
static const char * const kThoriumHangoutsId = "inomiaajaofonadigcpnaacolkggjjpo";
bool IsComponentExtensionAllowlisted(const std::string& extension_id) {
const char* const kAllowed[] = {
extension_misc::kInAppPaymentsSupportAppId,
extension_misc::kPdfExtensionId,
kThoriumHangoutsId,
constexpr auto kAllowed = base::MakeFixedFlatSet<std::string_view>({
extension_misc::kInAppPaymentsSupportAppId,
extension_misc::kPdfExtensionId,
kThoriumHangoutsId,
#if BUILDFLAG(IS_CHROMEOS)
extension_misc::kAssessmentAssistantExtensionId,
extension_misc::kAssessmentAssistantExtensionId,
#endif
#if BUILDFLAG(IS_CHROMEOS_ASH)
extension_misc::kAccessibilityCommonExtensionId,
extension_misc::kChromeVoxExtensionId,
extension_misc::kEnhancedNetworkTtsExtensionId,
extension_misc::kEspeakSpeechSynthesisExtensionId,
extension_misc::kGoogleSpeechSynthesisExtensionId,
extension_misc::kGuestModeTestExtensionId,
extension_misc::kSelectToSpeakExtensionId,
extension_misc::kSwitchAccessExtensionId,
extension_misc::kAccessibilityCommonExtensionId,
extension_misc::kChromeVoxExtensionId,
extension_misc::kEnhancedNetworkTtsExtensionId,
extension_misc::kEspeakSpeechSynthesisExtensionId,
extension_misc::kGoogleSpeechSynthesisExtensionId,
extension_misc::kGuestModeTestExtensionId,
extension_misc::kSelectToSpeakExtensionId,
extension_misc::kSwitchAccessExtensionId,
#elif BUILDFLAG(IS_CHROMEOS_LACROS)
extension_misc::kEmbeddedA11yHelperExtensionId,
extension_misc::kChromeVoxHelperExtensionId,
extension_misc::kEmbeddedA11yHelperExtensionId,
extension_misc::kChromeVoxHelperExtensionId,
#endif // BUILDFLAG(IS_CHROMEOS_LACROS)
#if BUILDFLAG(IS_CHROMEOS)
extension_misc::kContactCenterInsightsExtensionId,
extension_misc::kDeskApiExtensionId,
extension_misc::kContactCenterInsightsExtensionId,
extension_misc::kDeskApiExtensionId,
#if BUILDFLAG(GOOGLE_CHROME_BRANDING)
extension_misc::kQuickOfficeComponentExtensionId,
extension_misc::kQuickOfficeComponentExtensionId,
#endif // BUILDFLAG(GOOGLE_CHROME_BRANDING)
#endif
#if !BUILDFLAG(IS_CHROMEOS_LACROS)
extension_misc::kReadingModeGDocsHelperExtensionId,
extension_misc::kReadingModeGDocsHelperExtensionId,
#endif // !BUILDFLAG(IS_CHROMEOS_LACROS)
};
});
for (size_t i = 0; i < std::size(kAllowed); ++i) {
if (extension_id == kAllowed[i])
return true;
if (kAllowed.contains(extension_id)) {
return true;
}
#if BUILDFLAG(IS_CHROMEOS)
@ -85,7 +85,7 @@ bool IsComponentExtensionAllowlisted(const std::string& extension_id) {
#endif
LOG(ERROR) << "Component extension with id " << extension_id << " not in "
<< "allowlist and is not being loaded as a result.";
NOTREACHED();
NOTREACHED_IN_MIGRATION();
return false;
}
@ -121,28 +121,23 @@ bool IsComponentExtensionAllowlisted(int manifest_resource_id) {
LOG(ERROR) << "Component extension with manifest resource id "
<< manifest_resource_id << " not in allowlist and is not being "
<< "loaded as a result.";
NOTREACHED();
return true;
NOTREACHED_IN_MIGRATION();
return false;
}
#if BUILDFLAG(IS_CHROMEOS_ASH)
bool IsComponentExtensionAllowlistedForSignInProfile(
const std::string& extension_id) {
const char* const kAllowed[] = {
constexpr auto kAllowed = base::MakeFixedFlatSet<std::string_view>({
extension_misc::kAccessibilityCommonExtensionId,
extension_misc::kChromeVoxExtensionId,
extension_misc::kEspeakSpeechSynthesisExtensionId,
extension_misc::kGoogleSpeechSynthesisExtensionId,
extension_misc::kSelectToSpeakExtensionId,
extension_misc::kSwitchAccessExtensionId,
};
});
for (size_t i = 0; i < std::size(kAllowed); ++i) {
if (extension_id == kAllowed[i])
return true;
}
return false;
return kAllowed.contains(extension_id);
}
#endif

View file

@ -41,7 +41,6 @@ found in the LICENSE file.
android:scaleType="centerInside"
android:layout_marginStart="15dp"
android:layout_centerVertical="true"
android:paddingEnd="8dp"
android:layout_alignParentEnd="true"
android:background="@drawable/toolbar_menu_button_ripple"
android:src="@drawable/ic_more_vert_24dp"

View file

@ -18,11 +18,12 @@ found in the LICENSE file.
android:id="@+id/main_content"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingStart="@dimen/feed_header_menu_start_margin"
android:layout_marginTop="@dimen/feed_header_top_margin"
android:minHeight="@dimen/snippets_article_header_height"
android:orientation="horizontal"
android:gravity="center"
android:layoutDirection="locale"
android:paddingHorizontal="@dimen/ntp_header_lateral_paddings_v2" >
android:layoutDirection="locale">
<!-- Null content description for now because UX in flux. -->
<ImageView
@ -43,7 +44,7 @@ found in the LICENSE file.
<com.google.android.material.tabs.TabLayout
android:id="@+id/tab_list_view"
android:layout_width="wrap_content"
android:layout_width="match_parent"
android:layout_height="@dimen/feed_header_tab_layout_height"
android:layout_gravity="center"
android:layout_marginTop="@dimen/feed_header_tab_list_view_top_bottom_margin"
@ -57,16 +58,17 @@ found in the LICENSE file.
android:layout_gravity="center_vertical"
android:layout_marginTop="12dp"
android:layout_marginBottom="12dp"
android:layout_marginStart="@dimen/feed_header_title_view_margin_start"
android:textAppearance="@style/TextAppearance.HeaderTitle"
android:visibility="gone" />
</FrameLayout>
<org.chromium.ui.listmenu.ListMenuButton
android:id="@+id/header_menu"
android:layout_width="@dimen/min_touch_target_size"
android:layout_width="@dimen/feed_header_menu_width"
android:layout_height="@dimen/min_touch_target_size"
android:scaleType="centerInside"
android:layout_marginStart="@dimen/feed_header_icon_margin"
android:layout_marginStart="@dimen/feed_header_menu_button_start_margin"
android:paddingEnd="8dp"
android:background="@drawable/toolbar_menu_button_ripple"
android:src="@drawable/ic_more_vert_24dp"

View file

@ -7,6 +7,7 @@
#include <string>
#include <string_view>
#include "ash/constants/ash_features.h"
#include "base/base64.h"
#include "base/check_op.h"
#include "base/command_line.h"
@ -98,6 +99,7 @@
#include "chrome/browser/certificate_provider/certificate_provider_service_factory.h"
#include "chrome/browser/policy/networking/policy_cert_service.h"
#include "chrome/browser/policy/networking/policy_cert_service_factory.h"
#include "chromeos/components/kiosk/kiosk_utils.h"
#include "chromeos/constants/chromeos_features.h"
#include "net/cert/x509_util.h"
#endif
@ -105,7 +107,9 @@
#if BUILDFLAG(IS_CHROMEOS_ASH)
#include "ash/constants/ash_switches.h"
#include "chrome/browser/ash/net/client_cert_store_ash.h"
#include "chrome/browser/ash/net/client_cert_store_kcer.h"
#include "chrome/browser/ash/profiles/profile_helper.h"
#include "chrome/browser/chromeos/kcer/kcer_factory.h"
#include "chrome/browser/policy/profile_policy_connector.h"
#include "components/user_manager/user.h"
#include "components/user_manager/user_manager.h"
@ -129,13 +133,14 @@
#endif
#if BUILDFLAG(IS_CHROMEOS_LACROS)
#include "base/check_is_test.h"
#include "chrome/browser/lacros/cert/cert_db_initializer_factory.h"
#include "chrome/browser/lacros/cert/client_cert_store_lacros.h"
#include "chrome/browser/profiles/incognito_helpers.h"
#include "chromeos/startup/browser_params_proxy.h"
#endif
#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC)
#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
#include "chrome/browser/enterprise/client_certificates/certificate_provisioning_service_factory.h"
#include "components/enterprise/client_certificates/core/certificate_provisioning_service.h"
#include "components/enterprise/client_certificates/core/client_certificates_service.h"
@ -197,7 +202,7 @@ bool IsAmbientAuthAllowedForProfile(Profile* profile) {
}
// Profile type not yet supported.
NOTREACHED();
NOTREACHED_IN_MIGRATION();
return false;
}
@ -255,7 +260,7 @@ void UpdateCookieSettings(Profile* profile, ContentSettingsType type) {
});
}
#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC)
#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
std::unique_ptr<net::ClientCertStore> GetWrappedCertStore(
Profile* profile,
std::unique_ptr<net::ClientCertStore> platform_store) {
@ -274,7 +279,7 @@ std::unique_ptr<net::ClientCertStore> GetWrappedCertStore(
return client_certificates::ClientCertificatesService::Create(
provisioning_service, std::move(platform_store));
}
#endif // BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC)
#endif // BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
} // namespace
@ -314,10 +319,6 @@ ProfileNetworkContextService::ProfileNetworkContextService(Profile* profile)
certificate_transparency::prefs::kCTExcludedSPKIs,
base::BindRepeating(&ProfileNetworkContextService::ScheduleUpdateCTPolicy,
base::Unretained(this)));
pref_change_registrar_.Add(
certificate_transparency::prefs::kCTExcludedLegacySPKIs,
base::BindRepeating(&ProfileNetworkContextService::ScheduleUpdateCTPolicy,
base::Unretained(this)));
#if BUILDFLAG(CHROME_CERTIFICATE_POLICIES_SUPPORTED)
// When any of the following Certificate preferences change, we schedule an
// update to aggregate the actual update using a |cert_policy_update_timer_|.
@ -348,11 +349,6 @@ ProfileNetworkContextService::ProfileNetworkContextService(Profile* profile)
base::BindRepeating(&ProfileNetworkContextService::
UpdateCorsNonWildcardRequestHeadersSupport,
base::Unretained(this)));
pref_change_registrar_.Add(
prefs::kBlockTruncatedCookies,
base::BindRepeating(
&ProfileNetworkContextService::OnTruncatedCookieBlockingChanged,
base::Unretained(this)));
}
ProfileNetworkContextService::~ProfileNetworkContextService() = default;
@ -462,26 +458,10 @@ void ProfileNetworkContextService::OnTrackingProtectionEnabledFor3pcdChanged(
});
}
void ProfileNetworkContextService::OnTruncatedCookieBlockingChanged() {
const bool block_truncated_cookies =
profile_->GetPrefs()->GetBoolean(prefs::kBlockTruncatedCookies);
profile_->ForEachLoadedStoragePartition(
[&](content::StoragePartition* storage_partition) {
// Update the main CookieManager's CookieSettings object to block
// truncated cookies, and since this is shared with all of the
// RestrictedCookieManager instances, those will get the change as well.
storage_partition->GetCookieManagerForBrowserProcess()
->BlockTruncatedCookies(block_truncated_cookies);
});
}
std::string ProfileNetworkContextService::ComputeAcceptLanguage() const {
// If reduce accept language is enabled, only return the first language
// without expanding the language list.
if (base::FeatureList::IsEnabled(network::features::kReduceAcceptLanguage)) {
return language::GetFirstLanguage(pref_accept_language_.GetValue());
}
// TODO:(https://crbug.com/40224802) Return only single language without
// expanding the language list if the DisableReduceAcceptLanguage deprecation
// trial ends.
if (profile_->IsOffTheRecord()) {
// In incognito mode return only the first language.
@ -506,18 +486,13 @@ network::mojom::CTPolicyPtr ProfileNetworkContextService::GetCTPolicy() {
prefs->GetList(certificate_transparency::prefs::kCTExcludedHosts);
const base::Value::List& ct_excluded_spkis =
prefs->GetList(certificate_transparency::prefs::kCTExcludedSPKIs);
const base::Value::List& ct_excluded_legacy_spkis =
prefs->GetList(certificate_transparency::prefs::kCTExcludedLegacySPKIs);
std::vector<std::string> excluded(TranslateStringArray(ct_excluded));
std::vector<std::string> excluded_spkis(
TranslateStringArray(ct_excluded_spkis));
std::vector<std::string> excluded_legacy_spkis(
TranslateStringArray(ct_excluded_legacy_spkis));
return network::mojom::CTPolicy::New(std::move(excluded),
std::move(excluded_spkis),
std::move(excluded_legacy_spkis));
std::move(excluded_spkis));
}
void ProfileNetworkContextService::UpdateCTPolicyForContexts(
@ -733,6 +708,41 @@ void ProfileNetworkContextService::ScheduleUpdateCertificatePolicy() {
FROM_HERE, base::Seconds(0), this,
&ProfileNetworkContextService::UpdateAdditionalCertificates);
}
ProfileNetworkContextService::CertificatePoliciesForView::
CertificatePoliciesForView() = default;
ProfileNetworkContextService::CertificatePoliciesForView::
~CertificatePoliciesForView() = default;
ProfileNetworkContextService::CertificatePoliciesForView::
CertificatePoliciesForView(CertificatePoliciesForView&&) = default;
ProfileNetworkContextService::CertificatePoliciesForView&
ProfileNetworkContextService::CertificatePoliciesForView::operator=(
CertificatePoliciesForView&& other) = default;
ProfileNetworkContextService::CertificatePoliciesForView
ProfileNetworkContextService::GetCertificatePolicyForView() {
CertificatePoliciesForView policies;
policies.certificate_policies =
GetCertificatePolicy(profile_->GetDefaultStoragePartition()->GetPath());
auto* prefs = profile_->GetPrefs();
for (const base::Value& cert_b64 :
prefs->GetList(prefs::kCADistrustedCertificates)) {
std::optional<std::vector<uint8_t>> decoded_opt =
base::Base64Decode(cert_b64.GetString());
if (decoded_opt.has_value()) {
policies.full_distrusted_certs.push_back(std::move(*decoded_opt));
}
}
#if !BUILDFLAG(IS_CHROMEOS)
policies.is_include_system_trust_store_managed =
prefs->FindPreference(prefs::kCAPlatformIntegrationEnabled)->IsManaged();
#endif
return policies;
}
#endif // BUILDFLAG(CHROME_CERTIFICATE_POLICIES_SUPPORTED)
bool ProfileNetworkContextService::ShouldSplitAuthCacheByNetworkIsolationKey()
@ -818,9 +828,6 @@ ProfileNetworkContextService::CreateCookieManagerParams(
out->cookie_access_delegate_type =
network::mojom::CookieAccessDelegateType::USE_CONTENT_SETTINGS;
out->block_truncated_cookies =
profile->GetPrefs()->GetBoolean(prefs::kBlockTruncatedCookies);
out->mitigations_enabled_for_3pcd =
cookie_settings.MitigationsEnabledFor3pcd();
@ -887,23 +894,29 @@ ProfileNetworkContextService::CreateClientCertStore() {
use_system_key_slot = true;
}
std::string username_hash;
const user_manager::User* user =
ash::ProfileHelper::Get()->GetUserByProfile(profile_);
if (user && !user->username_hash().empty()) {
username_hash = user->username_hash();
if (ash::features::ShouldUseKcerClientCertStore()) {
return std::make_unique<ash::ClientCertStoreKcer>(
std::move(certificate_provider), kcer::KcerFactory::GetKcer(profile_));
} else {
std::string username_hash;
const user_manager::User* user =
ash::ProfileHelper::Get()->GetUserByProfile(profile_);
if (user && !user->username_hash().empty()) {
username_hash = user->username_hash();
// Use the device-wide system key slot only if the user is affiliated on
// the device.
if (user->IsAffiliated()) {
use_system_key_slot = true;
// Use the device-wide system key slot only if the user is affiliated on
// the device.
if (user->IsAffiliated()) {
use_system_key_slot = true;
}
}
return std::make_unique<ash::ClientCertStoreAsh>(
std::move(certificate_provider), use_system_key_slot, username_hash,
base::BindRepeating(&CreateCryptoModuleBlockingPasswordDelegate,
kCryptoModulePasswordClientAuth));
}
return std::make_unique<ash::ClientCertStoreAsh>(
std::move(certificate_provider), use_system_key_slot, username_hash,
base::BindRepeating(&CreateCryptoModuleBlockingPasswordDelegate,
kCryptoModulePasswordClientAuth));
#elif BUILDFLAG(USE_NSS_CERTS)
std::unique_ptr<net::ClientCertStore> store =
std::make_unique<net::ClientCertStoreNSS>(
@ -926,8 +939,11 @@ ProfileNetworkContextService::CreateClientCertStore() {
store = std::make_unique<ClientCertStoreLacros>(
std::move(certificate_provider), cert_db_initializer, std::move(store));
#endif // BUILDFLAG(IS_CHROMEOS_LACROS)
#if BUILDFLAG(IS_LINUX)
return GetWrappedCertStore(profile_, std::move(store));
#else
return store;
#endif // BUILDFLAG(IS_LINUX)
#elif BUILDFLAG(IS_WIN)
return GetWrappedCertStore(profile_,
std::make_unique<net::ClientCertStoreWin>());
@ -965,23 +981,6 @@ bool GetHttpCacheBackendResetParam(PrefService* local_state) {
current_field_trial_status +=
(field_trial ? field_trial->group_name() : "None");
// For the ongoing HTTP Cache keying experiments, if a flag indicates that the
// user is in an experiment group, modify `current_field_trial_status` to
// ensure that the cache gets cleared. If the user is not a part of the
// experiment, don't make any changes so as not to invalidate the existing
// cache.
if (base::FeatureList::IsEnabled(
net::features::kEnableCrossSiteFlagNetworkIsolationKey)) {
current_field_trial_status += " CrossSiteFlagNIK";
} else if (base::FeatureList::IsEnabled(
net::features::
kEnableFrameSiteSharedOpaqueNetworkIsolationKey)) {
current_field_trial_status += " FrameSiteSharedOpaqueNIK";
} else if (base::FeatureList::IsEnabled(
net::features::kHttpCacheKeyingExperimentControlGroup)) {
current_field_trial_status += " 2023ExperimentControlGroup";
}
std::string previous_field_trial_status =
local_state->GetString(kHttpCacheFinchExperimentGroups);
local_state->SetString(kHttpCacheFinchExperimentGroups,
@ -1156,7 +1155,18 @@ void ProfileNetworkContextService::ConfigureNetworkContextParamsInternal(
const crosapi::mojom::DefaultPathsPtr& default_paths =
chromeos::BrowserParamsProxy::Get()->DefaultPaths();
// `default_paths` can be nullptr in tests.
if (default_paths && default_paths->user_nss_database.has_value()) {
if (!default_paths) {
CHECK_IS_TEST();
}
// Populating `nss_full_path` will make cert verifier load
// and use the corresponding NSS public slot. Kiosk sessions don't have
// the UI that could result in interactions with the public slot. Kiosk
// users are also not owner users and can't have the owner key in the
// public slot. Leaving it empty will make cert verifier ignore the
// public slot. This is done mainly because Chrome sometimes fails to
// load the public slot and has to crash because of that.
if (default_paths && default_paths->user_nss_database.has_value() &&
!chromeos::IsKioskSession()) {
cert_verifier_creation_params->nss_full_path =
default_paths->user_nss_database.value();
}
@ -1180,8 +1190,17 @@ void ProfileNetworkContextService::ConfigureNetworkContextParamsInternal(
// username hash is empty, even when the NSS is not initialized for the
// user.
if (user && !user->username_hash().empty()) {
cert_verifier_creation_params->username_hash = user->username_hash();
cert_verifier_creation_params->nss_path = profile_->GetPath();
// Populating `username_hash` and `nss_path` will make cert verifier load
// and use the corresponding NSS public slot. Kiosk sessions don't have
// the UI that could result in interactions with the public slot. Kiosk
// users are also not owner users and can't have the owner key in the
// public slot. Leaving them empty will make cert verifier ignore the
// public slot. This is done mainly because Chrome sometimes fails to
// load the public slot and has to crash because of that.
if (!chromeos::IsKioskSession()) {
cert_verifier_creation_params->username_hash = user->username_hash();
cert_verifier_creation_params->nss_path = profile_->GetPath();
}
profile_supports_policy_certs = true;
}
}

View file

@ -7,6 +7,7 @@
#include "base/command_line.h"
#include "chrome/browser/themes/custom_theme_supplier.h"
#include "chrome/browser/themes/theme_properties.h"
#include "chrome/browser/win/mica_titlebar.h"
#include "chrome/browser/win/titlebar_config.h"
#include "chrome/grit/theme_resources.h"

File diff suppressed because it is too large Load diff

View file

@ -12,6 +12,7 @@
#include <memory>
#include <optional>
#include <string>
#include <variant>
#include <vector>
#include "base/containers/span.h"
@ -24,7 +25,6 @@
#include "build/build_config.h"
#include "chrome/browser/ui/tabs/tab_group_controller.h"
#include "chrome/browser/ui/tabs/tab_model.h"
#include "chrome/browser/ui/tabs/tab_strip_collection.h"
#include "chrome/browser/ui/tabs/tab_strip_scrubbing_metrics.h"
#include "chrome/browser/ui/tabs/tab_strip_user_gesture_details.h"
#include "components/sessions/core/session_id.h"
@ -39,18 +39,16 @@
#endif
class Profile;
class TabContentsData;
class TabGroupModel;
class TabStripModelDelegate;
class TabStripModelObserver;
class TabDragController;
namespace content {
class WebContents;
}
namespace tabs {
class TabGroupTabCollection;
}
class TabGroupModelFactory {
public:
TabGroupModelFactory();
@ -148,10 +146,6 @@ class TabStripModel : public TabGroupController {
// least std::optional<int>) in its place.
static constexpr int kNoTab = -1;
using TabDataVariant =
std::variant<std::vector<std::unique_ptr<tabs::TabModel>>,
std::unique_ptr<tabs::TabStripCollection>>;
TabStripModel() = delete;
// Construct a TabStripModel with a delegate to help it do certain things
@ -186,22 +180,6 @@ class TabStripModel : public TabGroupController {
int GetIndexOfTab(tabs::TabHandle tab) const;
tabs::TabHandle GetTabHandleAt(int index) const;
// Returns true if the data is a vector and not a collection tree.
bool IsContentsDataVector() const {
return std::holds_alternative<std::vector<std::unique_ptr<tabs::TabModel>>>(
contents_data_);
}
// const methods to access `contents_data_` as a vector or a collection tree.
const std::vector<std::unique_ptr<tabs::TabModel>>& GetContentsDataAsVector()
const;
const tabs::TabStripCollection* GetContentsDataAsCollection() const;
// non-const methods to access `contents_data_` as a vector or a collection
// tree.
std::vector<std::unique_ptr<tabs::TabModel>>& GetContentsDataAsVector();
tabs::TabStripCollection* GetContentsDataAsCollection();
// Retrieve the Profile associated with this TabStripModel.
Profile* profile() const { return profile_; }
@ -300,6 +278,15 @@ class TabStripModel : public TabGroupController {
// one slot. It returns the index the web contents is actually moved to.
int MoveWebContentsAt(int index, int to_position, bool select_after_move);
// This is similar to `MoveWebContentsAt` but takes in an additional `group`
// parameter that the tab is assigned to with the move. This does not make a
// best case effort to ensure group contiguity and would rather CHECK if it
// breaks group contiguity.
int MoveWebContentsAt(int index,
int to_position,
bool select_after_move,
std::optional<tab_groups::TabGroupId> group);
// Moves the selected tabs to |index|. |index| is treated as if the tab strip
// did not contain any of the selected tabs. For example, if the tabstrip
// contains [A b c D E f] (upper case selected) and this is invoked with 1 the
@ -316,7 +303,8 @@ class TabStripModel : public TabGroupController {
// index were 3, then the result would be [b c A f D F]. A, being pinned, can
// move no further than index 2. The non-pinned tabs are moved to the target
// index + selected-pinned tab-count (3 + 1).
void MoveSelectedTabsTo(int index);
void MoveSelectedTabsTo(int index,
std::optional<tab_groups::TabGroupId> group);
// Moves all tabs in |group| to |to_index|. This has no checks to make sure
// the position is valid for a group to move to.
@ -357,7 +345,7 @@ class TabStripModel : public TabGroupController {
// Returns the WebContents that opened the WebContents at |index|, or NULL if
// there is no opener on record.
content::WebContents* GetOpenerOfWebContentsAt(const int index) const;
tabs::TabModel* GetOpenerOfTabAt(const int index) const;
// Changes the |opener| of the WebContents at |index|.
// Note: |opener| must be in this tab strip. Also a tab must not be its own
@ -461,6 +449,11 @@ class TabStripModel : public TabGroupController {
ui::PageTransition transition,
int add_types,
std::optional<tab_groups::TabGroupId> group = std::nullopt);
void AddTab(std::unique_ptr<tabs::TabModel> tab,
int index,
ui::PageTransition transition,
int add_types,
std::optional<tab_groups::TabGroupId> group = std::nullopt);
// Closes the selected tabs.
void CloseSelectedTabs();
@ -482,46 +475,47 @@ class TabStripModel : public TabGroupController {
void MoveTabNext();
void MoveTabPrevious();
// This is used by the `tab_drag_controller` to help precompute the group the
// selected tabs would be a part of if they moved to a destination index. It
// returns the index of the tabs in the current model that would end up being
// the adjacent tabs of the selected unpinned tabs post move operation.
std::pair<std::optional<int>, std::optional<int>>
GetAdjacentTabsAfterSelectedMove(base::PassKey<TabDragController>,
int destination_index);
// Create a new tab group and add the set of tabs pointed to be |indices| to
// it. Pins all of the tabs if any of them were pinned, and reorders the tabs
// so they are contiguous and do not split an existing group in half. Returns
// the new group. |indices| must be sorted in ascending order.
tab_groups::TabGroupId AddToNewGroup(const std::vector<int>& indices);
tab_groups::TabGroupId AddToNewGroup(const std::vector<int> indices);
// Creates a new group from an `group_id` and `visual_data`. This is used in
// cases to re-create a deleted group like restore and tab dragging. All the
// tabs at `indices` are moved to the group created.
tab_groups::TabGroupId AddToNewGroup(
const std::vector<int> indices,
const tab_groups::TabGroupId group_id,
tab_groups::TabGroupVisualData visual_data);
// Add the set of tabs pointed to by |indices| to the given tab group |group|.
// The tabs take on the pinnedness of the tabs already in the group. Tabs
// before the group will move to the start, while tabs after the group will
// move to the end. If |add_to_end| is true, all tabs will instead move to
// the end. |indices| must be sorted in ascending order.
void AddToExistingGroup(const std::vector<int>& indices,
const tab_groups::TabGroupId& group,
void AddToExistingGroup(const std::vector<int> indices,
const tab_groups::TabGroupId group,
const bool add_to_end = false);
// Moves the set of tabs indicated by |indices| to precede the tab at index
// |destination_index|, maintaining their order and the order of tabs not
// being moved, and adds them to the tab group |group|.
void MoveTabsAndSetGroup(const std::vector<int>& indices,
int destination_index,
std::optional<tab_groups::TabGroupId> group);
// Similar to AddToExistingGroup(), but creates a group with id |group| if it
// doesn't exist. This is only intended to be called from session restore
// code.
void AddToGroupForRestore(const std::vector<int>& indices,
const tab_groups::TabGroupId& group);
// Updates the tab group of the tab at |index|. If |group| is nullopt, the tab
// will be removed from the current group. If |group| does not exist, it will
// create the group then add the tab to the group.
void UpdateGroupForDragRevert(
int index,
std::optional<tab_groups::TabGroupId> group_id,
std::optional<tab_groups::TabGroupVisualData> group_data);
// Removes the set of tabs pointed to by |indices| from the the groups they
// are in, if any. The tabs are moved out of the group if necessary. |indices|
// must be sorted in ascending order.
void RemoveFromGroup(std::vector<int> indices);
void RemoveFromGroup(const std::vector<int>& indices);
TabGroupModel* group_model() const { return group_model_.get(); }
@ -660,10 +654,24 @@ class TabStripModel : public TabGroupController {
// Serialise this object into a trace.
void WriteIntoTrace(perfetto::TracedValue context) const;
// Returns the tab at `index` in the tabstrip.
tabs::TabModel* GetTabAtIndex(int index) const;
// TODO(349161508) remove this method once tabs dont need to be converted
// into webcontents.
tabs::TabModel* GetTabForWebContents(
const content::WebContents* contents) const;
private:
FRIEND_TEST_ALL_PREFIXES(TabStripModelTest, GetIndicesClosedByCommand);
struct DetachNotifications;
struct MoveNotification {
int initial_index;
std::optional<tab_groups::TabGroupId> intial_group;
tabs::TabHandle handle;
TabStripSelectionChange selection_change;
};
// Tracks whether a tabstrip-modal UI is showing.
class ScopedTabStripModalUIImpl : public ScopedTabStripModalUI {
@ -718,9 +726,6 @@ class TabStripModel : public TabGroupController {
int ConstrainMoveIndex(int index, bool pinned_tab) const;
// Returns the tab at an index from the `contents_data`.
tabs::TabModel* GetTabAtIndex(int index) const;
// If |index| is selected all the selected indices are returned, otherwise a
// vector with |index| is returned. This is used when executing commands to
// determine which indices the command applies to. Indices are sorted in
@ -775,9 +780,6 @@ class TabStripModel : public TabGroupController {
uint32_t close_types,
DetachNotifications* notifications);
// Gets the WebContents at an index. Does no bounds checking.
content::WebContents* GetWebContentsAtImpl(int index) const;
// Returns the WebContentses at the specified indices. This does no checking
// of the indices, it is assumed they are valid.
std::vector<content::WebContents*> GetWebContentsesByIndices(
@ -812,53 +814,21 @@ class TabStripModel : public TabGroupController {
// movement slots into and out of groups.
void MoveTabRelative(TabRelativeDirection direction);
// Does the work of MoveWebContentsAt. This has no checks to make sure the
// position is valid, those are done in MoveWebContentsAt.
void MoveWebContentsAtImpl(int index,
int to_position,
bool select_after_move);
// Implementation of moving a webcontent when the `contents_data` is a tab
// collection.
void MoveWebContentsAtImplWithCollection(int index,
int to_position,
bool select_after_move);
// Implementation of moving a webcontent when the `contents_data` is a vector.
void MoveWebContentsAtImplWithVector(int index,
int to_position,
bool select_after_move);
// Sends a move notification to the tabstrip model observers for a webcontent.
void SendMoveNotificationForWebContents(int index,
int to_position,
bool select_after_move,
content::WebContents* web_contents);
// Implementation of MoveSelectedTabsTo. Moves |length| of the selected tabs
// starting at |start| to |index|. See MoveSelectedTabsTo for more details.
void MoveSelectedTabsToImpl(int index, size_t start, size_t length);
std::vector<int> GetSelectedPinnedTabs();
std::vector<int> GetSelectedUnpinnedTabs();
// Adds tabs to newly-allocated group id |new_group|. This group must be new
// and have no tabs in it.
void AddToNewGroupImpl(std::vector<int> indices,
tab_groups::TabGroupId new_group);
void AddToNewGroupImpl(
const std::vector<int>& indices,
const tab_groups::TabGroupId& new_group,
std::optional<tab_groups::TabGroupVisualData> visual_data = std::nullopt);
void AddToNewGroupWithCollectionImpl(std::vector<int> indices,
const tab_groups::TabGroupId new_group);
void AddToExistingGroupWithCollectionImpl(std::vector<int> indices,
tab_groups::TabGroupId group,
const bool add_to_end);
void AddTabsToGroupCollection(std::vector<tabs::TabModel*> tabs,
tabs::TabGroupTabCollection* group_collection,
bool start_of_group = false);
void RemoveTabsFromGroupCollection(
std::vector<tabs::TabModel*> tabs,
tabs::TabGroupTabCollection* group_collection,
bool move_to_left);
void MoveGroupToImpl(const tab_groups::TabGroupId& group, int to_index);
// Adds tabs to existing group |group|. This group must have been initialized
// by a previous call to |AddToNewGroupImpl()|.
@ -873,39 +843,77 @@ class TabStripModel : public TabGroupController {
int destination_index,
std::optional<tab_groups::TabGroupId> group);
// Moves the tab at |index| to |new_index| and sets its group to |new_group|.
// Notifies any observers that group affiliation has changed for the tab.
void MoveAndSetGroup(int index,
int new_index,
std::optional<tab_groups::TabGroupId> new_group);
void AddToReadLaterImpl(const std::vector<int>& indices);
// Helper function for MoveAndSetGroup. Removes the tab at |index| from the
// group that contains it, if any. Also deletes that group, if it now contains
// no tabs. Returns that group.
std::optional<tab_groups::TabGroupId> UngroupTab(
// Updates the `contents_data_` and sends out observer notifications for
// inserting a new tab in the tabstrip.
void InsertTabAtIndexImpl(std::unique_ptr<tabs::TabModel> tab_model,
int index,
std::optional<tab_groups::TabGroupId> group,
bool pin,
bool active);
// Updates the `contents_data_` and sends out observer notifications for
// removing an existing tab in the tabstrip.
std::unique_ptr<tabs::TabModel> RemoveTabFromIndexImpl(int index);
// Updates the `contents_data_` and sends out observer notifications for
// updating the index, pinned state or group property.
void MoveTabToIndexImpl(int initial_index,
int final_index,
const std::optional<tab_groups::TabGroupId> group,
bool pin,
bool select_after_move);
// Similar to `MoveTabToIndexImpl` but this is used for multiple tabs either
// being moved or having their group updated. `tab_indices` should be sorted.
void MoveTabsToIndexImpl(const std::vector<int>& tab_indices,
int destination_index,
const std::optional<tab_groups::TabGroupId> group);
// Sends group notifications for a tab at `index` based on its initial_group
// and `final_group` and updates the `group_model_`.
void TabGroupStateChanged(
int index,
const std::optional<tab_groups::TabGroupId> old_group);
content::WebContents* web_contents,
const std::optional<tab_groups::TabGroupId> initial_group,
const std::optional<tab_groups::TabGroupId> new_group);
// Helper function for MoveAndSetGroup. Adds the tab at |index| to |group|,
// updates the group model, and notifies the observers if the group at that
// index would change.
void GroupTab(int index,
const tab_groups::TabGroupId& group,
const std::optional<tab_groups::TabGroupId> old_group);
// Updates the `group_model` by decrementing the tab count of `group`.
void RemoveTabFromGroupModel(const tab_groups::TabGroupId& group);
// Changes the pinned state of the tab at `index`, moving it in the process if
// necessary. Returns the new index of the tab.
int SetTabPinnedImpl(int index, bool pinned);
// Updates the `group_model` by incrementing the tab count of `group`.
void AddTabToGroupModel(const tab_groups::TabGroupId& group);
// Updates the pinned state of the tab model and moves the tab within
// `contents_data`. This is a helper method called by `SetTabPinnedImpl()`.
int UpdatePinAndMoveWebContents(int index, bool pinned);
// Checks if the `contents_data_` is in a valid order. This checks for
// pinned tabs placement, group contiguity and selected tabs validity.
void ValidateTabStripModel();
void SendMoveNotificationForWebContents(
int index,
int to_position,
content::WebContents* web_contents,
TabStripSelectionChange& selection_change);
TabStripSelectionChange MaybeUpdateSelectionModel(int initial_index,
int final_index,
bool select_after_move);
// Generates the MoveNotifications for `MoveTabsToIndexImpl` and updates the
// selection model and openers.
std::vector<TabStripModel::MoveNotification> PrepareTabsToMoveToIndex(
const std::vector<int>& tab_indices,
int destination_index);
// Generates a sequence of initial and destination index for tabs in
// `tab_indices` when the tabs need to move to `destination_index`.
std::vector<std::pair<int, int>> CalculateIncrementalTabMoves(
const std::vector<int>& tab_indices,
int destination_index) const;
// Changes the pinned state of all tabs at `indices`, moving them in the
// process if necessary. Returns the new locations of all of those tabs.
std::vector<int> SetTabsPinned(const std::vector<int>& indices, bool pinned);
// process if necessary.
void SetTabsPinned(const std::vector<int> indices, bool pinned);
// Sets the sound content setting for each site at the |indices|.
void SetSitesMuted(const std::vector<int>& indices, bool mute) const;
@ -914,11 +922,12 @@ class TabStripModel : public TabGroupController {
// opener or null if there's a cycle.
void FixOpeners(int index);
// Makes sure the tab at |index| is not causing a group contiguity error. Will
// make the minimum change to ensure that the tab's group is not non-
// contiguous as well as ensuring that it is not breaking up a non-contiguous
// group, possibly by setting or clearing its group.
void EnsureGroupContiguity(int index);
// Returns a group when the index of a tab is updated from `index` to
// `to_position` that would not break group contiguity. The group returned
// keeps the original group if it is valid at the `to_position` and otherwise
// returns a valid group.
std::optional<tab_groups::TabGroupId> GetGroupToAssign(int index,
int to_position);
// Returns a valid index to be selected after the tab at |removing_index| is
// closed. If |index| is after |removing_index|, |index| is adjusted to
@ -936,7 +945,7 @@ class TabStripModel : public TabGroupController {
// The WebContents data currently hosted within this TabStripModel. This must
// be kept in sync with |selection_model_|.
TabDataVariant contents_data_;
std::unique_ptr<TabContentsData> contents_data_;
// The model for tab groups hosted within this TabStripModel.
std::unique_ptr<TabGroupModel> group_model_;

View file

@ -0,0 +1,58 @@
// Copyright 2024 The Chromium Authors and Alex313031
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chrome/browser/ui/tabs/tab_strip_prefs.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/tabs/features.h"
#include "chrome/browser/ui/ui_features.h"
#include "chrome/common/pref_names.h"
#include "components/pref_registry/pref_registry_syncable.h"
#include "components/prefs/pref_service.h"
namespace {
std::optional<bool> g_tab_search_trailing_tabstrip_at_startup = std::nullopt;
}
namespace tabs {
bool GetDefaultTabSearchRightAligned() {
// These platforms are all left aligned, the others should be right.
#if BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN)
// Revert Google's stupid UI design decision
static const bool left_aligned_tab_search_button =
base::CommandLine::ForCurrentProcess()->HasSwitch("left-aligned-tab-search-button");
if (left_aligned_tab_search_button) {
return false;
} else {
return true;
}
#else
return true;
#endif
}
void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry) {
registry->RegisterBooleanPref(prefs::kTabSearchRightAligned,
GetDefaultTabSearchRightAligned());
}
bool GetTabSearchTrailingTabstrip(const Profile* profile) {
// If this pref has already been read, we need to return the same value.
if (!g_tab_search_trailing_tabstrip_at_startup.has_value()) {
g_tab_search_trailing_tabstrip_at_startup =
profile && CanShowTabSearchPositionSetting()
? profile->GetPrefs()->GetBoolean(prefs::kTabSearchRightAligned)
: GetDefaultTabSearchRightAligned();
}
return g_tab_search_trailing_tabstrip_at_startup.value();
}
void SetTabSearchRightAlignedForTesting(bool is_right_aligned) {
g_tab_search_trailing_tabstrip_at_startup = is_right_aligned;
}
} // namespace tabs

View file

@ -25,6 +25,7 @@
#include "chrome/browser/ui/browser_commands.h"
#include "chrome/browser/ui/browser_navigator.h"
#include "chrome/browser/ui/color/chrome_color_id.h"
#include "chrome/browser/ui/tabs/features.h"
#include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "chrome/browser/ui/tabs/tab_strip_user_gesture_details.h"
#include "chrome/browser/ui/ui_features.h"
@ -344,7 +345,7 @@ bool BrowserRootView::OnMouseWheel(const ui::MouseWheelEvent& event) {
// Scroll-event-changes-tab is incompatible with scrolling tabstrip, so
// disable it if the latter feature is enabled.
if (scroll_event_changes_tab_ &&
!base::FeatureList::IsEnabled(features::kScrollableTabStrip)) {
!base::FeatureList::IsEnabled(tabs::kScrollableTabStrip)) {
// Switch to the left/right tab if the wheel-scroll happens over the
// tabstrip, or the empty space beside the tabstrip.
views::View* hit_view = GetEventHandlerForPoint(event.location());

View file

@ -1,284 +0,0 @@
// Copyright 2024 The Chromium Authors and Alex313031
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chrome/browser/ui/views/tab_search_bubble_host.h"
#include "base/command_line.h"
#include "base/functional/bind.h"
#include "base/i18n/rtl.h"
#include "base/metrics/histogram_functions.h"
#include "base/strings/strcat.h"
#include "base/trace_event/named_trigger.h"
#include "base/trace_event/trace_event.h"
#include "chrome/app/vector_icons/vector_icons.h"
#include "chrome/browser/feature_engagement/tracker_factory.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_element_identifiers.h"
#include "chrome/browser/ui/browser_finder.h"
#include "chrome/browser/ui/layout_constants.h"
#include "chrome/browser/ui/tabs/organization/tab_organization_service.h"
#include "chrome/browser/ui/tabs/organization/tab_organization_service_factory.h"
#include "chrome/browser/ui/tabs/organization/tab_organization_utils.h"
#include "chrome/browser/ui/ui_features.h"
#include "chrome/browser/ui/view_ids.h"
#include "chrome/browser/ui/views/frame/browser_view.h"
#include "chrome/browser/ui/views/tabs/tab_strip_controller.h"
#include "chrome/browser/ui/views/user_education/browser_feature_promo_controller.h"
#include "chrome/browser/ui/webui/tab_search/tab_search_prefs.h"
#include "chrome/common/webui_url_constants.h"
#include "chrome/grit/generated_resources.h"
#include "components/feature_engagement/public/event_constants.h"
#include "components/feature_engagement/public/feature_constants.h"
#include "components/feature_engagement/public/tracker.h"
#include "components/prefs/pref_service.h"
#include "ui/base/metadata/metadata_impl_macros.h"
#include "ui/base/ui_base_features.h"
#include "ui/compositor/compositor.h"
#include "ui/gfx/paint_vector_icon.h"
#include "ui/views/widget/widget.h"
namespace {
// These values are persisted to logs. Entries should not be renumbered and
// numeric values should never be reused.
enum class TabSearchOpenAction {
kMouseClick = 0,
kKeyboardNavigation = 1,
kKeyboardShortcut = 2,
kTouchGesture = 3,
kMaxValue = kTouchGesture,
};
TabSearchOpenAction GetActionForEvent(const ui::Event& event) {
if (event.IsMouseEvent()) {
return TabSearchOpenAction::kMouseClick;
}
return event.IsKeyEvent() ? TabSearchOpenAction::kKeyboardNavigation
: TabSearchOpenAction::kTouchGesture;
}
} // namespace
TabSearchBubbleHost::TabSearchBubbleHost(views::Button* button,
Profile* profile)
: button_(button),
profile_(profile),
webui_bubble_manager_(WebUIBubbleManager::Create<TabSearchUI>(
button,
profile,
GURL(chrome::kChromeUITabSearchURL),
IDS_ACCNAME_TAB_SEARCH)),
widget_open_timer_(base::BindRepeating([](base::TimeDelta time_elapsed) {
base::UmaHistogramMediumTimes("Tabs.TabSearch.WindowDisplayedDuration3",
time_elapsed);
})) {
auto* const tab_organization_service =
TabOrganizationServiceFactory::GetForProfile(profile);
if (tab_organization_service) {
tab_organization_observation_.Observe(tab_organization_service);
}
auto menu_button_controller = std::make_unique<views::MenuButtonController>(
button,
base::BindRepeating(&TabSearchBubbleHost::ButtonPressed,
base::Unretained(this)),
std::make_unique<views::Button::DefaultButtonControllerDelegate>(button));
menu_button_controller_ = menu_button_controller.get();
button->SetButtonController(std::move(menu_button_controller));
webui_bubble_manager_observer_.Observe(webui_bubble_manager_.get());
}
TabSearchBubbleHost::~TabSearchBubbleHost() = default;
void TabSearchBubbleHost::OnWidgetVisibilityChanged(views::Widget* widget,
bool visible) {
CHECK_EQ(webui_bubble_manager_->GetBubbleWidget(), widget);
if (visible && widget && bubble_created_time_.has_value()) {
widget->GetCompositor()->RequestSuccessfulPresentationTimeForNextFrame(
base::BindOnce(
[](base::TimeTicks bubble_created_time,
bool bubble_using_cached_web_contents,
WebUIContentsWarmupLevel contents_warmup_level,
const viz::FrameTimingDetails& frame_timing_details) {
base::TimeTicks presentation_timestamp =
frame_timing_details.presentation_feedback.timestamp;
base::TimeDelta time_to_show =
presentation_timestamp - bubble_created_time;
base::UmaHistogramMediumTimes(
bubble_using_cached_web_contents
? "Tabs.TabSearch.WindowTimeToShowCachedWebView2"
: "Tabs.TabSearch.WindowTimeToShowUncachedWebView2",
time_to_show);
base::UmaHistogramMediumTimes(
base::StrCat({"Tabs.TabSearch.TimeToShow.",
ToString(contents_warmup_level)}),
time_to_show);
},
*bubble_created_time_,
webui_bubble_manager_->bubble_using_cached_web_contents(),
webui_bubble_manager_->contents_warmup_level()));
bubble_created_time_.reset();
}
}
void TabSearchBubbleHost::OnWidgetDestroying(views::Widget* widget) {
DCHECK_EQ(webui_bubble_manager_->GetBubbleWidget(), widget);
DCHECK(bubble_widget_observation_.IsObservingSource(
webui_bubble_manager_->GetBubbleWidget()));
bubble_widget_observation_.Reset();
pressed_lock_.reset();
}
void TabSearchBubbleHost::OnOrganizationAccepted(const Browser* browser) {
if (browser != GetBrowser()) {
return;
}
// Don't show IPH if the user already has other tab groups.
if (browser->tab_strip_model()->group_model()->ListTabGroups().size() > 1) {
return;
}
BrowserFeaturePromoController* const promo_controller =
BrowserFeaturePromoController::GetForView(button_);
if (promo_controller) {
promo_controller->MaybeShowPromo(
feature_engagement::kIPHTabOrganizationSuccessFeature);
}
}
void TabSearchBubbleHost::OnUserInvokedFeature(const Browser* browser) {
if (browser == GetBrowser()) {
const int tab_organization_tab_index = 1;
ShowTabSearchBubble(false, tab_organization_tab_index);
}
}
void TabSearchBubbleHost::BeforeBubbleWidgetShowed(views::Widget* widget) {
CHECK_EQ(widget, webui_bubble_manager_->GetBubbleWidget());
// There should only ever be a single bubble widget active for the
// TabSearchBubbleHost.
DCHECK(!bubble_widget_observation_.IsObserving());
bubble_widget_observation_.Observe(widget);
widget_open_timer_.Reset(widget);
widget->GetCompositor()->RequestSuccessfulPresentationTimeForNextFrame(
base::BindOnce(
[](base::TimeTicks button_pressed_time,
const viz::FrameTimingDetails& frame_timing_details) {
base::TimeTicks presentation_timestamp =
frame_timing_details.presentation_feedback.timestamp;
base::UmaHistogramMediumTimes(
"Tabs.TabSearch."
"ButtonPressedToNextFramePresented",
presentation_timestamp - button_pressed_time);
},
base::TimeTicks::Now()));
}
bool TabSearchBubbleHost::ShowTabSearchBubble(
bool triggered_by_keyboard_shortcut,
int tab_index) {
TRACE_EVENT0("ui", "TabSearchBubbleHost::ShowTabSearchBubble");
base::trace_event::EmitNamedTrigger("show-tab-search-bubble");
if (tab_index >= 0) {
profile_->GetPrefs()->SetInteger(tab_search_prefs::kTabSearchTabIndex,
tab_index);
}
if (webui_bubble_manager_->GetBubbleWidget()) {
return false;
}
// Close the Tab Search IPH if it is showing.
BrowserFeaturePromoController* controller =
BrowserFeaturePromoController::GetForView(button_);
if (controller)
controller->EndPromo(
feature_engagement::kIPHTabSearchFeature,
user_education::EndFeaturePromoReason::kFeatureEngaged);
std::optional<gfx::Rect> anchor;
if (button_->GetWidget()->IsFullscreen() && !button_->IsDrawn()) {
// Use a screen-coordinate anchor rect when the tabstrip's search button is
// not drawn, and potentially positioned offscreen, in fullscreen mode.
// Place the anchor similar to where the button would be in non-fullscreen
// mode.
gfx::Rect bounds = button_->GetWidget()->GetWorkAreaBoundsInScreen();
int offset = GetLayoutConstant(TABSTRIP_REGION_VIEW_CONTROL_PADDING);
int x = ShouldTabSearchRenderBeforeTabStrip() ? bounds.x() + offset
: bounds.right() - offset;
anchor.emplace(gfx::Rect(x, bounds.y() + offset, 0, 0));
}
bubble_created_time_ = base::TimeTicks::Now();
webui_bubble_manager_->set_widget_initialization_callback(base::BindOnce(
[](base::TimeTicks bubble_init_start_time) {
base::UmaHistogramMediumTimes(
"Tabs.TabSearch.BubbleWidgetInitializationTime",
base::TimeTicks::Now() - bubble_init_start_time);
},
*bubble_created_time_));
webui_bubble_manager_->ShowBubble(anchor,
ShouldTabSearchRenderBeforeTabStrip()
? views::BubbleBorder::TOP_LEFT
: views::BubbleBorder::TOP_RIGHT,
kTabSearchBubbleElementId);
auto* tracker =
feature_engagement::TrackerFactory::GetForBrowserContext(profile_);
if (tracker)
tracker->NotifyEvent(feature_engagement::events::kTabSearchOpened);
if (triggered_by_keyboard_shortcut) {
base::UmaHistogramEnumeration("Tabs.TabSearch.OpenAction",
TabSearchOpenAction::kKeyboardShortcut);
}
// Hold the pressed lock while the |bubble_| is active.
pressed_lock_ = menu_button_controller_->TakeLock();
return true;
}
void TabSearchBubbleHost::CloseTabSearchBubble() {
webui_bubble_manager_->CloseBubble();
}
const Browser* TabSearchBubbleHost::GetBrowser() const {
for (const Browser* browser : chrome::FindAllBrowsersWithProfile(profile_)) {
BrowserView* browser_view = BrowserView::GetBrowserViewForBrowser(browser);
if (browser_view->GetTabSearchBubbleHost() == this) {
return browser;
}
}
return nullptr;
}
void TabSearchBubbleHost::ButtonPressed(const ui::Event& event) {
if (ShowTabSearchBubble()) {
// Only log the open action if it resulted in creating a new instance of the
// Tab Search bubble.
base::UmaHistogramEnumeration("Tabs.TabSearch.OpenAction",
GetActionForEvent(event));
return;
}
CloseTabSearchBubble();
}
bool TabSearchBubbleHost::ShouldTabSearchRenderBeforeTabStrip() {
// Mac should have tabsearch on the right side. Windows >= Win10 has the
// Tab Search button as a FrameCaptionButton, but it still needs to be on the
// left if it exists.
#if BUILDFLAG(IS_MAC)
return false;
#else
// Revert Google's stupid UI design decision
static const bool left_aligned_tab_search_button =
base::CommandLine::ForCurrentProcess()->HasSwitch("left-aligned-tab-search-button");
if (left_aligned_tab_search_button) {
return features::IsChromeRefresh2023();
} else {
return false;
}
#endif
}

View file

@ -40,6 +40,7 @@
#include "chrome/browser/ui/views/tabs/alert_indicator_button.h"
#include "chrome/browser/ui/views/tabs/browser_tab_strip_controller.h"
#include "chrome/browser/ui/views/tabs/tab_close_button.h"
#include "chrome/browser/ui/views/tabs/tab_drag_controller.h"
#include "chrome/browser/ui/views/tabs/tab_hover_card_bubble_view.h"
#include "chrome/browser/ui/views/tabs/tab_icon.h"
#include "chrome/browser/ui/views/tabs/tab_slot_controller.h"
@ -64,7 +65,6 @@
#include "ui/base/pointer/touch_ui_controller.h"
#include "ui/base/resource/resource_bundle.h"
#include "ui/base/theme_provider.h"
#include "ui/base/ui_base_features.h"
#include "ui/compositor/clip_recorder.h"
#include "ui/compositor/compositor.h"
#include "ui/gfx/animation/tween.h"
@ -110,8 +110,7 @@ constexpr int kPinnedTabExtraWidthToRenderAsNormal = 30;
// Additional padding of close button to the right of the tab
// indicator when `extra_alert_indicator_padding_` is true.
constexpr int kTabAlertIndicatorCloseButtonPaddingAdjustmentTouchUI = 8;
constexpr int kTabAlertIndicatorCloseButtonPaddingAdjustment = 6;
constexpr int kTabAlertIndicatorCloseButtonPaddingAdjustmentRefresh = 4;
constexpr int kTabAlertIndicatorCloseButtonPaddingAdjustment = 4;
// When the DiscardRingImprovements feature is enabled, increase the radius of
// the discard ring by this amount if there is enough space.
@ -308,26 +307,12 @@ void Tab::Layout(PassKey) {
const bool was_showing_icon = showing_icon_;
UpdateIconVisibility();
int start = contents_rect.x();
// ChromeRefresh doesnt respect this extra padding since it has exact values
// for left/right padding.
if (extra_padding_before_content_ && !features::IsChromeRefresh2023()) {
constexpr int kExtraLeftPaddingToBalanceCloseButtonPadding = 4;
start += kExtraLeftPaddingToBalanceCloseButtonPadding;
}
const int start = contents_rect.x();
// The bounds for the favicon will include extra width for the attention
// indicator, but visually it will be smaller at kFaviconSize wide.
gfx::Rect favicon_bounds(start, contents_rect.y(), 0, 0);
if (showing_icon_) {
// Height should go to the bottom of the tab for the crashed tab animation
// to pop out of the bottom.
favicon_bounds.set_y(contents_rect.y() +
Center(features::IsChromeRefresh2023()
? gfx::kFaviconSize
: contents_rect.height(),
gfx::kFaviconSize));
if (center_icon_) {
// When centering the favicon, the favicon is allowed to escape the normal
// contents rect.
@ -339,7 +324,8 @@ void Tab::Layout(PassKey) {
if (base::FeatureList::IsEnabled(
performance_manager::features::kDiscardRingImprovements)) {
icon_->EnlargeDiscardIndicatorRadius(
width() - 2 * tab_style()->GetBottomCornerRadius() >=
controller()->GetInactiveTabWidth() -
2 * tab_style()->GetBottomCornerRadius() >=
gfx::kFaviconSize + 2 * kIncreasedDiscardIndicatorRadiusDp
? kIncreasedDiscardIndicatorRadiusDp
: 0);
@ -392,12 +378,9 @@ void Tab::Layout(PassKey) {
if (showing_close_button_) {
right = close_x;
if (extra_alert_indicator_padding_) {
right -=
ui::TouchUiController::Get()->touch_ui()
? kTabAlertIndicatorCloseButtonPaddingAdjustmentTouchUI
: (features::IsChromeRefresh2023()
? kTabAlertIndicatorCloseButtonPaddingAdjustmentRefresh
: kTabAlertIndicatorCloseButtonPaddingAdjustment);
right -= ui::TouchUiController::Get()->touch_ui()
? kTabAlertIndicatorCloseButtonPaddingAdjustmentTouchUI
: kTabAlertIndicatorCloseButtonPaddingAdjustment;
}
}
const gfx::Size image_size = alert_indicator_button_->GetPreferredSize();
@ -476,7 +459,8 @@ bool Tab::OnKeyPressed(const ui::KeyEvent& event) {
ui::EF_CONTROL_DOWN;
#endif
if (event.type() == ui::ET_KEY_PRESSED && (event.flags() & kModifiedFlag)) {
if (event.type() == ui::EventType::kKeyPressed &&
(event.flags() & kModifiedFlag)) {
const bool is_right = event.key_code() == ui::VKEY_RIGHT;
const bool is_left = event.key_code() == ui::VKEY_LEFT;
if (is_right || is_left) {
@ -651,7 +635,10 @@ void Tab::OnMouseEntered(const ui::MouseEvent& event) {
}
void Tab::MaybeUpdateHoverStatus(const ui::MouseEvent& event) {
if (mouse_hovered_ || !GetWidget()->IsMouseEventsEnabled()) {
// During system-DnD-based tab dragging we sometimes receive mouse events, but
// we shouldn't update the hover status during a drag.
if (mouse_hovered_ || !GetWidget()->IsMouseEventsEnabled() ||
TabDragController::IsActive()) {
return;
}
@ -690,7 +677,7 @@ void Tab::OnGestureEvent(ui::GestureEvent* event) {
controller_->UpdateHoverCard(nullptr,
TabSlotController::HoverCardUpdateType::kEvent);
switch (event->type()) {
case ui::ET_GESTURE_TAP_DOWN: {
case ui::EventType::kGestureTapDown: {
// TAP_DOWN is only dispatched for the first touch point.
DCHECK_EQ(1, event->details().touch_points());
@ -1029,6 +1016,10 @@ std::optional<TabAlertState> Tab::GetAlertStateToShow(
return alert_states[0];
}
void Tab::SetShouldShowDiscardIndicator(bool enabled) {
icon_->SetShouldShowDiscardIndicator(enabled);
}
void Tab::MaybeAdjustLeftForPinnedTab(gfx::Rect* bounds,
int visual_width) const {
if (ShouldRenderAsNormalTab()) {
@ -1057,7 +1048,6 @@ void Tab::UpdateIconVisibility() {
// a non-narrow tab.
if (!closing_) {
center_icon_ = false;
extra_padding_before_content_ = false;
}
showing_icon_ = showing_alert_indicator_ = false;
@ -1085,7 +1075,6 @@ void Tab::UpdateIconVisibility() {
// While animating to or from the pinned state, pinned tabs are rendered as
// normal tabs. Force the extra padding on so the favicon doesn't jitter
// left and then back right again as it resizes through layout regimes.
extra_padding_before_content_ = true;
extra_alert_indicator_padding_ = true;
return;
}
@ -1150,16 +1139,6 @@ void Tab::UpdateIconVisibility() {
}
}
// Don't update padding while the tab is closing, to avoid glitchy-looking
// behaviour when the close animation causes the tab to get very small
if (!closing_) {
// The extra padding is intended to visually balance the close button, so
// only include it when the close button is shown or will be shown on hover.
// We also check this for active tabs so that the extra padding doesn't pop
// in and out as you switch tabs.
extra_padding_before_content_ = large_enough_for_close_button;
}
extra_alert_indicator_padding_ = showing_alert_indicator_ &&
showing_close_button_ &&
large_enough_for_close_button;
@ -1217,7 +1196,7 @@ void Tab::CloseButtonPressed(const ui::Event& event) {
base::RecordAction(UserMetricsAction("CloseTab_RecordingIndicator"));
}
const bool from_mouse = event.type() == ui::ET_MOUSE_RELEASED &&
const bool from_mouse = event.type() == ui::EventType::kMouseReleased &&
!(event.flags() & ui::EF_FROM_TOUCH);
controller_->CloseTab(
this, from_mouse ? CLOSE_TAB_FROM_MOUSE : CLOSE_TAB_FROM_TOUCH);

View file

@ -36,7 +36,6 @@
#include "base/ranges/algorithm.h"
#include "base/scoped_observation.h"
#include "base/stl_util.h"
#include "base/strings/string_piece.h"
#include "base/strings/utf_string_conversions.h"
#include "base/time/time.h"
#include "base/timer/elapsed_timer.h"
@ -49,8 +48,10 @@
#include "chrome/browser/ui/browser_element_identifiers.h"
#include "chrome/browser/ui/color/chrome_color_id.h"
#include "chrome/browser/ui/layout_constants.h"
#include "chrome/browser/ui/tabs/features.h"
#include "chrome/browser/ui/tabs/tab_group_theme.h"
#include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "chrome/browser/ui/tabs/tab_strip_prefs.h"
#include "chrome/browser/ui/tabs/tab_types.h"
#include "chrome/browser/ui/ui_features.h"
#include "chrome/browser/ui/view_ids.h"
@ -90,7 +91,6 @@
#include "ui/base/models/list_selection_model.h"
#include "ui/base/resource/resource_bundle.h"
#include "ui/base/theme_provider.h"
#include "ui/base/ui_base_features.h"
#include "ui/color/color_provider.h"
#include "ui/display/display.h"
#include "ui/gfx/animation/throb_animation.h"
@ -132,7 +132,7 @@ std::unique_ptr<TabContainer> MakeTabContainer(
TabStrip* tab_strip,
TabHoverCardController* hover_card_controller,
TabDragContext* drag_context) {
if (base::FeatureList::IsEnabled(features::kSplitTabStrip)) {
if (base::FeatureList::IsEnabled(tabs::kSplitTabStrip)) {
return std::make_unique<CompoundTabContainer>(
*tab_strip, hover_card_controller, drag_context, *tab_strip, tab_strip);
}
@ -190,7 +190,16 @@ class TabStrip::TabDragContextImpl : public TabDragContext,
}
void OnMouseReleased(const ui::MouseEvent& event) override {
EndDrag(END_DRAG_COMPLETE);
// When using a system DnD session for tab dragging, we might receive the
// mouse release event that signals we should end the drag, even though
// a different tab strip owns `TabDragController`. `EndDrag()` exits early
// if `drag_controller_` is null, so we use this dedicated method to notify
// `TabDragController`.
if (TabDragController::IsSystemDragAndDropSessionRunning()) {
TabDragController::OnSystemDragAndDropEnded();
} else {
EndDrag(END_DRAG_COMPLETE);
}
}
void OnMouseCaptureLost() override { EndDrag(END_DRAG_CAPTURE_LOST); }
@ -198,23 +207,23 @@ class TabStrip::TabDragContextImpl : public TabDragContext,
void OnGestureEvent(ui::GestureEvent* event) override {
Liveness tabstrip_alive = Liveness::kAlive;
switch (event->type()) {
case ui::ET_GESTURE_SCROLL_END:
case ui::ET_SCROLL_FLING_START:
case ui::ET_GESTURE_END:
case ui::EventType::kGestureScrollEnd:
case ui::EventType::kScrollFlingStart:
case ui::EventType::kGestureEnd:
EndDrag(END_DRAG_COMPLETE);
break;
case ui::ET_GESTURE_LONG_TAP: {
case ui::EventType::kGestureLongTap: {
EndDrag(END_DRAG_CANCEL);
break;
}
case ui::ET_GESTURE_SCROLL_UPDATE:
case ui::EventType::kGestureScrollUpdate:
// N.B. !! ContinueDrag may enter a nested run loop !!
tabstrip_alive = ContinueDrag(this, *event);
break;
case ui::ET_GESTURE_TAP_DOWN:
case ui::EventType::kGestureTapDown:
EndDrag(END_DRAG_CANCEL);
break;
@ -311,9 +320,9 @@ class TabStrip::TabDragContextImpl : public TabDragContext,
// need to make sure the existing DragController isn't still a delegate.
drag_controller_.reset();
CHECK((event.type() == ui::ET_MOUSE_PRESSED ||
event.type() == ui::ET_GESTURE_TAP_DOWN ||
event.type() == ui::ET_GESTURE_SCROLL_BEGIN),
CHECK((event.type() == ui::EventType::kMousePressed ||
event.type() == ui::EventType::kGestureTapDown ||
event.type() == ui::EventType::kGestureScrollBegin),
base::NotFatalUntil::M128)
<< "Event type must be suitable for starting a drag.";
@ -568,9 +577,9 @@ class TabStrip::TabDragContextImpl : public TabDragContext,
// Reset the layout size as we've effectively laid out a different size.
// This ensures a layout happens after the drag is done.
tab_strip_->tab_container_->InvalidateIdealBounds();
if (views[0]->group().has_value()) {
if (views.at(0)->group().has_value()) {
tab_strip_->tab_container_->UpdateTabGroupVisuals(
views[0]->group().value());
views.at(0)->group().value());
}
}
@ -581,15 +590,21 @@ class TabStrip::TabDragContextImpl : public TabDragContext,
tab_strip_->controller_->OnStartedDragging(
views.size() == static_cast<size_t>(tab_strip_->GetModelCount()));
// Complete animations to ensure that the previous drag session fully ends
// before we start the next one. In particular this reparents the dragged
// tabs back to the TabContainer from the TabDragContext. N.B. this can
// happen either when starting a new drag in this tabstrip or when dragging
// tabs into this tabstrip from elsewhere.
tab_strip_->tab_container_->CompleteAnimationAndLayout();
// No tabs should be dragging at this point.
for (int i = 0; i < GetTabCount(); ++i) {
CHECK(!GetTabAt(i)->dragging(), base::NotFatalUntil::M128)
<< "A tab is still marked as dragging when starting a new drag.";
}
tab_strip_->tab_container_->CompleteAnimationAndLayout();
for (TabSlotView* dragged_view : views) {
CHECK_NE(dragged_view->parent(), this, base::NotFatalUntil::M128);
AddChildView(dragged_view);
dragged_view->set_dragging(true);
}
@ -618,19 +633,23 @@ class TabStrip::TabDragContextImpl : public TabDragContext,
tab_strip_->controller_->OnStoppedDragging();
}
void StoppedDragging(
const std::vector<raw_ptr<TabSlotView, VectorExperimental>>& views)
override {
void StoppedDragging() override {
// Let the controller know that the user stopped dragging tabs.
tab_strip_->controller_->OnStoppedDragging();
UpdateDragEventSourceCrashKey({});
// Animate the dragged views to their ideal positions. We'll hand them back
// to TabContainer when the animation ends.
for (TabSlotView* view : views) {
for (views::View* child : children()) {
gfx::Rect ideal_bounds;
TabSlotView* const slot_view = views::AsViewClass<TabSlotView>(child);
TabGroupHeader* header = views::AsViewClass<TabGroupHeader>(view);
if (!slot_view) {
continue;
}
const TabGroupHeader* const header =
views::AsViewClass<TabGroupHeader>(slot_view);
if (header) {
// Disable the group highlight now that the drag is ended.
tab_strip_->tab_container_->GetGroupViews(header->group().value())
@ -640,13 +659,13 @@ class TabStrip::TabDragContextImpl : public TabDragContext,
tab_strip_->tab_container_->GetIdealBounds(header->group().value());
} else {
ideal_bounds = tab_strip_->tab_container_->GetIdealBounds(
tab_strip_->GetModelIndexOf(view).value());
tab_strip_->GetModelIndexOf(slot_view).value());
}
bounds_animator_.AnimateViewTo(
view, ideal_bounds,
slot_view, ideal_bounds,
std::make_unique<ResetDraggingStateDelegate>(
*tab_strip_->tab_container_, *view));
*tab_strip_->tab_container_, *slot_view));
}
}
@ -1037,12 +1056,11 @@ int TabStrip::GetSizeNeededForViews(
return width;
}
void TabStrip::AddObserver(TabStripObserver* observer) {
observers_.AddObserver(observer);
}
void TabStrip::RemoveObserver(TabStripObserver* observer) {
observers_.RemoveObserver(observer);
void TabStrip::SetTabStripObserver(TabStripObserver* observer) {
// Overwriting a non-null delegate with another delegate is likely a logic
// bug.
CHECK_NE(!!observer_, !!observer);
observer_ = observer;
}
void TabStrip::SetBackgroundOffset(int background_offset) {
@ -1103,8 +1121,8 @@ void TabStrip::AddTabAt(int model_index, TabRendererData data) {
// callbacks.
tab->SetData(std::move(data));
for (TabStripObserver& observer : observers_) {
observer.OnTabAdded(model_index);
if (observer_) {
observer_->OnTabAdded(model_index);
}
// At the start of AddTabAt() the model and tabs are out of sync. Any queries
@ -1146,8 +1164,8 @@ void TabStrip::MoveTab(int from_model_index,
selected_tabs_.Move(from_model_index, to_model_index, /*length=*/1);
for (TabStripObserver& observer : observers_) {
observer.OnTabMoved(from_model_index, to_model_index);
if (observer_) {
observer_->OnTabMoved(from_model_index, to_model_index);
}
}
@ -1167,8 +1185,8 @@ void TabStrip::RemoveTabAt(content::WebContents* contents,
selected_tabs_.DecrementFrom(model_index);
for (TabStripObserver& observer : observers_) {
observer.OnTabRemoved(model_index);
if (observer_) {
observer_->OnTabRemoved(model_index);
}
}
@ -1203,7 +1221,7 @@ void TabStrip::AddTabToGroup(std::optional<tab_groups::TabGroupId> group,
if (static_cast<size_t>(model_index) == selected_tabs_.active() &&
group.has_value() && IsGroupCollapsed(group.value())) {
ToggleTabGroupCollapsedState(
group.value(), ToggleTabGroupCollapsedStateOrigin::kImplicitAction);
group.value(), ToggleTabGroupCollapsedStateOrigin::kMenuAction);
}
if (group.has_value()) {
@ -1294,16 +1312,11 @@ bool TabStrip::ShouldDrawStrokes() const {
}
if (!force_disable_tab_outlines) {
return true;
return true;
}
return false;
}
int TabStrip::Th24StrokeOffset() const {
return ShouldDrawStrokes() ? 2 : 2;
}
void TabStrip::SetSelection(const ui::ListSelectionModel& new_selection) {
// This CHECK ensures there is always an active tab to maintain UI
// consistency.
@ -1334,7 +1347,7 @@ void TabStrip::SetSelection(const ui::ListSelectionModel& new_selection) {
// automatically expand the group.
if (IsGroupCollapsed(new_group)) {
ToggleTabGroupCollapsedState(
new_group, ToggleTabGroupCollapsedStateOrigin::kImplicitAction);
new_group, ToggleTabGroupCollapsedStateOrigin::kTabsSelected);
}
}
}
@ -1564,8 +1577,12 @@ void TabStrip::AddSelectionFromAnchorTo(Tab* tab) {
void TabStrip::CloseTab(Tab* tab, CloseTabSource source) {
const std::optional<int> index_to_close =
tab_container_->GetModelIndexOfFirstNonClosingTab(tab);
if (index_to_close.has_value()) {
CloseTabInternal(index_to_close.value(), source);
if (index_to_close.has_value() && IsValidModelIndex(index_to_close.value())) {
auto callback =
base::BindOnce(&TabStrip::CloseTabInternal, base::Unretained(this),
index_to_close.value(), source);
controller_->OnCloseTab(index_to_close.value(), source,
std::move(callback));
}
}
@ -1719,6 +1736,11 @@ bool TabStrip::IsFocusInTabs() const {
return GetFocusManager() && Contains(GetFocusManager()->GetFocusedView());
}
bool TabStrip::ShouldCompactLeadingEdge() const {
return controller_->IsFrameButtonsRightAligned() &&
tabs::GetTabSearchTrailingTabstrip(controller_->GetProfile());
}
void TabStrip::MaybeStartDrag(
TabSlotView* source,
const ui::LocatedEvent& event,
@ -1803,7 +1825,8 @@ void TabStrip::OnMouseEventInTab(views::View* source,
// switch.
if (mouse_entered_tabstrip_time_.has_value() &&
!has_reported_time_mouse_entered_to_switch_ &&
event.type() == ui::ET_MOUSE_PRESSED && views::IsViewClass<Tab>(source)) {
event.type() == ui::EventType::kMousePressed &&
views::IsViewClass<Tab>(source)) {
UMA_HISTOGRAM_MEDIUM_TIMES(
"TabStrip.TimeToSwitch",
base::TimeTicks::Now() - mouse_entered_tabstrip_time_.value());
@ -1920,6 +1943,14 @@ const Browser* TabStrip::GetBrowser() const {
return controller_->GetBrowser();
}
int TabStrip::GetInactiveTabWidth() const {
return tab_container_->GetInactiveTabWidth();
}
bool TabStrip::IsFrameCondensed() const {
return controller_->IsFrameCondensed();
}
///////////////////////////////////////////////////////////////////////////////
// TabStrip, views::View overrides:
@ -1949,7 +1980,7 @@ gfx::Size TabStrip::CalculatePreferredSize(
}
void TabStrip::Layout(PassKey) {
if (base::FeatureList::IsEnabled(features::kScrollableTabStrip)) {
if (base::FeatureList::IsEnabled(tabs::kScrollableTabStrip)) {
// With tab scrolling, the TabStrip is the contents view of a ScrollView and
// as such is expected to set its own bounds during layout.
// (With great sizing power comes great sizing responsibility).
@ -2081,10 +2112,6 @@ int TabStrip::GetActiveTabWidth() const {
return tab_container_->GetActiveTabWidth();
}
int TabStrip::GetInactiveTabWidth() const {
return tab_container_->GetInactiveTabWidth();
}
const Tab* TabStrip::GetLastVisibleTab() const {
for (int i = GetTabCount() - 1; i >= 0; --i) {
const Tab* tab = tab_at(i);
@ -2103,15 +2130,6 @@ const Tab* TabStrip::GetLastVisibleTab() const {
}
void TabStrip::CloseTabInternal(int model_index, CloseTabSource source) {
if (!IsValidModelIndex(model_index)) {
return;
}
// If we're not allowed to close this tab for whatever reason, we should not
// proceed.
if (!controller_->BeforeCloseTab(model_index, source)) {
return;
}
if (!tab_container_->InTabClose() && IsAnimating()) {
// Cancel any current animations. We do this as remove uses the current
@ -2347,7 +2365,7 @@ void TabStrip::OnThemeChanged() {
void TabStrip::OnGestureEvent(ui::GestureEvent* event) {
switch (event->type()) {
case ui::ET_GESTURE_LONG_TAP: {
case ui::EventType::kGestureLongTap: {
tab_container_->HandleLongTap(event);
break;
}

File diff suppressed because it is too large Load diff

View file

@ -29,6 +29,7 @@
#include "chrome/browser/ui/views/toolbar/toolbar_button.h"
#include "chrome/browser/ui/views/toolbar/toolbar_ink_drop_util.h"
#include "chrome/browser/ui/views/toolbar/toolbar_view.h"
#include "chrome/browser/user_education/tutorial_identifiers.h"
#include "chrome/browser/user_education/user_education_service.h"
#include "chrome/browser/user_education/user_education_service_factory.h"
#include "chrome/grit/branded_strings.h"
@ -72,13 +73,11 @@ BrowserAppMenuButton::BrowserAppMenuButton(ToolbarView* toolbar_view)
base::Unretained(this))),
toolbar_view_(toolbar_view) {
SetHorizontalAlignment(gfx::ALIGN_RIGHT);
if (features::IsChromeRefresh2023()) {
SetImageLabelSpacing(kChromeRefreshImageLabelPadding);
label()->SetPaintToLayer();
label()->SetSkipSubpixelRenderingOpacityCheck(true);
label()->layer()->SetFillsBoundsOpaquely(false);
label()->SetSubpixelRenderingEnabled(false);
}
SetImageLabelSpacing(kChromeRefreshImageLabelPadding);
label()->SetPaintToLayer();
label()->SetSkipSubpixelRenderingOpacityCheck(true);
label()->layer()->SetFillsBoundsOpaquely(false);
label()->SetSubpixelRenderingEnabled(false);
}
BrowserAppMenuButton::~BrowserAppMenuButton() {}
@ -142,46 +141,29 @@ void BrowserAppMenuButton::UpdateThemeBasedState() {
// Call `UpdateIcon()` after `UpdateTextAndHighlightColor()` as the icon color
// depends on if the container is in an expanded state.
UpdateIcon();
if (features::IsChromeRefresh2023()) {
UpdateInkdrop();
// Outset focus ring should be present for the chip but not when only
// the icon is visible.
views::FocusRing::Get(this)->SetOutsetFocusRingDisabled(
!IsLabelPresentAndVisible());
}
UpdateInkdrop();
// Outset focus ring should be present for the chip but not when only
// the icon is visible.
views::FocusRing::Get(this)->SetOutsetFocusRingDisabled(
!IsLabelPresentAndVisible());
}
void BrowserAppMenuButton::UpdateIcon() {
static const bool disable_thorium_icons =
base::CommandLine::ForCurrentProcess()->HasSwitch("disable-thorium-icons");
const gfx::VectorIcon& icon =
ui::TouchUiController::Get()->touch_ui()
? kBrowserToolsTouchIcon
: (features::IsChromeRefresh2023() ? disable_thorium_icons ? kBrowserToolsChromeRefreshIcon
: kBrowserToolsChromeRefreshThoriumIcon
: disable_thorium_icons ? kBrowserToolsIcon
: kBrowserToolsThoriumIcon);
const gfx::VectorIcon& icon = ui::TouchUiController::Get()->touch_ui()
? kBrowserToolsTouchIcon
: disable_thorium_icons ? kBrowserToolsChromeRefreshIcon
: kBrowserToolsChromeRefreshThoriumIcon);
// Fix Thorium hamburger menu size
static const int icon_size = 22;
for (auto state : kButtonStates) {
// `app_menu_icon_controller()->GetIconColor()` set different colors based
// on the severity. However with chrome refresh all the severities should
// have the same color. Decouple the logic from
// `app_menu_icon_controller()->GetIconColor()` to avoid impact from
// multiple call sites.
SkColor icon_color =
features::IsChromeRefresh2023()
? GetForegroundColor(state)
: toolbar_view_->app_menu_icon_controller()->GetIconColor(
GetForegroundColor(state));
SkColor icon_color = GetForegroundColor(state);
SetImageModel(state, ui::ImageModel::FromVectorIcon(icon, icon_color, icon_size));
}
}
void BrowserAppMenuButton::UpdateInkdrop() {
CHECK(features::IsChromeRefresh2023());
if (IsLabelPresentAndVisible()) {
ConfigureToolbarInkdropForRefresh2023(this, kColorAppMenuChipInkDropHover,
kColorAppMenuChipInkDropRipple);
@ -199,7 +181,7 @@ bool BrowserAppMenuButton::IsLabelPresentAndVisible() const {
}
SkColor BrowserAppMenuButton::GetForegroundColor(ButtonState state) const {
if (features::IsChromeRefresh2023() && IsLabelPresentAndVisible()) {
if (IsLabelPresentAndVisible()) {
const auto* const color_provider = GetColorProvider();
if (type_and_severity_.use_primary_colors) {
return color_provider->GetColor(kColorAppMenuExpandedForegroundPrimary);
@ -255,14 +237,10 @@ void BrowserAppMenuButton::UpdateTextAndHighlightColor() {
}
bool BrowserAppMenuButton::ShouldPaintBorder() const {
return !features::IsChromeRefresh2023();
return false;
}
void BrowserAppMenuButton::UpdateLayoutInsets() {
if (!features::IsChromeRefresh2023()) {
return;
}
if (IsLabelPresentAndVisible()) {
SetLayoutInsets(::GetLayoutInsets(BROWSER_APP_MENU_CHIP_PADDING));
} else {
@ -271,7 +249,7 @@ void BrowserAppMenuButton::UpdateLayoutInsets() {
}
std::optional<SkColor> BrowserAppMenuButton::GetHighlightTextColor() const {
if (features::IsChromeRefresh2023() && IsLabelPresentAndVisible()) {
if (IsLabelPresentAndVisible()) {
const auto* const color_provider = GetColorProvider();
if (type_and_severity_.use_primary_colors) {
return color_provider->GetColor(kColorAppMenuExpandedForegroundPrimary);
@ -283,19 +261,12 @@ std::optional<SkColor> BrowserAppMenuButton::GetHighlightTextColor() const {
std::optional<SkColor> BrowserAppMenuButton::GetHighlightColor() const {
const auto* const color_provider = GetColorProvider();
if (features::IsChromeRefresh2023() &&
type_and_severity_.use_primary_colors) {
return color_provider->GetColor(kColorAppMenuHighlightPrimary);
}
switch (type_and_severity_.severity) {
case AppMenuIconController::Severity::NONE:
return std::nullopt;
case AppMenuIconController::Severity::LOW:
return color_provider->GetColor(kColorAppMenuHighlightSeverityLow);
case AppMenuIconController::Severity::MEDIUM:
return color_provider->GetColor(kColorAppMenuHighlightSeverityMedium);
case AppMenuIconController::Severity::HIGH:
return color_provider->GetColor(kColorAppMenuHighlightSeverityHigh);
if (type_and_severity_.severity == AppMenuIconController::Severity::NONE) {
return std::nullopt;
} else {
return color_provider->GetColor(type_and_severity_.use_primary_colors
? kColorAppMenuHighlightPrimary
: kColorAppMenuHighlightDefault);
}
}

View file

@ -32,15 +32,15 @@ ChromeLabsButton::ChromeLabsButton(BrowserView* browser_view,
base::Unretained(this))),
browser_view_(browser_view),
model_(model) {
SetProperty(views::kElementIdentifierKey, kToolbarChromeLabsButtonElementId);
static const bool disable_thorium_icons =
base::CommandLine::ForCurrentProcess()->HasSwitch("disable-thorium-icons");
SetProperty(views::kElementIdentifierKey, kToolbarChromeLabsButtonElementId);
SetVectorIcons(features::IsChromeRefresh2023() ? disable_thorium_icons ? kChromeLabsChromeRefreshIcon
: kChromeLabsChromeRefreshThoriumIcon
: disable_thorium_icons ? kChromeLabsIcon
: kChromeLabsThoriumIcon,
kChromeLabsTouchIcon);
SetAccessibleName(l10n_util::GetStringUTF16(IDS_ACCNAME_CHROMELABS_BUTTON));
SetVectorIcons(disable_thorium_icons ? kScienceIcon, kScienceIcon
: kScienceThoriumIcon, kScienceThoriumIcon);
GetViewAccessibility().SetName(
l10n_util::GetStringUTF16(IDS_ACCNAME_CHROMELABS_BUTTON));
SetTooltipText(l10n_util::GetStringUTF16(IDS_TOOLTIP_CHROMELABS_BUTTON));
button_controller()->set_notify_action(
views::ButtonController::NotifyAction::kOnPress);

View file

@ -27,6 +27,7 @@
#include "ui/base/metadata/metadata_header_macros.h"
#include "ui/base/metadata/metadata_impl_macros.h"
#include "ui/base/models/menu_model.h"
#include "ui/views/accessibility/view_accessibility.h"
#include "ui/views/bubble/bubble_dialog_delegate_view.h"
#include "ui/views/controls/styled_label.h"
#include "ui/views/layout/fill_layout.h"
@ -135,19 +136,17 @@ HomeButton::HomeButton(PressedCallback callback, PrefService* prefs)
: ToolbarButton(std::move(callback)),
prefs_(prefs),
coordinator_(this, prefs) {
static const bool disable_thorium_icons =
base::CommandLine::ForCurrentProcess()->HasSwitch("disable-thorium-icons");
SetProperty(views::kElementIdentifierKey, kToolbarHomeButtonElementId);
SetTriggerableEventFlags(ui::EF_LEFT_MOUSE_BUTTON |
ui::EF_MIDDLE_MOUSE_BUTTON);
SetVectorIcons(features::IsChromeRefresh2023()
? disable_thorium_icons ? kNavigateHomeChromeRefreshIcon
: kNavigateHomeChromeRefreshThoriumIcon
: disable_thorium_icons ? kNavigateHomeIcon
: kNavigateHomeThoriumIcon,
kNavigateHomeTouchIcon);
static const bool disable_thorium_icons =
base::CommandLine::ForCurrentProcess()->HasSwitch("disable-thorium-icons");
SetVectorIcons(disable_thorium_icons ? kNavigateHomeChromeRefreshIcon, kNavigateHomeTouchIcon
: kNavigateHomeChromeRefreshThoriumIcon, kNavigateHomeTouchIcon);
SetTooltipText(l10n_util::GetStringUTF16(IDS_TOOLTIP_HOME));
SetAccessibleName(l10n_util::GetStringUTF16(IDS_ACCNAME_HOME));
GetViewAccessibility().SetName(l10n_util::GetStringUTF16(IDS_ACCNAME_HOME));
SetID(VIEW_ID_HOME_BUTTON);
SizeToPreferredSize();
}

View file

@ -1,93 +0,0 @@
// Copyright 2024 The Chromium Authors and Alex313031
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chrome/browser/ui/views/toolbar/side_panel_toolbar_button.h"
#include "base/command_line.h"
#include "base/metrics/user_metrics.h"
#include "base/metrics/user_metrics_action.h"
#include "build/branding_buildflags.h"
#include "build/build_config.h"
#include "chrome/app/vector_icons/vector_icons.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_element_identifiers.h"
#include "chrome/browser/ui/side_panel/companion/companion_utils.h"
#include "chrome/browser/ui/ui_features.h"
#include "chrome/browser/ui/views/frame/browser_view.h"
#include "chrome/browser/ui/views/side_panel/side_panel.h"
#include "chrome/browser/ui/views/side_panel/side_panel_coordinator.h"
#include "chrome/common/pref_names.h"
#include "chrome/grit/generated_resources.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/metadata/metadata_impl_macros.h"
#include "ui/base/ui_base_features.h"
#include "ui/views/accessibility/view_accessibility.h"
#include "ui/views/controls/button/button_controller.h"
#include "ui/views/view_class_properties.h"
SidePanelToolbarButton::SidePanelToolbarButton(Browser* browser)
: ToolbarButton(base::BindRepeating(&SidePanelToolbarButton::ButtonPressed,
base::Unretained(this))),
browser_(browser) {
pref_change_registrar_.Init(browser_->profile()->GetPrefs());
pref_change_registrar_.Add(
prefs::kSidePanelHorizontalAlignment,
base::BindRepeating(&SidePanelToolbarButton::UpdateToolbarButtonIcon,
base::Unretained(this)));
UpdateToolbarButtonIcon();
SetTooltipText(l10n_util::GetStringUTF16(
companion::IsCompanionFeatureEnabled() ? IDS_TOOLTIP_SIDE_PANEL
: IDS_TOOLTIP_SIDE_PANEL_SHOW));
// Since this button does not have a context menu, set its context menu
// controller to nullptr.
set_context_menu_controller(nullptr);
button_controller()->set_notify_action(
views::ButtonController::NotifyAction::kOnPress);
GetViewAccessibility().SetHasPopup(ax::mojom::HasPopup::kMenu);
SetProperty(views::kElementIdentifierKey, kToolbarSidePanelButtonElementId);
}
SidePanelToolbarButton::~SidePanelToolbarButton() = default;
void SidePanelToolbarButton::ButtonPressed() {
BrowserView* const browser_view =
BrowserView::GetBrowserViewForBrowser(browser_);
DCHECK(browser_view->unified_side_panel());
SidePanelUI::GetSidePanelUIForBrowser(browser_)->Toggle();
}
void SidePanelToolbarButton::UpdateToolbarButtonIcon() {
const bool is_right_aligned = browser_->profile()->GetPrefs()->GetBoolean(
prefs::kSidePanelHorizontalAlignment);
static const bool disable_thorium_icons =
base::CommandLine::ForCurrentProcess()->HasSwitch("disable-thorium-icons");
if (disable_thorium_icons) {
if (is_right_aligned) {
SetVectorIcons(features::IsChromeRefresh2023() ? kSidePanelChromeRefreshIcon
: kSidePanelIcon, kSidePanelTouchIcon);
} else {
SetVectorIcons(features::IsChromeRefresh2023() ? kSidePanelLeftChromeRefreshIcon
: kSidePanelLeftIcon, kSidePanelLeftTouchIcon);
}
} else {
if (is_right_aligned) {
SetVectorIcons(features::IsChromeRefresh2023() ? kSidePanelChromeRefreshThoriumIcon
: kSidePanelThoriumIcon, kSidePanelTouchThoriumIcon);
} else {
SetVectorIcons(features::IsChromeRefresh2023() ? kSidePanelLeftChromeRefreshThoriumIcon
: kSidePanelLeftThoriumIcon, kSidePanelLeftTouchThoriumIcon);
}
}
}
bool SidePanelToolbarButton::ShouldShowInkdropAfterIphInteraction() {
return false;
}
BEGIN_METADATA(SidePanelToolbarButton)
END_METADATA

View file

@ -3,62 +3,41 @@
// found in the LICENSE file.
#include "chrome/browser/ui/webui/whats_new/whats_new_util.h"
#include "base/check.h"
#include "base/command_line.h"
#include "base/feature_list.h"
#include "base/functional/bind.h"
#include "base/functional/callback.h"
#include "base/location.h"
#include "base/memory/raw_ptr.h"
#include "base/memory/scoped_refptr.h"
#include "base/metrics/histogram_functions.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/stringprintf.h"
#include "base/task/sequenced_task_runner.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/net/system_network_context_manager.h"
#include "base/notreached.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_list.h"
#include "chrome/browser/ui/browser_list_observer.h"
#include "chrome/browser/ui/browser_tabstrip.h"
#include "chrome/browser/ui/ui_features.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/common/chrome_version.h"
#include "chrome/common/pref_names.h"
#include "chrome/common/webui_url_constants.h"
#include "components/prefs/pref_service.h"
#include "content/public/browser/browser_task_traits.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/reduce_accept_language_controller_delegate.h"
#include "net/base/url_util.h"
#include "net/http/http_util.h"
#include "services/network/public/cpp/resource_request.h"
#include "services/network/public/cpp/simple_url_loader.h"
#include "services/network/public/mojom/url_response_head.mojom.h"
#include "ui/base/ui_base_features.h"
#include "url/gurl.h"
namespace whats_new {
const int64_t kMaxDownloadBytes = 1024 * 1024;
const char kChromeWhatsNewURL[] = "https://www.google.com/chrome/whats-new/";
const char kChromeWhatsNewURLShort[] = "google.com/chrome/whats-new/";
bool g_is_remote_content_disabled = false;
#if !BUILDFLAG(IS_CHROMEOS)
// For testing purposes, so that WebUI tests run on non-branded
// CQ bots.
BASE_FEATURE(kForceEnabled,
"WhatsNewForceEnabled",
base::FEATURE_ENABLED_BY_DEFAULT);
#endif
bool IsEnabled() {
#if BUILDFLAG(GOOGLE_CHROME_BRANDING) && !defined(ANDROID) && \
!BUILDFLAG(IS_CHROMEOS_LACROS) && !BUILDFLAG(IS_CHROMEOS_ASH)
#if BUILDFLAG(GOOGLE_CHROME_BRANDING) && !BUILDFLAG(IS_CHROMEOS)
return true;
#else
#elif !BUILDFLAG(IS_CHROMEOS)
return base::FeatureList::IsEnabled(whats_new::kForceEnabled);
#else
return false;
#endif
}
@ -67,7 +46,9 @@ void DisableRemoteContentForTests() {
}
void LogStartupType(StartupType type) {
#if !BUILDFLAG(IS_CHROMEOS)
base::UmaHistogramEnumeration("WhatsNew.StartupType", type);
#endif
}
bool IsRemoteContentDisabled() {
@ -76,6 +57,9 @@ bool IsRemoteContentDisabled() {
bool ShouldShowForState(PrefService* local_state,
bool promotional_tabs_enabled) {
#if BUILDFLAG(IS_CHROMEOS)
return false;
#else
LogStartupType(StartupType::kCalledShouldShow);
if (!promotional_tabs_enabled) {
@ -116,182 +100,16 @@ bool ShouldShowForState(PrefService* local_state,
// multiple profile relaunches (see https://crbug.com/1274313).
local_state->SetInteger(prefs::kLastWhatsNewVersion, CHROME_VERSION_MAJOR);
return true;
}
GURL GetServerURL(bool may_redirect) {
const GURL url =
may_redirect
? net::AppendQueryParameter(
GURL(kChromeWhatsNewURL), "version",
base::NumberToString(CHROME_VERSION_MAJOR))
: GURL(kChromeWhatsNewURL)
.Resolve(base::StringPrintf("m%d", CHROME_VERSION_MAJOR));
return net::AppendQueryParameter(url, "internal", "true");
#endif
}
GURL GetWebUIStartupURL() {
#if !BUILDFLAG(IS_CHROMEOS)
return net::AppendQueryParameter(GURL(chrome::kChromeUIWhatsNewURL), "auto",
"true");
}
namespace {
class WhatsNewFetcher : public BrowserListObserver {
public:
explicit WhatsNewFetcher(Browser* browser) : browser_(browser) {
BrowserList::AddObserver(this);
GURL server_url = GetServerURL(false);
startup_url_ = GetWebUIStartupURL();
if (IsRemoteContentDisabled()) {
// Don't fetch network content if this is the case, just pretend the tab
// was retrieved successfully. Do so asynchronously to simulate the
// production code better.
base::SequencedTaskRunner::GetCurrentDefault()->PostTask(
FROM_HERE, base::BindOnce(&WhatsNewFetcher::OpenWhatsNewTabForTest,
base::Unretained(this)));
return;
}
LogLoadEvent(LoadEvent::kLoadStart);
auto traffic_annotation =
net::DefineNetworkTrafficAnnotation("whats_new_handler", R"(
semantics {
sender: "What's New Page"
description: "Attempts to fetch the content for the What's New "
"page to ensure it loads successfully."
trigger:
"Restarting Chrome after an update. Desktop only."
data:
"No data sent, other than URL of What's New. "
"Data does not contain PII."
destination: GOOGLE_OWNED_SERVICE
}
policy {
cookies_allowed: NO
setting:
"None"
chrome_policy {
PromotionalTabsEnabled {
PromotionalTabsEnabled: false
}
}
})");
network::mojom::URLLoaderFactory* loader_factory =
g_browser_process->system_network_context_manager()
->GetURLLoaderFactory();
auto request = std::make_unique<network::ResourceRequest>();
// Inform the server of the top browser language via the
// Accept-Language header.
if (auto* profile = browser->profile()) {
if (auto* delegate =
profile->GetReduceAcceptLanguageControllerDelegate()) {
auto languages = delegate->GetUserAcceptLanguages();
if (!languages.empty()) {
request->headers.SetHeader(request->headers.kAcceptLanguage,
languages.front());
}
}
}
// Don't allow redirects when checking if the page is valid for the current
// milestone.
request->url = server_url;
simple_loader_ = network::SimpleURLLoader::Create(std::move(request),
traffic_annotation);
// base::Unretained is safe here because only OnResponseLoaded deletes
// |this|.
simple_loader_->DownloadToString(
loader_factory,
base::BindOnce(&WhatsNewFetcher::OnResponseLoaded,
base::Unretained(this)),
kMaxDownloadBytes);
}
~WhatsNewFetcher() override { BrowserList::RemoveObserver(this); }
// BrowserListObserver:
void OnBrowserRemoved(Browser* browser) override {
if (browser != browser_)
return;
browser_closed_or_inactive_ = true;
BrowserList::RemoveObserver(this);
browser_ = nullptr;
}
void OnBrowserNoLongerActive(Browser* browser) override {
if (browser == browser_)
browser_closed_or_inactive_ = true;
}
void OnBrowserSetLastActive(Browser* browser) override {
if (browser == browser_)
browser_closed_or_inactive_ = false;
}
private:
void AddWhatsNewTab(Browser* browser) {
chrome::AddTabAt(browser, startup_url_, 0, true);
browser->tab_strip_model()->ActivateTabAt(
browser->tab_strip_model()->IndexOfFirstNonPinnedTab());
}
static void LogLoadEvent(LoadEvent event) {
base::UmaHistogramEnumeration("WhatsNew.LoadEvent", event);
}
void OpenWhatsNewTabForTest() {
if (browser_closed_or_inactive_)
return;
AddWhatsNewTab(browser_);
delete this;
}
void OnResponseLoaded(std::unique_ptr<std::string> body) {
int error_or_response_code = simple_loader_->NetError();
const auto& headers = simple_loader_->ResponseInfo()
? simple_loader_->ResponseInfo()->headers
: nullptr;
bool success = error_or_response_code == net::OK && headers;
if (headers) {
error_or_response_code =
net::HttpUtil::MapStatusCodeForHistogram(headers->response_code());
}
base::UmaHistogramSparse("WhatsNew.LoadResponseCode",
error_or_response_code);
success = success && error_or_response_code >= 200 &&
error_or_response_code <= 299 && body;
// If the browser was closed or moved to the background while What's New was
// loading, return early before recording that the user saw the page.
if (browser_closed_or_inactive_)
return;
DCHECK(browser_);
LogLoadEvent(success ? LoadEvent::kLoadSuccess
: LoadEvent::kLoadFailAndDoNotShow);
if (success)
AddWhatsNewTab(browser_);
delete this;
}
std::unique_ptr<network::SimpleURLLoader> simple_loader_;
raw_ptr<Browser> browser_;
bool browser_closed_or_inactive_ = false;
GURL startup_url_;
};
} // namespace
void StartWhatsNewFetch(Browser* browser) {
new WhatsNewFetcher(browser);
#else
NOTREACHED_NORETURN();
#endif
}
} // namespace whats_new

View file

@ -444,9 +444,10 @@ void HistoryBackend::SetOnBackendDestroyTask(
void HistoryBackend::Closing() {
TRACE_EVENT0("browser", "HistoryBackend::Closing");
// Any scheduled commit will have a reference to us, we must make it
// release that reference before we can be destroyed.
// The history system is shutting down. Cancel any pending/scheduled work.
CancelScheduledCommit();
queued_history_db_tasks_.clear();
posted_history_db_task_.Cancel();
}
#if BUILDFLAG(IS_IOS)
@ -1281,7 +1282,7 @@ void HistoryBackend::InitImpl(
return;
}
default:
NOTREACHED();
NOTREACHED_IN_MIGRATION();
}
// Fill the in-memory database and send it back to the history service on the
@ -2931,7 +2932,7 @@ void HistoryBackend::GetRedirectsFromSpecificVisit(VisitID cur_visit,
visit_set.insert(cur_visit);
while (db_->GetRedirectFromVisit(cur_visit, &cur_visit, &cur_url)) {
if (visit_set.find(cur_visit) != visit_set.end()) {
DUMP_WILL_BE_NOTREACHED_NORETURN() << "Loop in visit chain, giving up";
DUMP_WILL_BE_NOTREACHED() << "Loop in visit chain, giving up";
return;
}
visit_set.insert(cur_visit);
@ -2952,7 +2953,7 @@ void HistoryBackend::GetRedirectsToSpecificVisit(VisitID cur_visit,
visit_set.insert(cur_visit);
while (db_->GetRedirectToVisit(cur_visit, &cur_visit, &cur_url)) {
if (visit_set.find(cur_visit) != visit_set.end()) {
DUMP_WILL_BE_NOTREACHED_NORETURN() << "Loop in visit chain, giving up";
DUMP_WILL_BE_NOTREACHED() << "Loop in visit chain, giving up";
return;
}
visit_set.insert(cur_visit);
@ -3303,10 +3304,17 @@ void HistoryBackend::ProcessDBTaskImpl() {
task->DoneRun();
} else {
// The task wants to run some more. Schedule it at the end of the current
// tasks, and process it after an invoke later.
// tasks.
queued_history_db_tasks_.push_back(std::move(task));
task_runner_->PostTask(
FROM_HERE, base::BindOnce(&HistoryBackend::ProcessDBTaskImpl, this));
}
// If there are more tasks queued, schedule the next one.
// Note: Using PostTask() ensures the history sequence gets unblocked for
// other work.
if (!queued_history_db_tasks_.empty()) {
posted_history_db_task_.Reset(
base::BindOnce(&HistoryBackend::ProcessDBTaskImpl, this));
task_runner_->PostTask(FROM_HERE, posted_history_db_task_.callback());
}
}
@ -3579,8 +3587,7 @@ void HistoryBackend::KillHistoryDatabase() {
// transaction. Deleting the object causes the rollback in the destructor.
singleton_transaction_.reset();
bool success = db_->Raze();
UMA_HISTOGRAM_BOOLEAN("History.KillHistoryDatabaseResult", success);
db_->Raze();
// The expirer keeps tabs on the active databases. Tell it about the
// databases which will be closed.

View file

@ -53,6 +53,7 @@ struct FeaturePromoControllerCommon::ShowPromoBubbleParams {
raw_ptr<const FeaturePromoSpecification> spec = nullptr;
raw_ptr<ui::TrackedElement> anchor_element = nullptr;
FeaturePromoSpecification::FormatParameters body_format;
FeaturePromoSpecification::FormatParameters screen_reader_format;
FeaturePromoSpecification::FormatParameters title_format;
bool screen_reader_prompt_available = false;
bool can_snooze = false;
@ -216,13 +217,13 @@ FeaturePromoResult FeaturePromoControllerCommon::MaybeShowPromoCommon(
// currently showing, there is a bug somewhere in here.
DCHECK(!current_promo_);
current_promo_ = std::move(lifecycle);
// Construct the parameters for the promotion.
ShowPromoBubbleParams show_params;
show_params.spec = display_spec;
show_params.anchor_element = anchor_element;
show_params.screen_reader_prompt_available = screen_reader_available;
show_params.body_format = std::move(params.body_params);
show_params.screen_reader_format = std::move(params.screen_reader_params);
show_params.title_format = std::move(params.title_params);
show_params.can_snooze = current_promo_->CanSnooze();
@ -699,6 +700,9 @@ FeaturePromoResult FeaturePromoControllerCommon::CanShowPromoCommon(
auto lifecycle = std::make_unique<FeaturePromoLifecycle>(
storage_service_, params.key, &*params.feature, spec->promo_type(),
spec->promo_subtype(), spec->rotating_promos().size());
if (spec->reshow_delay()) {
lifecycle->SetReshowPolicy(*spec->reshow_delay(), spec->max_show_count());
}
if (!for_demo && !in_iph_demo_mode_) {
if (const auto result = lifecycle->CanShow(); !result) {
return result;
@ -807,15 +811,20 @@ std::unique_ptr<HelpBubble> FeaturePromoControllerCommon::ShowPromoBubbleImpl(
spec.bubble_body_string_id(), std::move(params.body_format));
bubble_params.title_text = FeaturePromoSpecification::FormatString(
spec.bubble_title_string_id(), std::move(params.title_format));
if (spec.screen_reader_string_id()) {
if (spec.screen_reader_accelerator()) {
CHECK(spec.screen_reader_string_id());
CHECK(std::holds_alternative<FeaturePromoSpecification::NoSubstitution>(
params.screen_reader_format))
<< "Accelerator and substitution are not compatible for screen "
"reader text.";
bubble_params.screenreader_text =
spec.screen_reader_accelerator()
? l10n_util::GetStringFUTF16(
spec.screen_reader_string_id(),
spec.screen_reader_accelerator()
.GetAccelerator(GetAcceleratorProvider())
.GetShortcutText())
: l10n_util::GetStringUTF16(spec.screen_reader_string_id());
l10n_util::GetStringFUTF16(spec.screen_reader_string_id(),
spec.screen_reader_accelerator()
.GetAccelerator(GetAcceleratorProvider())
.GetShortcutText());
} else {
bubble_params.screenreader_text = FeaturePromoSpecification::FormatString(
spec.screen_reader_string_id(), std::move(params.screen_reader_format));
}
bubble_params.close_button_alt_text =
l10n_util::GetStringUTF16(IDS_CLOSE_PROMO);
@ -1205,8 +1214,14 @@ void FeaturePromoControllerCommon::RecordPromoNotShown(
case FeaturePromoResult::kExceededMaxShowCount:
failure_action_name.append("ExceededMaxShowCount");
break;
case FeaturePromoResult::kBlockedByNewProfile:
failure_action_name.append("BlockedByNewProfile");
break;
case FeaturePromoResult::kBlockedByReshowDelay:
failure_action_name.append("BlockedByReshowDelay");
break;
default:
NOTREACHED();
NOTREACHED_IN_MIGRATION();
}
base::RecordComputedAction(failure_action_name);
}

View file

@ -47,21 +47,17 @@ aggregate_vector_icons("components_vector_icons") {
"caret_up.icon",
"cast.icon",
"celebration.icon",
"certificate.icon",
"certificate_chrome_refresh.icon",
"certificate_off_chrome_refresh.icon",
"check_circle.icon",
"close.icon",
"close_chrome_refresh.icon",
"close_rounded.icon",
"cloud_download.icon",
"code.icon",
"code_chrome_refresh.icon",
"code_off_chrome_refresh.icon",
"content_copy.icon",
"content_paste.icon",
"content_paste_chrome_refresh.icon",
"content_paste_off.icon",
"content_paste_off_chrome_refresh.icon",
"cookie.icon",
"cookie_chrome_refresh.icon",
@ -72,7 +68,6 @@ aggregate_vector_icons("components_vector_icons") {
"database_off.icon",
"description.icon",
"devices.icon",
"devices_off.icon",
"devices_off_chrome_refresh.icon",
"document_scanner.icon",
"dogfood.icon",
@ -91,30 +86,27 @@ aggregate_vector_icons("components_vector_icons") {
"family_link.icon",
"file_download.icon",
"file_download_chrome_refresh.icon",
"file_download_off.icon",
"file_download_off_chrome_refresh.icon",
"fingerprint.icon",
"fingerprint_off.icon",
"folder.icon",
"folder_chrome_refresh.icon",
"folder_managed.icon",
"folder_managed_refresh.icon",
"folder_managed_touch.icon",
"folder_open.icon",
"folder_touch.icon",
"font_download.icon",
"font_download_chrome_refresh.icon",
"font_download_off_chrome_refresh.icon",
"forward_10.icon",
"forward_arrow.icon",
"forward_arrow_chrome_refresh.icon",
"globe.icon",
"google_color.icon",
"gpp_maybe.icon",
"groups.icon",
"headset.icon",
"help.icon",
"help_outline.icon",
"history.icon",
"history_chrome_refresh.icon",
"https_valid.icon",
"https_valid_chrome_refresh.icon",
"iframe.icon",
"iframe_off.icon",
@ -131,9 +123,7 @@ aggregate_vector_icons("components_vector_icons") {
"lightbulb_outline.icon",
"lightbulb_outline_chrome_refresh.icon",
"link.icon",
"live_caption_off.icon",
"live_caption_on.icon",
"location_off.icon",
"location_off_chrome_refresh.icon",
"location_on.icon",
"location_on_chrome_refresh.icon",
@ -141,13 +131,11 @@ aggregate_vector_icons("components_vector_icons") {
"magic_button.icon",
"media_next_track.icon",
"media_previous_track.icon",
"media_router_active.icon",
"media_router_active_chrome_refresh.icon",
"media_router_error.icon",
"media_router_idle.icon",
"media_router_idle_chrome_refresh.icon",
"media_router_paused.icon",
"media_router_warning.icon",
"media_router_warning_chrome_refresh.icon",
"media_seek_backward.icon",
"media_seek_forward.icon",
@ -157,7 +145,6 @@ aggregate_vector_icons("components_vector_icons") {
"mic_off_chrome_refresh.icon",
"midi.icon",
"midi_chrome_refresh.icon",
"midi_off.icon",
"midi_off_chrome_refresh.icon",
"not_secure_warning.icon",
"not_secure_warning_chrome_refresh.icon",
@ -166,11 +153,8 @@ aggregate_vector_icons("components_vector_icons") {
"notification_warning.icon",
"notifications.icon",
"notifications_chrome_refresh.icon",
"notifications_off.icon",
"notifications_off_chrome_refresh.icon",
"page_info_content_paste.icon",
"page_info_content_paste_chrome_refresh.icon",
"page_info_content_paste_off_chrome_refresh.icon",
"passkey.icon",
"password_manager.icon",
"pause.icon",
@ -180,12 +164,12 @@ aggregate_vector_icons("components_vector_icons") {
"photo_off_chrome_refresh.icon",
"picture_in_picture.icon",
"picture_in_picture_alt.icon",
"pip_exit.icon",
"play_arrow.icon",
"play_arrow_chrome_refresh.icon",
"pointer_lock.icon",
"pointer_lock_off.icon",
"printer.icon",
"privacy_sandbox.icon",
"protected_content.icon",
"protocol_handler.icon",
"protocol_handler_chrome_refresh.icon",
@ -214,9 +198,11 @@ aggregate_vector_icons("components_vector_icons") {
"settings_outline.icon",
"shopping_bag.icon",
"shopping_bag_refresh.icon",
"shoppingmode.icon",
"skip_next.icon",
"skip_previous.icon",
"sms.icon",
"stop_circle.icon",
"storage_access.icon",
"storage_access_off.icon",
"submenu_arrow.icon",
@ -226,10 +212,13 @@ aggregate_vector_icons("components_vector_icons") {
"sync_off_chrome_refresh.icon",
"sync_problem_chrome_refresh.icon",
"tenancy.icon",
"thumb_down.icon",
"thumb_down_filled.icon",
"thumb_up.icon",
"thumb_up_filled.icon",
"touchpad_mouse.icon",
"touchpad_mouse_off.icon",
"translate_chrome_refresh.icon",
"troubleshoot.icon",
"undo.icon",
"usb.icon",
"usb_chrome_refresh.icon",
@ -244,13 +233,13 @@ aggregate_vector_icons("components_vector_icons") {
"videogame_asset_off_chrome_refresh.icon",
"view_in_ar_chrome_refresh.icon",
"view_in_ar_off_chrome_refresh.icon",
"volume_off.icon",
"visibility.icon",
"visibility_off.icon",
"volume_off_chrome_refresh.icon",
"volume_up.icon",
"volume_up_chrome_refresh.icon",
"vr_headset.icon",
"vr_headset_chrome_refresh.icon",
"vr_headset_off.icon",
"vr_headset_off_chrome_refresh.icon",
"warning.icon",
"warning_outline.icon",
@ -261,6 +250,10 @@ aggregate_vector_icons("components_vector_icons") {
sources += [ "thorium/reload_chrome_refresh_thorium.icon" ]
}
if (is_chromeos) {
sources += [ "notification_download.icon" ]
}
if (is_chromeos_ash) {
sources += [ "videogame_asset_outline.icon" ]
}

View file

@ -2,6 +2,11 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifdef UNSAFE_BUFFERS_BUILD
// TODO(crbug.com/342213636): Remove this and spanify to fix the errors.
#pragma allow_unsafe_buffers
#endif
#include "content/common/gpu_pre_sandbox_hook_linux.h"
#include <dlfcn.h>
@ -199,6 +204,8 @@ void AddArmMaliGpuPermissions(std::vector<BrokerFilePermission>* permissions) {
static const char kMali0Path[] = "/dev/mali0";
permissions->push_back(BrokerFilePermission::ReadWrite(kMali0Path));
// Need to be able to dlopen libmali.so from libEGL.so.
permissions->push_back(BrokerFilePermission::ReadOnly(kLibMaliPath));
#if BUILDFLAG(IS_CHROMEOS) && defined(ARCH_CPU_ARM_FAMILY)
// Files needed for protected DMA allocations.
@ -332,7 +339,7 @@ void AddIntelGpuPermissions(std::vector<BrokerFilePermission>* permissions) {
"/usr/lib64/libdrm_amdgpu.so.1", "/usr/lib64/libdrm_radeon.so.1",
"/usr/lib64/libdrm_nouveau.so.2", "/usr/lib64/dri/crocus_dri.so",
"/usr/lib64/dri/i965_dri.so", "/usr/lib64/dri/iris_dri.so",
"/usr/lib64/dri/swrast_dri.so",
"/usr/lib64/dri/swrast_dri.so", "/usr/lib64/libzstd.so.1",
// Allow libglvnd files and libs.
"/usr/share/glvnd/egl_vendor.d",
"/usr/share/glvnd/egl_vendor.d/50_mesa.json",

View file

@ -237,42 +237,10 @@ constexpr const char kPrefDoNotSync[] = "do_not_sync";
// that need to be synced. Default value is false.
constexpr const char kPrefNeedsSync[] = "needs_sync";
// Stores preferences corresponding to dynamic indexed ruleset for the
// Declarative Net Request API. Note: we use a separate preference key for
// dynamic rulesets instead of using the |kDNRStaticRulesetPref| dictionary.
// This is because the |kDNRStaticRulesetPref| dictionary is re-populated on
// each packed extension update and also on reloads of unpacked extensions.
// However for both of these cases, we want the dynamic ruleset preferences to
// stay unchanged. Also, this helps provide flexibility to have the dynamic
// ruleset preference schema diverge from the static one.
constexpr const char kDNRDynamicRulesetPref[] = "dnr_dynamic_ruleset";
// Key corresponding to which we store a ruleset's checksum for the Declarative
// Net Request API.
constexpr const char kDNRChecksumKey[] = "checksum";
// Key corresponding to the list of enabled static ruleset IDs for an extension.
// Used for the Declarative Net Request API.
constexpr const char kDNREnabledStaticRulesetIDs[] = "dnr_enabled_ruleset_ids";
// A boolean preference that indicates whether the extension's icon should be
// automatically badged to the matched action count for a tab. False by default.
constexpr const char kPrefDNRUseActionCountAsBadgeText[] =
"dnr_use_action_count_as_badge_text";
// A boolean that indicates if a ruleset should be ignored.
constexpr const char kDNRIgnoreRulesetKey[] = "ignore_ruleset";
// A preference that indicates the amount of rules allocated to an extension
// from the global pool.
constexpr const char kDNRExtensionRulesAllocated[] =
"dnr_extension_rules_allocated";
// A boolean that indicates if an extension should have its unused rule
// allocation kept during its next load.
constexpr const char kPrefDNRKeepExcessAllocation[] =
"dnr_keep_excess_allocation";
// The default value to use for permission withholding when setting the pref on
// installation or for extensions where the pref has not been set.
constexpr bool kDefaultWithholdingBehavior = false;
@ -499,7 +467,8 @@ void ExtensionPrefs::MakePathsRelative() {
for (const std::string& key : absolute_keys) {
std::unique_ptr<prefs::DictionaryValueUpdate> extension_dict;
if (!update_dict->GetDictionaryWithoutPathExpansion(key, &extension_dict)) {
NOTREACHED() << "Control should never reach here for extension " << key;
NOTREACHED_IN_MIGRATION()
<< "Control should never reach here for extension " << key;
continue;
}
std::string path_string;
@ -585,7 +554,7 @@ void ExtensionPrefs::UpdateExtensionPref(
std::string_view key,
std::optional<base::Value> data_value) {
if (!crx_file::id_util::IdIsValid(extension_id)) {
NOTREACHED() << "Invalid extension_id " << extension_id;
NOTREACHED_IN_MIGRATION() << "Invalid extension_id " << extension_id;
return;
}
ScopedExtensionPrefUpdate update(prefs_, extension_id);
@ -1035,23 +1004,26 @@ void ExtensionPrefs::AddDisableReasons(const ExtensionId& extension_id,
int disable_reasons) {
DCHECK(!DoesExtensionHaveState(extension_id, Extension::ENABLED) ||
blocklist_prefs::IsExtensionBlocklisted(extension_id, this));
ModifyDisableReasons(extension_id, disable_reasons, BIT_MAP_PREF_ADD);
ModifyDisableReasons(extension_id, disable_reasons,
BitMapPrefOperation::kAdd);
}
void ExtensionPrefs::RemoveDisableReason(
const ExtensionId& extension_id,
disable_reason::DisableReason disable_reason) {
ModifyDisableReasons(extension_id, disable_reason, BIT_MAP_PREF_REMOVE);
ModifyDisableReasons(extension_id, disable_reason,
BitMapPrefOperation::kRemove);
}
void ExtensionPrefs::ReplaceDisableReasons(const ExtensionId& extension_id,
int disable_reasons) {
ModifyDisableReasons(extension_id, disable_reasons, BIT_MAP_PREF_REPLACE);
ModifyDisableReasons(extension_id, disable_reasons,
BitMapPrefOperation::kReplace);
}
void ExtensionPrefs::ClearDisableReasons(const ExtensionId& extension_id) {
ModifyDisableReasons(extension_id, disable_reason::DISABLE_NONE,
BIT_MAP_PREF_CLEAR);
BitMapPrefOperation::kClear);
}
void ExtensionPrefs::ClearInapplicableDisableReasonsForComponentExtension(
@ -1068,7 +1040,7 @@ void ExtensionPrefs::ClearInapplicableDisableReasonsForComponentExtension(
ModifyDisableReasons(
component_extension_id,
allowed_disable_reasons & GetDisableReasons(component_extension_id),
BIT_MAP_PREF_REPLACE);
BitMapPrefOperation::kReplace);
}
void ExtensionPrefs::ModifyDisableReasons(const ExtensionId& extension_id,
@ -1096,16 +1068,16 @@ void ExtensionPrefs::ModifyBitMapPrefBits(const ExtensionId& extension_id,
int old_value = GetBitMapPrefBits(extension_id, pref_key, default_bit);
int new_value = old_value;
switch (operation) {
case BIT_MAP_PREF_ADD:
case BitMapPrefOperation::kAdd:
new_value |= pending_bits;
break;
case BIT_MAP_PREF_REMOVE:
case BitMapPrefOperation::kRemove:
new_value &= ~pending_bits;
break;
case BIT_MAP_PREF_REPLACE:
case BitMapPrefOperation::kReplace:
new_value = pending_bits;
break;
case BIT_MAP_PREF_CLEAR:
case BitMapPrefOperation::kClear:
new_value = pending_bits;
break;
}
@ -1122,7 +1094,10 @@ void ExtensionPrefs::ModifyBitMapPrefBits(const ExtensionId& extension_id,
base::Time ExtensionPrefs::LastPingDay(const ExtensionId& extension_id) const {
DCHECK(crx_file::id_util::IdIsValid(extension_id));
return ReadTime(GetExtensionPref(extension_id), kLastPingDay);
static constexpr PrefMap kMap = {kLastPingDay, PrefType::kTime,
PrefScope::kExtensionSpecific};
return ReadPrefAsTime(extension_id, kMap);
}
void ExtensionPrefs::SetLastPingDay(const ExtensionId& extension_id,
@ -1144,7 +1119,10 @@ void ExtensionPrefs::SetBlocklistLastPingDay(const base::Time& time) {
base::Time ExtensionPrefs::LastActivePingDay(
const ExtensionId& extension_id) const {
DCHECK(crx_file::id_util::IdIsValid(extension_id));
return ReadTime(GetExtensionPref(extension_id), kLastActivePingDay);
static constexpr PrefMap kMap = {kLastActivePingDay, PrefType::kTime,
PrefScope::kExtensionSpecific};
return ReadPrefAsTime(extension_id, kMap);
}
void ExtensionPrefs::SetLastActivePingDay(const ExtensionId& extension_id,
@ -1364,7 +1342,7 @@ void ExtensionPrefs::OnExtensionInstalled(
const syncer::StringOrdinal& page_ordinal,
int install_flags,
const std::string& install_parameter,
const declarative_net_request::RulesetInstallPrefs& ruleset_install_prefs) {
base::Value::Dict ruleset_install_prefs) {
// If the extension was previously an external extension that was uninstalled,
// clear the external uninstall bit.
// TODO(devlin): We previously did this because we indicated external
@ -1385,7 +1363,7 @@ void ExtensionPrefs::OnExtensionInstalled(
base::Value::List prefs_to_remove;
PopulateExtensionInfoPrefs(
extension, install_time, initial_state, install_flags, install_parameter,
ruleset_install_prefs, extension_dict.get(), prefs_to_remove);
std::move(ruleset_install_prefs), extension_dict.get(), prefs_to_remove);
for (const auto& pref_to_remove : prefs_to_remove) {
extension_dict->Remove(pref_to_remove.GetString());
@ -1491,7 +1469,7 @@ std::optional<ExtensionInfo> ExtensionPrefs::GetInstalledInfoHelper(
location != ManifestLocation::kComponent &&
!Manifest::IsUnpackedLocation(location) &&
!Manifest::IsExternalLocation(location)) {
NOTREACHED();
NOTREACHED_IN_MIGRATION();
return std::nullopt;
}
@ -1586,13 +1564,13 @@ void ExtensionPrefs::SetDelayedInstallInfo(
DelayReason delay_reason,
const syncer::StringOrdinal& page_ordinal,
const std::string& install_parameter,
const declarative_net_request::RulesetInstallPrefs& ruleset_install_prefs) {
base::Value::Dict ruleset_install_prefs) {
ScopedDictionaryUpdate update(this, extension->id(), kDelayedInstallInfo);
auto extension_dict = update.Create();
base::Value::List prefs_to_remove;
PopulateExtensionInfoPrefs(
extension, clock_->Now(), initial_state, install_flags, install_parameter,
ruleset_install_prefs, extension_dict.get(), prefs_to_remove);
std::move(ruleset_install_prefs), extension_dict.get(), prefs_to_remove);
// Add transient data that is needed by FinishDelayedInstallInfo(), but
// should not be in the final extension prefs. All entries here should have
@ -1692,15 +1670,15 @@ ExtensionPrefs::DelayReason ExtensionPrefs::GetDelayedInstallReason(
const ExtensionId& extension_id) const {
const base::Value::Dict* extension_prefs = GetExtensionPref(extension_id);
if (!extension_prefs)
return DELAY_REASON_NONE;
return DelayReason::kNone;
const base::Value::Dict* ext = extension_prefs->FindDict(kDelayedInstallInfo);
if (!ext)
return DELAY_REASON_NONE;
return DelayReason::kNone;
std::optional<int> delay_reason = ext->FindInt(kDelayedInstallReason);
if (!delay_reason)
return DELAY_REASON_NONE;
return DelayReason::kNone;
return static_cast<DelayReason>(*delay_reason);
}
@ -1774,19 +1752,20 @@ bool ExtensionPrefs::WasInstalledByOem(const ExtensionId& extension_id) const {
return false;
}
base::Time ExtensionPrefs::GetTimePrefHelper(const ExtensionId& extension_id,
const char* pref_key) const {
return ReadTime(GetExtensionPref(extension_id), pref_key);
}
base::Time ExtensionPrefs::GetFirstInstallTime(
const ExtensionId& extension_id) const {
return GetTimePrefHelper(extension_id, kPrefFirstInstallTime);
static constexpr PrefMap kMap = {kPrefFirstInstallTime, PrefType::kTime,
PrefScope::kExtensionSpecific};
return ReadPrefAsTime(extension_id, kMap);
}
base::Time ExtensionPrefs::GetLastUpdateTime(
const ExtensionId& extension_id) const {
return GetTimePrefHelper(extension_id, kPrefLastUpdateTime);
static constexpr PrefMap kMap = {kPrefLastUpdateTime, PrefType::kTime,
PrefScope::kExtensionSpecific};
return ReadPrefAsTime(extension_id, kMap);
}
bool ExtensionPrefs::DoNotSync(const ExtensionId& extension_id) const {
@ -1799,7 +1778,10 @@ bool ExtensionPrefs::DoNotSync(const ExtensionId& extension_id) const {
base::Time ExtensionPrefs::GetLastLaunchTime(
const ExtensionId& extension_id) const {
return GetTimePrefHelper(extension_id, kPrefLastLaunchTime);
static constexpr PrefMap kMap = {kPrefLastLaunchTime, PrefType::kTime,
PrefScope::kExtensionSpecific};
return ReadPrefAsTime(extension_id, kMap);
}
void ExtensionPrefs::SetLastLaunchTime(const ExtensionId& extension_id,
@ -2024,26 +2006,6 @@ void ExtensionPrefs::SetInstallSignature(base::Value::Dict* signature) {
}
}
std::string ExtensionPrefs::GetInstallParam(
const ExtensionId& extension_id) const {
const base::Value::Dict* extension = GetExtensionPref(extension_id);
if (!extension) // Expected during unit testing.
return std::string();
if (const std::string* install_parameter =
extension->FindStringByDottedPath(kPrefInstallParam)) {
return *install_parameter;
}
return std::string();
}
void ExtensionPrefs::SetInstallParam(const ExtensionId& extension_id,
const std::string& install_parameter) {
UpdateExtensionPref(extension_id, kPrefInstallParam,
base::Value(install_parameter));
}
bool ExtensionPrefs::NeedsSync(const ExtensionId& extension_id) const {
return ReadPrefAsBooleanAndReturn(extension_id, kPrefNeedsSync);
}
@ -2057,139 +2019,6 @@ void ExtensionPrefs::SetNeedsSync(const ExtensionId& extension_id,
UpdateExtensionPref(extension_id, kPrefNeedsSync, std::move(value));
}
bool ExtensionPrefs::GetDNRStaticRulesetChecksum(
const ExtensionId& extension_id,
declarative_net_request::RulesetID ruleset_id,
int* checksum) const {
std::string pref =
JoinPrefs({kDNRStaticRulesetPref,
base::NumberToString(ruleset_id.value()), kDNRChecksumKey});
return ReadPrefAsInteger(extension_id, pref, checksum);
}
void ExtensionPrefs::SetDNRStaticRulesetChecksum(
const ExtensionId& extension_id,
declarative_net_request::RulesetID ruleset_id,
int checksum) {
std::string pref =
JoinPrefs({kDNRStaticRulesetPref,
base::NumberToString(ruleset_id.value()), kDNRChecksumKey});
UpdateExtensionPref(extension_id, pref, base::Value(checksum));
}
bool ExtensionPrefs::GetDNRDynamicRulesetChecksum(
const ExtensionId& extension_id,
int* checksum) const {
std::string pref = JoinPrefs({kDNRDynamicRulesetPref, kDNRChecksumKey});
return ReadPrefAsInteger(extension_id, pref, checksum);
}
void ExtensionPrefs::SetDNRDynamicRulesetChecksum(
const ExtensionId& extension_id,
int checksum) {
std::string pref = JoinPrefs({kDNRDynamicRulesetPref, kDNRChecksumKey});
UpdateExtensionPref(extension_id, pref, base::Value(checksum));
}
std::optional<std::set<declarative_net_request::RulesetID>>
ExtensionPrefs::GetDNREnabledStaticRulesets(
const ExtensionId& extension_id) const {
std::set<declarative_net_request::RulesetID> ids;
const base::Value::List* ids_value =
ReadPrefAsList(extension_id, kDNREnabledStaticRulesetIDs);
if (!ids_value)
return std::nullopt;
for (const base::Value& id_value : *ids_value) {
if (!id_value.is_int())
return std::nullopt;
ids.insert(declarative_net_request::RulesetID(id_value.GetInt()));
}
return ids;
}
void ExtensionPrefs::SetDNREnabledStaticRulesets(
const ExtensionId& extension_id,
const std::set<declarative_net_request::RulesetID>& ids) {
base::Value::List ids_list;
for (const auto& id : ids)
ids_list.Append(id.value());
UpdateExtensionPref(extension_id, kDNREnabledStaticRulesetIDs,
base::Value(std::move(ids_list)));
}
bool ExtensionPrefs::GetDNRUseActionCountAsBadgeText(
const ExtensionId& extension_id) const {
return ReadPrefAsBooleanAndReturn(extension_id,
kPrefDNRUseActionCountAsBadgeText);
}
void ExtensionPrefs::SetDNRUseActionCountAsBadgeText(
const ExtensionId& extension_id,
bool use_action_count_as_badge_text) {
UpdateExtensionPref(extension_id, kPrefDNRUseActionCountAsBadgeText,
base::Value(use_action_count_as_badge_text));
}
bool ExtensionPrefs::ShouldIgnoreDNRRuleset(
const ExtensionId& extension_id,
declarative_net_request::RulesetID ruleset_id) const {
std::string pref = JoinPrefs({kDNRStaticRulesetPref,
base::NumberToString(ruleset_id.value()),
kDNRIgnoreRulesetKey});
return ReadPrefAsBooleanAndReturn(extension_id, pref);
}
bool ExtensionPrefs::GetDNRAllocatedGlobalRuleCount(
const ExtensionId& extension_id,
size_t* rule_count) const {
int rule_count_value = -1;
if (!ReadPrefAsInteger(extension_id, kDNRExtensionRulesAllocated,
&rule_count_value)) {
return false;
}
DCHECK_GT(rule_count_value, 0);
*rule_count = static_cast<size_t>(rule_count_value);
return true;
}
void ExtensionPrefs::SetDNRAllocatedGlobalRuleCount(
const ExtensionId& extension_id,
size_t rule_count) {
DCHECK_LE(
rule_count,
static_cast<size_t>(declarative_net_request::GetGlobalStaticRuleLimit()));
// Clear the pref entry if the extension has a global allocation of 0.
std::optional<base::Value> pref_value;
if (rule_count > 0) {
pref_value = base::Value(static_cast<int>(rule_count));
}
UpdateExtensionPref(extension_id, kDNRExtensionRulesAllocated,
std::move(pref_value));
}
bool ExtensionPrefs::GetDNRKeepExcessAllocation(
const ExtensionId& extension_id) const {
return ReadPrefAsBooleanAndReturn(extension_id, kPrefDNRKeepExcessAllocation);
}
void ExtensionPrefs::SetDNRKeepExcessAllocation(const ExtensionId& extension_id,
bool keep_excess_allocation) {
// Clear the pref entry if the extension will not keep its excess global rules
// allocation.
std::optional<base::Value> pref_value;
if (keep_excess_allocation) {
pref_value = base::Value(true);
}
UpdateExtensionPref(extension_id, kPrefDNRKeepExcessAllocation,
std::move(pref_value));
}
// static
void ExtensionPrefs::SetRunAlertsInFirstRunForTest() {
g_run_alerts_in_first_run_for_testing = true;
@ -2303,6 +2132,8 @@ void ExtensionPrefs::RegisterProfilePrefs(
registry->RegisterListPref(pref_names::kExtensionInstallTypeBlocklist);
registry->RegisterBooleanPref(
kMV2DeprecationWarningAcknowledgedGloballyPref.name, false);
registry->RegisterBooleanPref(
kMV2DeprecationDisabledAcknowledgedGloballyPref.name, false);
}
template <class ExtensionIdContainer>
@ -2319,7 +2150,7 @@ bool ExtensionPrefs::GetUserExtensionPrefIntoContainer(
*id_container_out, id_container_out->end());
for (const auto& entry : user_pref_value->GetList()) {
if (!entry.is_string()) {
NOTREACHED();
NOTREACHED_IN_MIGRATION();
continue;
}
insert_iterator = entry.GetString();
@ -2345,7 +2176,7 @@ void ExtensionPrefs::PopulateExtensionInfoPrefs(
Extension::State initial_state,
int install_flags,
const std::string& install_parameter,
const declarative_net_request::RulesetInstallPrefs& ruleset_install_prefs,
base::Value::Dict ruleset_install_prefs,
prefs::DictionaryValueUpdate* extension_dict,
base::Value::List& removed_prefs) {
extension_dict->SetInteger(kPrefState, initial_state);
@ -2380,23 +2211,8 @@ void ExtensionPrefs::PopulateExtensionInfoPrefs(
if (ruleset_install_prefs.empty()) {
removed_prefs.Append(kDNRStaticRulesetPref);
} else {
base::Value::Dict ruleset_prefs;
for (const declarative_net_request::RulesetInstallPref& install_pref :
ruleset_install_prefs) {
std::string id_key =
base::NumberToString(install_pref.ruleset_id.value());
base::Value::Dict ruleset_dict;
ruleset_dict.Set(kDNRIgnoreRulesetKey, install_pref.ignored);
if (install_pref.checksum)
ruleset_dict.Set(kDNRChecksumKey, *install_pref.checksum);
DCHECK(!ruleset_prefs.Find(id_key));
ruleset_prefs.Set(id_key, std::move(ruleset_dict));
}
extension_dict->SetDictionary(kDNRStaticRulesetPref,
std::move(ruleset_prefs));
std::move(ruleset_install_prefs));
}
// Clear the list of enabled static rulesets for the extension since it

View file

@ -170,7 +170,7 @@ bool ComputeExtensionID(const base::Value::Dict& manifest,
// reloading the extension.
*extension_id = crx_file::id_util::GenerateIdForPath(path);
if (extension_id->empty()) {
NOTREACHED() << "Could not create ID from path.";
NOTREACHED_IN_MIGRATION() << "Could not create ID from path.";
return false;
}
return true;

View file

@ -1,553 +0,0 @@
// Copyright 2024 The Chromium Authors and Alex313031
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "ui/base/ui_base_features.h"
#include <stdlib.h>
#include "base/command_line.h"
#include "base/feature_list.h"
#include "base/metrics/field_trial_params.h"
#include "build/build_config.h"
#include "build/chromeos_buildflags.h"
#if BUILDFLAG(IS_ANDROID)
#include "base/android/build_info.h"
#endif
#if BUILDFLAG(IS_CHROMEOS_ASH)
#include "ui/base/shortcut_mapping_pref_delegate.h"
#endif
namespace features {
#if BUILDFLAG(IS_WIN)
// If enabled, the occluded region of the HWND is supplied to WindowTracker.
BASE_FEATURE(kApplyNativeOccludedRegionToWindowTracker,
"ApplyNativeOccludedRegionToWindowTracker",
base::FEATURE_DISABLED_BY_DEFAULT);
// If enabled, calculate native window occlusion - Windows-only.
BASE_FEATURE(kCalculateNativeWinOcclusion,
"CalculateNativeWinOcclusion",
base::FEATURE_ENABLED_BY_DEFAULT);
// If enabled, listen for screen power state change and factor into the native
// window occlusion detection - Windows-only.
BASE_FEATURE(kScreenPowerListenerForNativeWinOcclusion,
"ScreenPowerListenerForNativeWinOcclusion",
base::FEATURE_ENABLED_BY_DEFAULT);
#endif // BUILDFLAG(IS_WIN)
#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_CHROMEOS_LACROS)
// Once enabled, the exact behavior is dictated by the field trial param
// name `kApplyNativeOcclusionToCompositorType`.
BASE_FEATURE(kApplyNativeOcclusionToCompositor,
"ApplyNativeOcclusionToCompositor",
#if BUILDFLAG(IS_CHROMEOS_LACROS)
base::FEATURE_ENABLED_BY_DEFAULT
#else
base::FEATURE_DISABLED_BY_DEFAULT
#endif
);
// If enabled, native window occlusion tracking will always be used, even if
// CHROME_HEADLESS is set.
BASE_FEATURE(kAlwaysTrackNativeWindowOcclusionForTest,
"AlwaysTrackNativeWindowOcclusionForTest",
base::FEATURE_DISABLED_BY_DEFAULT);
// Field trial param name for `kApplyNativeOcclusionToCompositor`.
const base::FeatureParam<std::string> kApplyNativeOcclusionToCompositorType{
&kApplyNativeOcclusionToCompositor, "type",
#if BUILDFLAG(IS_CHROMEOS_LACROS)
/*default=*/"throttle_and_release"
#else
/*default=*/""
#endif
};
// When the WindowTreeHost is occluded or hidden, resources are released and
// the compositor is hidden. See WindowTreeHost for specifics on what this
// does.
const char kApplyNativeOcclusionToCompositorTypeRelease[] = "release";
// When the WindowTreeHost is occluded the frame rate is throttled.
const char kApplyNativeOcclusionToCompositorTypeThrottle[] = "throttle";
// Release when hidden, throttle when occluded.
const char kApplyNativeOcclusionToCompositorTypeThrottleAndRelease[] =
"throttle_and_release";
#endif // BUILDFLAG(IS_WIN) || BUILDFLAG(IS_CHROMEOS_LACROS)
#if BUILDFLAG(IS_CHROMEOS_ASH)
// Integrate input method specific settings to Chrome OS settings page.
// https://crbug.com/895886.
BASE_FEATURE(kSettingsShowsPerKeyboardSettings,
"InputMethodIntegratedSettings",
base::FEATURE_DISABLED_BY_DEFAULT);
BASE_FEATURE(kDeprecateAltClick,
"DeprecateAltClick",
base::FEATURE_DISABLED_BY_DEFAULT);
bool IsDeprecateAltClickEnabled() {
return base::FeatureList::IsEnabled(kDeprecateAltClick);
}
BASE_FEATURE(kNotificationsIgnoreRequireInteraction,
"NotificationsIgnoreRequireInteraction",
base::FEATURE_ENABLED_BY_DEFAULT);
bool IsNotificationsIgnoreRequireInteractionEnabled() {
return base::FeatureList::IsEnabled(kNotificationsIgnoreRequireInteraction);
}
BASE_FEATURE(kShortcutCustomization,
"ShortcutCustomization",
base::FEATURE_ENABLED_BY_DEFAULT);
bool IsShortcutCustomizationEnabled() {
return base::FeatureList::IsEnabled(kShortcutCustomization);
}
// Share the resource file with ash-chrome. This feature reduces the memory
// consumption while the disk usage slightly increases.
// https://crbug.com/1253280.
BASE_FEATURE(kLacrosResourcesFileSharing,
"LacrosResourcesFileSharing",
base::FEATURE_DISABLED_BY_DEFAULT);
// Enables settings that allow users to remap the F11 and F12 keys in the
// "Customize keyboard keys" page.
BASE_FEATURE(kSupportF11AndF12KeyShortcuts,
"SupportF11AndF12KeyShortcuts",
base::FEATURE_ENABLED_BY_DEFAULT);
bool AreF11AndF12ShortcutsEnabled() {
// TODO(crbug.com/40203434): Remove this once kDeviceI18nShortcutsEnabled
// policy is deprecated. This policy allows managed users to still be able to
// use deprecated legacy shortcuts which some enterprise customers rely on.
if (::ui::ShortcutMappingPrefDelegate::IsInitialized()) {
::ui::ShortcutMappingPrefDelegate* instance =
::ui::ShortcutMappingPrefDelegate::GetInstance();
if (instance && instance->IsDeviceEnterpriseManaged()) {
return instance->IsI18nShortcutPrefEnabled() &&
base::FeatureList::IsEnabled(
features::kSupportF11AndF12KeyShortcuts);
}
}
return base::FeatureList::IsEnabled(features::kSupportF11AndF12KeyShortcuts);
}
#endif // BUILDFLAG(IS_CHROMEOS_ASH)
#if BUILDFLAG(IS_OZONE)
BASE_FEATURE(kOzoneBubblesUsePlatformWidgets,
"OzoneBubblesUsePlatformWidgets",
#if BUILDFLAG(IS_CHROMEOS_LACROS)
base::FEATURE_ENABLED_BY_DEFAULT
#else
base::FEATURE_DISABLED_BY_DEFAULT
#endif
);
#endif // BUILDFLAG(IS_OZONE)
// Update of the virtual keyboard settings UI as described in
// https://crbug.com/876901.
BASE_FEATURE(kInputMethodSettingsUiUpdate,
"InputMethodSettingsUiUpdate",
base::FEATURE_DISABLED_BY_DEFAULT);
// Enables percent-based scrolling for mousewheel and keyboard initiated
// scrolls and impulse curve animations.
const enum base::FeatureState kWindowsScrollingPersonalityDefaultStatus =
base::FEATURE_DISABLED_BY_DEFAULT;
static_assert(!BUILDFLAG(IS_MAC) ||
(BUILDFLAG(IS_MAC) &&
kWindowsScrollingPersonalityDefaultStatus ==
base::FEATURE_DISABLED_BY_DEFAULT),
"Do not enable this on the Mac. The animation does not match the "
"system scroll animation curve to such an extent that it makes "
"Chromium stand out in a bad way.");
BASE_FEATURE(kWindowsScrollingPersonality,
"WindowsScrollingPersonality",
kWindowsScrollingPersonalityDefaultStatus);
bool IsPercentBasedScrollingEnabled() {
return base::FeatureList::IsEnabled(features::kWindowsScrollingPersonality);
}
// Uses a stylus-specific tap slop region parameter for gestures. Stylus taps
// tend to slip more than touch taps (presumably because the user doesn't feel
// the movement friction with a stylus). As a result, it is harder to tap with
// a stylus. This feature makes the slop region for stylus input bigger than the
// touch slop.
BASE_FEATURE(kStylusSpecificTapSlop,
"StylusSpecificTapSlop",
base::FEATURE_ENABLED_BY_DEFAULT);
// Allows system caption style for WebVTT Captions.
BASE_FEATURE(kSystemCaptionStyle,
"SystemCaptionStyle",
base::FEATURE_ENABLED_BY_DEFAULT);
// When enabled, the feature will query the OS for a default cursor size,
// to be used in determining the concrete object size of a custom cursor in
// blink. Currently enabled by default on Windows only.
// TODO(crbug.com/40845719) - Implement for other platforms.
BASE_FEATURE(kSystemCursorSizeSupported,
"SystemCursorSizeSupported",
#if BUILDFLAG(IS_WIN)
base::FEATURE_ENABLED_BY_DEFAULT
#else
base::FEATURE_DISABLED_BY_DEFAULT
#endif
);
bool IsSystemCursorSizeSupported() {
return base::FeatureList::IsEnabled(kSystemCursorSizeSupported);
}
// Allows system keyboard event capture via the keyboard lock API.
BASE_FEATURE(kSystemKeyboardLock,
"SystemKeyboardLock",
base::FEATURE_ENABLED_BY_DEFAULT);
// Enables GPU rasterization for all UI drawing (where not blocklisted).
BASE_FEATURE(kUiGpuRasterization,
"UiGpuRasterization",
#if BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_CHROMEOS_ASH) || \
BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_CHROMEOS_LACROS)
base::FEATURE_ENABLED_BY_DEFAULT
#else
base::FEATURE_DISABLED_BY_DEFAULT
#endif
);
bool IsUiGpuRasterizationEnabled() {
return base::FeatureList::IsEnabled(kUiGpuRasterization);
}
// Enables scrolling with layers under ui using the ui::Compositor.
BASE_FEATURE(kUiCompositorScrollWithLayers,
"UiCompositorScrollWithLayers",
// TODO(crbug.com/40471184): Use composited scrolling on all platforms.
#if BUILDFLAG(IS_APPLE)
base::FEATURE_ENABLED_BY_DEFAULT
#else
base::FEATURE_DISABLED_BY_DEFAULT
#endif
);
// Enables the use of a touch fling curve that is based on the behavior of
// native apps on Windows.
BASE_FEATURE(kExperimentalFlingAnimation,
"ExperimentalFlingAnimation",
// TODO(crbug.com/40118868): Revisit the macro expression once build flag switch
// of lacros-chrome is complete.
#if BUILDFLAG(IS_WIN) || \
(BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_CHROMEOS_ASH) && \
!BUILDFLAG(IS_CHROMEOS_LACROS))
base::FEATURE_ENABLED_BY_DEFAULT
#else
base::FEATURE_DISABLED_BY_DEFAULT
#endif
);
#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_WIN)
// Cached in Java as well, make sure defaults are updated together.
BASE_FEATURE(kElasticOverscroll,
"ElasticOverscroll",
#if BUILDFLAG(IS_ANDROID)
base::FEATURE_ENABLED_BY_DEFAULT
#else // BUILDFLAG(IS_ANDROID)
base::FEATURE_DISABLED_BY_DEFAULT
#endif
);
#endif // BUILDFLAG(IS_WIN) || BUILDFLAG(IS_ANDROID)
// Enables focus follow follow cursor (sloppyfocus).
BASE_FEATURE(kFocusFollowsCursor,
"FocusFollowsCursor",
base::FEATURE_DISABLED_BY_DEFAULT);
#if BUILDFLAG(IS_WIN)
// Enables using WM_POINTER instead of WM_TOUCH for touch events.
BASE_FEATURE(kPointerEventsForTouch,
"PointerEventsForTouch",
base::FEATURE_ENABLED_BY_DEFAULT);
bool IsUsingWMPointerForTouch() {
return base::FeatureList::IsEnabled(kPointerEventsForTouch);
}
#endif // BUILDFLAG(IS_WIN)
#if BUILDFLAG(IS_CHROMEOS)
// This feature supersedes kNewShortcutMapping.
BASE_FEATURE(kImprovedKeyboardShortcuts,
"ImprovedKeyboardShortcuts",
base::FEATURE_ENABLED_BY_DEFAULT);
bool IsImprovedKeyboardShortcutsEnabled() {
#if BUILDFLAG(IS_CHROMEOS_ASH)
// TODO(crbug.com/40203434): Remove this once kDeviceI18nShortcutsEnabled
// policy is deprecated.
if (::ui::ShortcutMappingPrefDelegate::IsInitialized()) {
::ui::ShortcutMappingPrefDelegate* instance =
::ui::ShortcutMappingPrefDelegate::GetInstance();
if (instance && instance->IsDeviceEnterpriseManaged()) {
return instance->IsI18nShortcutPrefEnabled();
}
}
#endif // BUILDFLAG(IS_CHROMEOS_ASH)
return base::FeatureList::IsEnabled(kImprovedKeyboardShortcuts);
}
#endif // BUILDFLAG(IS_CHROMEOS)
// Whether to enable new touch text editing features such as extra touch
// selection gestures and quick menu options. Planning to release for ChromeOS
// first, then possibly also enable some parts for other platforms later.
// TODO(b/262297017): Clean up after touch text editing redesign ships.
BASE_FEATURE(kTouchTextEditingRedesign,
"TouchTextEditingRedesign",
#if BUILDFLAG(IS_CHROMEOS)
base::FEATURE_ENABLED_BY_DEFAULT
#else
base::FEATURE_DISABLED_BY_DEFAULT
#endif
);
bool IsTouchTextEditingRedesignEnabled() {
return base::FeatureList::IsEnabled(kTouchTextEditingRedesign);
}
// Enables forced colors mode for web content.
BASE_FEATURE(kForcedColors, "ForcedColors", base::FEATURE_ENABLED_BY_DEFAULT);
bool IsForcedColorsEnabled() {
static const bool forced_colors_enabled =
base::FeatureList::IsEnabled(features::kForcedColors);
return forced_colors_enabled;
}
// Enables the eye-dropper in the refresh color-picker for Windows, Mac
// and Linux. This feature will be released for other platforms in later
// milestones.
BASE_FEATURE(kEyeDropper,
"EyeDropper",
#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \
BUILDFLAG(IS_CHROMEOS)
base::FEATURE_ENABLED_BY_DEFAULT
#else
base::FEATURE_DISABLED_BY_DEFAULT
#endif
);
const char kEyeDropperNotSupported[] = "eye-dropper-not-supported";
bool IsEyeDropperEnabled() {
return base::FeatureList::IsEnabled(features::kEyeDropper) &&
!base::CommandLine::ForCurrentProcess()->HasSwitch(
kEyeDropperNotSupported);
}
// Used to enable keyboard accessible tooltips in in-page content
// (i.e., inside Blink). See
// ::views::features::kKeyboardAccessibleTooltipInViews for
// keyboard-accessible tooltips in Views UI.
BASE_FEATURE(kKeyboardAccessibleTooltip,
"KeyboardAccessibleTooltip",
base::FEATURE_DISABLED_BY_DEFAULT);
bool IsKeyboardAccessibleTooltipEnabled() {
static const bool keyboard_accessible_tooltip_enabled =
base::FeatureList::IsEnabled(features::kKeyboardAccessibleTooltip);
return keyboard_accessible_tooltip_enabled;
}
// Enables trackpad gestures to dismiss notifications. Also, updates gestures to
// only dismiss notifications when swiping towards the notification center.
// TODO(https://b/288337080): Remove this flag once the feature is ready.
BASE_FEATURE(kNotificationGesturesUpdate,
"NotificationGesturesUpdate",
base::FEATURE_ENABLED_BY_DEFAULT);
bool IsNotificationGesturesUpdateEnabled() {
return base::FeatureList::IsEnabled(kNotificationGesturesUpdate);
}
BASE_FEATURE(kSynchronousPageFlipTesting,
"SynchronousPageFlipTesting",
base::FEATURE_ENABLED_BY_DEFAULT);
bool IsSynchronousPageFlipTestingEnabled() {
return base::FeatureList::IsEnabled(kSynchronousPageFlipTesting);
}
BASE_FEATURE(kResamplingScrollEventsExperimentalPrediction,
"ResamplingScrollEventsExperimentalPrediction",
base::FEATURE_DISABLED_BY_DEFAULT);
const char kPredictorNameLsq[] = "lsq";
const char kPredictorNameKalman[] = "kalman";
const char kPredictorNameLinearFirst[] = "linear_first";
const char kPredictorNameLinearSecond[] = "linear_second";
const char kPredictorNameLinearResampling[] = "linear_resampling";
const char kPredictorNameEmpty[] = "empty";
const char kFilterNameEmpty[] = "empty_filter";
const char kFilterNameOneEuro[] = "one_euro_filter";
const char kPredictionTypeTimeBased[] = "time";
const char kPredictionTypeFramesBased[] = "frames";
const char kPredictionTypeDefaultTime[] = "3.3";
const char kPredictionTypeDefaultFramesRatio[] = "0.5";
BASE_FEATURE(kSwipeToMoveCursor,
"SwipeToMoveCursor",
base::FEATURE_DISABLED_BY_DEFAULT);
BASE_FEATURE(kUIDebugTools,
"ui-debug-tools",
base::FEATURE_DISABLED_BY_DEFAULT);
bool IsSwipeToMoveCursorEnabled() {
static const bool enabled =
#if BUILDFLAG(IS_ANDROID)
base::android::BuildInfo::GetInstance()->sdk_int() >=
base::android::SDK_VERSION_R;
#else
base::FeatureList::IsEnabled(kSwipeToMoveCursor) ||
IsTouchTextEditingRedesignEnabled();
#endif
return enabled;
}
// Enable raw draw for tiles.
BASE_FEATURE(kRawDraw, "RawDraw", base::FEATURE_DISABLED_BY_DEFAULT);
// Tile size = viewport size * TileSizeFactor
const base::FeatureParam<double> kRawDrawTileSizeFactor{&kRawDraw,
"TileSizeFactor", 1};
const base::FeatureParam<bool> kIsRawDrawUsingMSAA{&kRawDraw, "IsUsingMSAA",
false};
bool IsUsingRawDraw() {
return base::FeatureList::IsEnabled(kRawDraw);
}
double RawDrawTileSizeFactor() {
return kRawDrawTileSizeFactor.Get();
}
bool IsRawDrawUsingMSAA() {
return kIsRawDrawUsingMSAA.Get();
}
BASE_FEATURE(kVariableRefreshRateAvailable,
"VariableRefreshRateAvailable",
base::FEATURE_DISABLED_BY_DEFAULT);
BASE_FEATURE(kEnableVariableRefreshRate,
"EnableVariableRefreshRate",
base::FEATURE_DISABLED_BY_DEFAULT);
BASE_FEATURE(kVariableRefreshRateDefaultEnabled,
"VariableRefreshRateDefaultEnabled",
base::FEATURE_DISABLED_BY_DEFAULT);
// This param indicates whether to ignore the VRR availability flag. It is set
// to false by Finch for non-forced groups.
const base::FeatureParam<bool> kVrrIgnoreAvailability{
&kEnableVariableRefreshRate, /*name=*/"ignore-availability",
/*default_value=*/true};
bool IsVariableRefreshRateEnabled() {
if (base::FeatureList::IsEnabled(kEnableVariableRefreshRateAlwaysOn)) {
return true;
}
// Special default case for devices with |kVariableRefreshRateDefaultEnabled|
// set. Requires |kVariableRefreshRateAvailable| to also be set. We also check
// if the FeatureList exists as it can be null during the ASSERT_DEATH
// handling.
// TODO(b/310666603): Remove after VRR is enabled-by-default for all hardware.
if (!(base::FeatureList::GetInstance() &&
base::FeatureList::GetInstance()->IsFeatureOverridden(
kEnableVariableRefreshRate.name)) &&
base::FeatureList::IsEnabled(kVariableRefreshRateDefaultEnabled) &&
base::FeatureList::IsEnabled(kVariableRefreshRateAvailable)) {
return true;
}
if (base::FeatureList::IsEnabled(kEnableVariableRefreshRate)) {
return kVrrIgnoreAvailability.Get() ||
base::FeatureList::IsEnabled(kVariableRefreshRateAvailable);
}
return false;
}
BASE_FEATURE(kEnableVariableRefreshRateAlwaysOn,
"EnableVariableRefreshRateAlwaysOn",
base::FEATURE_DISABLED_BY_DEFAULT);
bool IsVariableRefreshRateAlwaysOn() {
return base::FeatureList::IsEnabled(kEnableVariableRefreshRateAlwaysOn);
}
// Enables chrome color management wayland protocol for lacros.
BASE_FEATURE(kLacrosColorManagement,
"LacrosColorManagement",
base::FEATURE_ENABLED_BY_DEFAULT);
bool IsLacrosColorManagementEnabled() {
return base::FeatureList::IsEnabled(kLacrosColorManagement);
}
BASE_FEATURE(kChromeRefresh2023,
"ChromeRefresh2023",
base::FEATURE_ENABLED_BY_DEFAULT);
BASE_FEATURE(kChromeRefreshSecondary2023,
"ChromeRefreshSecondary2023",
base::FEATURE_ENABLED_BY_DEFAULT);
BASE_FEATURE(kThorium2024,
"Thorium2024",
base::FEATURE_DISABLED_BY_DEFAULT);
bool IsChromeRefresh2023() {
return base::FeatureList::IsEnabled(kChromeRefresh2023) ||
base::FeatureList::IsEnabled(kChromeRefreshSecondary2023);
}
bool IsChromeWebuiRefresh2023() {
return IsChromeRefresh2023() &&
base::FeatureList::IsEnabled(kChromeRefreshSecondary2023);
}
bool IsThorium2024() {
return IsChromeRefresh2023() &&
base::FeatureList::IsEnabled(kThorium2024);
}
BASE_FEATURE(kBubbleMetricsApi,
"BubbleMetricsApi",
base::FEATURE_DISABLED_BY_DEFAULT);
#if BUILDFLAG(IS_APPLE)
// Font Smoothing was enabled by default prior to introducing this feature.
// We want to experiment with disabling it to align with CR2023 designs.
BASE_FEATURE(kCr2023MacFontSmoothing,
"Cr2023MacFontSmoothing",
base::FEATURE_ENABLED_BY_DEFAULT);
#endif // BUILDFLAG(IS_APPLE)
#if BUILDFLAG(IS_WIN)
BASE_FEATURE(kUseGammaContrastRegistrySettings,
"UseGammaContrastRegistrySettings",
base::FEATURE_ENABLED_BY_DEFAULT);
#endif // BUILDFLAG(IS_WIN)
BASE_FEATURE(kBubbleFrameViewTitleIsHeading,
"BubbleFrameViewTitleIsHeading",
base::FEATURE_ENABLED_BY_DEFAULT);
} // namespace features

View file

@ -1,266 +0,0 @@
// Copyright 2024 The Chromium Authors and Alex313031
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef UI_BASE_UI_BASE_FEATURES_H_
#define UI_BASE_UI_BASE_FEATURES_H_
#include "base/component_export.h"
#include "base/feature_list.h"
#include "base/metrics/field_trial_params.h"
#include "build/build_config.h"
#include "build/chromeos_buildflags.h"
#include "ui/base/buildflags.h"
namespace features {
// Keep sorted!
COMPONENT_EXPORT(UI_BASE_FEATURES)
BASE_DECLARE_FEATURE(kExperimentalFlingAnimation);
COMPONENT_EXPORT(UI_BASE_FEATURES) BASE_DECLARE_FEATURE(kFocusFollowsCursor);
#if BUILDFLAG(IS_CHROMEOS_ASH)
COMPONENT_EXPORT(UI_BASE_FEATURES)
BASE_DECLARE_FEATURE(kSettingsShowsPerKeyboardSettings);
#endif // BUILDFLAG(IS_CHROMEOS_ASH)
COMPONENT_EXPORT(UI_BASE_FEATURES)
BASE_DECLARE_FEATURE(kInputMethodSettingsUiUpdate);
COMPONENT_EXPORT(UI_BASE_FEATURES)
BASE_DECLARE_FEATURE(kWindowsScrollingPersonality);
COMPONENT_EXPORT(UI_BASE_FEATURES) bool IsPercentBasedScrollingEnabled();
COMPONENT_EXPORT(UI_BASE_FEATURES) BASE_DECLARE_FEATURE(kSystemCaptionStyle);
COMPONENT_EXPORT(UI_BASE_FEATURES) BASE_DECLARE_FEATURE(kSystemKeyboardLock);
COMPONENT_EXPORT(UI_BASE_FEATURES)
BASE_DECLARE_FEATURE(kUiCompositorScrollWithLayers);
COMPONENT_EXPORT(UI_BASE_FEATURES) bool IsUiGpuRasterizationEnabled();
#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_ANDROID)
COMPONENT_EXPORT(UI_BASE_FEATURES) BASE_DECLARE_FEATURE(kElasticOverscroll);
#endif // BUILDFLAG(IS_WIN) || BUILDFLAG(IS_ANDROID)
#if BUILDFLAG(IS_WIN)
COMPONENT_EXPORT(UI_BASE_FEATURES)
BASE_DECLARE_FEATURE(kApplyNativeOccludedRegionToWindowTracker);
COMPONENT_EXPORT(UI_BASE_FEATURES)
BASE_DECLARE_FEATURE(kCalculateNativeWinOcclusion);
COMPONENT_EXPORT(UI_BASE_FEATURES) BASE_DECLARE_FEATURE(kPointerEventsForTouch);
COMPONENT_EXPORT(UI_BASE_FEATURES)
BASE_DECLARE_FEATURE(kScreenPowerListenerForNativeWinOcclusion);
// Returns true if the system should use WM_POINTER events for touch events.
COMPONENT_EXPORT(UI_BASE_FEATURES) bool IsUsingWMPointerForTouch();
#endif // BUILDFLAG(IS_WIN)
#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_CHROMEOS_LACROS)
COMPONENT_EXPORT(UI_BASE_FEATURES)
BASE_DECLARE_FEATURE(kApplyNativeOcclusionToCompositor);
COMPONENT_EXPORT(UI_BASE_FEATURES)
BASE_DECLARE_FEATURE(kAlwaysTrackNativeWindowOcclusionForTest);
COMPONENT_EXPORT(UI_BASE_FEATURES)
extern const base::FeatureParam<std::string>
kApplyNativeOcclusionToCompositorType;
COMPONENT_EXPORT(UI_BASE_FEATURES)
extern const char kApplyNativeOcclusionToCompositorTypeRelease[];
COMPONENT_EXPORT(UI_BASE_FEATURES)
extern const char kApplyNativeOcclusionToCompositorTypeThrottle[];
COMPONENT_EXPORT(UI_BASE_FEATURES)
extern const char kApplyNativeOcclusionToCompositorTypeThrottleAndRelease[];
#endif // BUILDFLAG(IS_WIN) || BUILDFLAG(IS_CHROMEOS_LACROS)
#if BUILDFLAG(IS_CHROMEOS)
COMPONENT_EXPORT(UI_BASE_FEATURES)
BASE_DECLARE_FEATURE(kImprovedKeyboardShortcuts);
COMPONENT_EXPORT(UI_BASE_FEATURES)
bool IsImprovedKeyboardShortcutsEnabled();
#endif // BUILDFLAG(IS_CHROMEOS)
COMPONENT_EXPORT(UI_BASE_FEATURES)
BASE_DECLARE_FEATURE(kTouchTextEditingRedesign);
COMPONENT_EXPORT(UI_BASE_FEATURES)
bool IsTouchTextEditingRedesignEnabled();
// Used to enable forced colors mode for web content.
COMPONENT_EXPORT(UI_BASE_FEATURES) BASE_DECLARE_FEATURE(kForcedColors);
COMPONENT_EXPORT(UI_BASE_FEATURES) bool IsForcedColorsEnabled();
// Used to enable the eye-dropper in the refresh color-picker.
COMPONENT_EXPORT(UI_BASE_FEATURES) BASE_DECLARE_FEATURE(kEyeDropper);
// TODO(https://crbug.com/329678163): This flag should be removed.
COMPONENT_EXPORT(UI_BASE_FEATURES) extern const char kEyeDropperNotSupported[];
COMPONENT_EXPORT(UI_BASE_FEATURES) bool IsEyeDropperEnabled();
COMPONENT_EXPORT(UI_BASE_FEATURES)
BASE_DECLARE_FEATURE(kSystemCursorSizeSupported);
COMPONENT_EXPORT(UI_BASE_FEATURES) bool IsSystemCursorSizeSupported();
// Used to enable keyboard accessible tooltips in in-page content
// (i.e., inside Blink). See
// ::views::features::kKeyboardAccessibleTooltipInViews for
// keyboard-accessible tooltips in Views UI.
COMPONENT_EXPORT(UI_BASE_FEATURES)
BASE_DECLARE_FEATURE(kKeyboardAccessibleTooltip);
COMPONENT_EXPORT(UI_BASE_FEATURES) bool IsKeyboardAccessibleTooltipEnabled();
// Used to enable gesture changes for notifications.
COMPONENT_EXPORT(UI_BASE_FEATURES)
BASE_DECLARE_FEATURE(kNotificationGesturesUpdate);
COMPONENT_EXPORT(UI_BASE_FEATURES) bool IsNotificationGesturesUpdateEnabled();
#if BUILDFLAG(IS_CHROMEOS_ASH)
COMPONENT_EXPORT(UI_BASE_FEATURES) BASE_DECLARE_FEATURE(kDeprecateAltClick);
COMPONENT_EXPORT(UI_BASE_FEATURES)
bool IsDeprecateAltClickEnabled();
COMPONENT_EXPORT(UI_BASE_FEATURES)
BASE_DECLARE_FEATURE(kNotificationsIgnoreRequireInteraction);
COMPONENT_EXPORT(UI_BASE_FEATURES)
bool IsNotificationsIgnoreRequireInteractionEnabled();
COMPONENT_EXPORT(UI_BASE_FEATURES)
BASE_DECLARE_FEATURE(kShortcutCustomization);
COMPONENT_EXPORT(UI_BASE_FEATURES)
bool IsShortcutCustomizationEnabled();
COMPONENT_EXPORT(UI_BASE_FEATURES)
BASE_DECLARE_FEATURE(kLacrosResourcesFileSharing);
COMPONENT_EXPORT(UI_BASE_FEATURES)
BASE_DECLARE_FEATURE(kSupportF11AndF12KeyShortcuts);
COMPONENT_EXPORT(UI_BASE_FEATURES) bool AreF11AndF12ShortcutsEnabled();
#endif // BUILDFLAG(IS_CHROMEOS_ASH)
#if BUILDFLAG(IS_OZONE)
COMPONENT_EXPORT(UI_BASE_FEATURES)
BASE_DECLARE_FEATURE(kOzoneBubblesUsePlatformWidgets);
#endif // BUILDFLAG(IS_OZONE)
// Indicates whether DrmOverlayManager should used the synchronous API to
// perform pageflip tests.
COMPONENT_EXPORT(UI_BASE_FEATURES)
BASE_DECLARE_FEATURE(kSynchronousPageFlipTesting);
COMPONENT_EXPORT(UI_BASE_FEATURES)
bool IsSynchronousPageFlipTestingEnabled();
// The type of predictor to use for the resampling events. These values are
// used as the 'predictor' feature param for
// |blink::features::kResamplingScrollEvents|.
COMPONENT_EXPORT(UI_BASE_FEATURES) extern const char kPredictorNameLsq[];
COMPONENT_EXPORT(UI_BASE_FEATURES) extern const char kPredictorNameKalman[];
COMPONENT_EXPORT(UI_BASE_FEATURES)
extern const char kPredictorNameLinearFirst[];
COMPONENT_EXPORT(UI_BASE_FEATURES)
extern const char kPredictorNameLinearSecond[];
COMPONENT_EXPORT(UI_BASE_FEATURES)
extern const char kPredictorNameLinearResampling[];
COMPONENT_EXPORT(UI_BASE_FEATURES) extern const char kPredictorNameEmpty[];
// Enables resampling of scroll events using an experimental latency of +3.3ms
// instead of the original -5ms.
COMPONENT_EXPORT(UI_BASE_FEATURES)
BASE_DECLARE_FEATURE(kResamplingScrollEventsExperimentalPrediction);
// The type of prediction used. TimeBased uses a fixed timing, FramesBased uses
// a ratio of the vsync refresh rate. The timing/ratio can be changed on the
// command line through a `latency` param.
COMPONENT_EXPORT(UI_BASE_FEATURES) extern const char kPredictionTypeTimeBased[];
COMPONENT_EXPORT(UI_BASE_FEATURES)
extern const char kPredictionTypeFramesBased[];
// The default values for `latency`
COMPONENT_EXPORT(UI_BASE_FEATURES)
extern const char kPredictionTypeDefaultTime[];
COMPONENT_EXPORT(UI_BASE_FEATURES)
extern const char kPredictionTypeDefaultFramesRatio[];
// The type of filter to use for filtering events. These values are used as the
// 'filter' feature param for |blink::features::kFilteringScrollPrediction|.
COMPONENT_EXPORT(UI_BASE_FEATURES) extern const char kFilterNameEmpty[];
COMPONENT_EXPORT(UI_BASE_FEATURES) extern const char kFilterNameOneEuro[];
// Android only feature, for swipe to move cursor.
COMPONENT_EXPORT(UI_BASE_FEATURES) BASE_DECLARE_FEATURE(kSwipeToMoveCursor);
// Enables UI debugging tools such as shortcuts.
COMPONENT_EXPORT(UI_BASE_FEATURES) BASE_DECLARE_FEATURE(kUIDebugTools);
COMPONENT_EXPORT(UI_BASE_FEATURES) bool IsSwipeToMoveCursorEnabled();
// Enables Raw Draw.
COMPONENT_EXPORT(UI_BASE_FEATURES) BASE_DECLARE_FEATURE(kRawDraw);
COMPONENT_EXPORT(UI_BASE_FEATURES) bool IsUsingRawDraw();
COMPONENT_EXPORT(UI_BASE_FEATURES) double RawDrawTileSizeFactor();
COMPONENT_EXPORT(UI_BASE_FEATURES) bool IsRawDrawUsingMSAA();
COMPONENT_EXPORT(UI_BASE_FEATURES) BASE_DECLARE_FEATURE(kStylusSpecificTapSlop);
// This feature indicates that this device is approved for utilizing variable
// refresh rates. This flag is added by cros-config and not exposed in the
// chrome://flags UI.
COMPONENT_EXPORT(UI_BASE_FEATURES)
BASE_DECLARE_FEATURE(kVariableRefreshRateAvailable);
// Enables the variable refresh rate feature for Borealis gaming only. If this
// flag is set by Finch, it requires the availability flag to also be true. If
// this flag is overridden by the user, then the availability flag is ignored.
COMPONENT_EXPORT(UI_BASE_FEATURES)
BASE_DECLARE_FEATURE(kEnableVariableRefreshRate);
// This feature indicates that this device should have variable refresh rates
// enabled by default if available. This overrides the default value of
// |kEnableVariableRefreshRate|. This flag is added by USE and not exposed in
// the chrome://flags UI.
COMPONENT_EXPORT(UI_BASE_FEATURES)
BASE_DECLARE_FEATURE(kVariableRefreshRateDefaultEnabled);
COMPONENT_EXPORT(UI_BASE_FEATURES) bool IsVariableRefreshRateEnabled();
// Enables the variable refresh rate feature at all times.
COMPONENT_EXPORT(UI_BASE_FEATURES)
BASE_DECLARE_FEATURE(kEnableVariableRefreshRateAlwaysOn);
COMPONENT_EXPORT(UI_BASE_FEATURES) bool IsVariableRefreshRateAlwaysOn();
COMPONENT_EXPORT(UI_BASE_FEATURES) BASE_DECLARE_FEATURE(kLacrosColorManagement);
COMPONENT_EXPORT(UI_BASE_FEATURES)
bool IsLacrosColorManagementEnabled();
// Exposed for testing and flags integration. For actual checks please use
// IsChromeRefresh2023().
COMPONENT_EXPORT(UI_BASE_FEATURES) BASE_DECLARE_FEATURE(kChromeRefresh2023);
COMPONENT_EXPORT(UI_BASE_FEATURES)
BASE_DECLARE_FEATURE(kChromeRefreshSecondary2023);
COMPONENT_EXPORT(UI_BASE_FEATURES) bool IsChromeRefresh2023();
COMPONENT_EXPORT(UI_BASE_FEATURES) bool IsChromeWebuiRefresh2023();
// Used to revert some stupid UI decisions for Cr23
COMPONENT_EXPORT(UI_BASE_FEATURES) BASE_DECLARE_FEATURE(kThorium2024);
COMPONENT_EXPORT(UI_BASE_FEATURES) bool IsThorium2024();
COMPONENT_EXPORT(UI_BASE_FEATURES)
BASE_DECLARE_FEATURE(kBubbleMetricsApi);
#if BUILDFLAG(IS_APPLE)
// Font Smoothing, a CoreText technique, simulates optical sizes to enhance text
// readability at smaller scales. In practice, it leads to an increased
// perception of text weight, creating discrepancies between renderings in UX
// design tools and actual macOS displays. This feature is only effective when
// ChromeRefresh2023 is enabled.
COMPONENT_EXPORT(UI_BASE_FEATURES)
BASE_DECLARE_FEATURE(kCr2023MacFontSmoothing);
#endif // BUILDFLAG(IS_APPLE)
#if BUILDFLAG(IS_WIN)
// Use font settings for contrast and gamma as specified in system settings.
// If not set, these values fall back to the pre-defined Skia defaults.
COMPONENT_EXPORT(UI_BASE_FEATURES)
BASE_DECLARE_FEATURE(kUseGammaContrastRegistrySettings);
#endif // BUILDFLAG(IS_WIN)
COMPONENT_EXPORT(UI_BASE_FEATURES)
BASE_DECLARE_FEATURE(kBubbleFrameViewTitleIsHeading);
} // namespace features
#endif // UI_BASE_UI_BASE_FEATURES_H_