diff options
83 files changed, 457 insertions, 298 deletions
diff --git a/chrome/app/resources/locale_settings.grd b/chrome/app/resources/locale_settings.grd index bc8ccf7..2256e0f 100644 --- a/chrome/app/resources/locale_settings.grd +++ b/chrome/app/resources/locale_settings.grd @@ -243,18 +243,6 @@ en-US </message> - <!-- The width of the Options dialog box, in characters (character width = --> - <!-- average character width for default dialog box font) --> - <message name="IDS_OPTIONS_DIALOG_WIDTH_CHARS" use_name_for_id="true"> - 98 - </message> - - <!-- The height of the Options dialog box, in lines (line height = character --> - <!-- height for default dialog box font) --> - <message name="IDS_OPTIONS_DIALOG_HEIGHT_LINES" use_name_for_id="true"> - 36 - </message> - <!-- The width of the title column of the Options dialog box, in characters (see --> <!-- above for defn of character width) --> <message name="IDS_OPTIONS_DIALOG_LEFT_COLUMN_WIDTH_CHARS" use_name_for_id="true"> diff --git a/chrome/app/resources/locale_settings_am.xtb b/chrome/app/resources/locale_settings_am.xtb index d5720c8..9dd35eb3 100644 --- a/chrome/app/resources/locale_settings_am.xtb +++ b/chrome/app/resources/locale_settings_am.xtb @@ -5,8 +5,6 @@ <translation id="IDS_DEFAULT_ENCODING">ISO-8859-1</translation> <translation id="IDS_USES_UNIVERSAL_DETECTOR">false</translation> <translation id="IDS_SPELLCHECK_DICTIONARY">en-GB</translation> -<translation id="IDS_OPTIONS_DIALOG_WIDTH_CHARS">98</translation> -<translation id="IDS_OPTIONS_DIALOG_HEIGHT_LINES">36</translation> <translation id="IDS_OPTIONS_DIALOG_LEFT_COLUMN_WIDTH_CHARS">23</translation> <translation id="IDS_OPTIONS_RESET_CONFIRM_BOX_WIDTH_CHARS">80</translation> <translation id="IDS_URLPICKER_DIALOG_WIDTH_CHARS">80</translation> diff --git a/chrome/app/resources/locale_settings_ar.xtb b/chrome/app/resources/locale_settings_ar.xtb index 185561c..56d567f 100644 --- a/chrome/app/resources/locale_settings_ar.xtb +++ b/chrome/app/resources/locale_settings_ar.xtb @@ -5,8 +5,6 @@ <translation id="IDS_DEFAULT_ENCODING">windows-1256</translation> <translation id="IDS_USES_UNIVERSAL_DETECTOR">false</translation> <translation id="IDS_SPELLCHECK_DICTIONARY">en-US</translation> -<translation id="IDS_OPTIONS_DIALOG_WIDTH_CHARS">105</translation> -<translation id="IDS_OPTIONS_DIALOG_HEIGHT_LINES">39</translation> <translation id="IDS_OPTIONS_DIALOG_LEFT_COLUMN_WIDTH_CHARS">26</translation> <translation id="IDS_OPTIONS_RESET_CONFIRM_BOX_WIDTH_CHARS">80</translation> <translation id="IDS_URLPICKER_DIALOG_WIDTH_CHARS">80</translation> diff --git a/chrome/app/resources/locale_settings_bg.xtb b/chrome/app/resources/locale_settings_bg.xtb index 312ed32..d66d8c9 100644 --- a/chrome/app/resources/locale_settings_bg.xtb +++ b/chrome/app/resources/locale_settings_bg.xtb @@ -5,8 +5,6 @@ <translation id="IDS_DEFAULT_ENCODING">windows-1251</translation> <translation id="IDS_USES_UNIVERSAL_DETECTOR">false</translation> <translation id="IDS_SPELLCHECK_DICTIONARY">bg-BG</translation> -<translation id="IDS_OPTIONS_DIALOG_WIDTH_CHARS">120</translation> -<translation id="IDS_OPTIONS_DIALOG_HEIGHT_LINES">39</translation> <translation id="IDS_OPTIONS_DIALOG_LEFT_COLUMN_WIDTH_CHARS">24</translation> <translation id="IDS_OPTIONS_RESET_CONFIRM_BOX_WIDTH_CHARS">80</translation> <translation id="IDS_URLPICKER_DIALOG_WIDTH_CHARS">80</translation> diff --git a/chrome/app/resources/locale_settings_bn.xtb b/chrome/app/resources/locale_settings_bn.xtb index f6fadf9..ae611a3 100644 --- a/chrome/app/resources/locale_settings_bn.xtb +++ b/chrome/app/resources/locale_settings_bn.xtb @@ -5,8 +5,6 @@ <translation id="IDS_DEFAULT_ENCODING">ISO-8859-1</translation> <translation id="IDS_USES_UNIVERSAL_DETECTOR">false</translation> <translation id="IDS_SPELLCHECK_DICTIONARY">en-US</translation> -<translation id="IDS_OPTIONS_DIALOG_WIDTH_CHARS">98</translation> -<translation id="IDS_OPTIONS_DIALOG_HEIGHT_LINES">33</translation> <translation id="IDS_OPTIONS_DIALOG_LEFT_COLUMN_WIDTH_CHARS">26</translation> <translation id="IDS_OPTIONS_RESET_CONFIRM_BOX_WIDTH_CHARS">80</translation> <translation id="IDS_URLPICKER_DIALOG_WIDTH_CHARS">80</translation> diff --git a/chrome/app/resources/locale_settings_ca.xtb b/chrome/app/resources/locale_settings_ca.xtb index 7a24dac..4f839e6 100644 --- a/chrome/app/resources/locale_settings_ca.xtb +++ b/chrome/app/resources/locale_settings_ca.xtb @@ -5,8 +5,6 @@ <translation id="IDS_DEFAULT_ENCODING">ISO-8859-1</translation> <translation id="IDS_USES_UNIVERSAL_DETECTOR">false</translation> <translation id="IDS_SPELLCHECK_DICTIONARY">ca</translation> -<translation id="IDS_OPTIONS_DIALOG_WIDTH_CHARS">106</translation> -<translation id="IDS_OPTIONS_DIALOG_HEIGHT_LINES">40</translation> <translation id="IDS_OPTIONS_DIALOG_LEFT_COLUMN_WIDTH_CHARS">26</translation> <translation id="IDS_OPTIONS_RESET_CONFIRM_BOX_WIDTH_CHARS">80</translation> <translation id="IDS_URLPICKER_DIALOG_WIDTH_CHARS">80</translation> diff --git a/chrome/app/resources/locale_settings_cs.xtb b/chrome/app/resources/locale_settings_cs.xtb index e6c0b2e..23fb131 100644 --- a/chrome/app/resources/locale_settings_cs.xtb +++ b/chrome/app/resources/locale_settings_cs.xtb @@ -5,8 +5,6 @@ <translation id="IDS_DEFAULT_ENCODING">windows-1250</translation> <translation id="IDS_USES_UNIVERSAL_DETECTOR">false</translation> <translation id="IDS_SPELLCHECK_DICTIONARY">cs</translation> -<translation id="IDS_OPTIONS_DIALOG_WIDTH_CHARS">102</translation> -<translation id="IDS_OPTIONS_DIALOG_HEIGHT_LINES">38</translation> <translation id="IDS_OPTIONS_DIALOG_LEFT_COLUMN_WIDTH_CHARS">26</translation> <translation id="IDS_OPTIONS_RESET_CONFIRM_BOX_WIDTH_CHARS">80</translation> <translation id="IDS_URLPICKER_DIALOG_WIDTH_CHARS">80</translation> diff --git a/chrome/app/resources/locale_settings_da.xtb b/chrome/app/resources/locale_settings_da.xtb index ae1ccda..672c0e6 100644 --- a/chrome/app/resources/locale_settings_da.xtb +++ b/chrome/app/resources/locale_settings_da.xtb @@ -5,13 +5,6 @@ <translation id="IDS_DEFAULT_ENCODING">ISO-8859-1</translation> <translation id="IDS_USES_UNIVERSAL_DETECTOR">false</translation> <translation id="IDS_SPELLCHECK_DICTIONARY">da</translation> -<if expr="pp_if('chromeos')"> - <translation id="IDS_OPTIONS_DIALOG_WIDTH_CHARS">118</translation> -</if> -<if expr="not pp_if('chromeos')"> - <translation id="IDS_OPTIONS_DIALOG_WIDTH_CHARS">98</translation> -</if> -<translation id="IDS_OPTIONS_DIALOG_HEIGHT_LINES">40</translation> <translation id="IDS_OPTIONS_DIALOG_LEFT_COLUMN_WIDTH_CHARS">23</translation> <translation id="IDS_OPTIONS_RESET_CONFIRM_BOX_WIDTH_CHARS">80</translation> <translation id="IDS_URLPICKER_DIALOG_WIDTH_CHARS">80</translation> diff --git a/chrome/app/resources/locale_settings_de.xtb b/chrome/app/resources/locale_settings_de.xtb index 8f0fa3b..68ad69e 100644 --- a/chrome/app/resources/locale_settings_de.xtb +++ b/chrome/app/resources/locale_settings_de.xtb @@ -5,8 +5,6 @@ <translation id="IDS_DEFAULT_ENCODING">ISO-8859-1</translation> <translation id="IDS_USES_UNIVERSAL_DETECTOR">false</translation> <translation id="IDS_SPELLCHECK_DICTIONARY">de</translation> -<translation id="IDS_OPTIONS_DIALOG_WIDTH_CHARS">108</translation> -<translation id="IDS_OPTIONS_DIALOG_HEIGHT_LINES">40</translation> <translation id="IDS_OPTIONS_DIALOG_LEFT_COLUMN_WIDTH_CHARS">26</translation> <translation id="IDS_OPTIONS_RESET_CONFIRM_BOX_WIDTH_CHARS">80</translation> <translation id="IDS_URLPICKER_DIALOG_WIDTH_CHARS">80</translation> diff --git a/chrome/app/resources/locale_settings_el.xtb b/chrome/app/resources/locale_settings_el.xtb index 50e7e23..ce3214f 100644 --- a/chrome/app/resources/locale_settings_el.xtb +++ b/chrome/app/resources/locale_settings_el.xtb @@ -5,8 +5,6 @@ <translation id="IDS_DEFAULT_ENCODING">ISO-8859-7</translation> <translation id="IDS_USES_UNIVERSAL_DETECTOR">false</translation> <translation id="IDS_SPELLCHECK_DICTIONARY">el</translation> -<translation id="IDS_OPTIONS_DIALOG_WIDTH_CHARS">106</translation> -<translation id="IDS_OPTIONS_DIALOG_HEIGHT_LINES">41</translation> <translation id="IDS_OPTIONS_DIALOG_LEFT_COLUMN_WIDTH_CHARS">20</translation> <translation id="IDS_OPTIONS_RESET_CONFIRM_BOX_WIDTH_CHARS">80</translation> <translation id="IDS_URLPICKER_DIALOG_WIDTH_CHARS">80</translation> diff --git a/chrome/app/resources/locale_settings_en-GB.xtb b/chrome/app/resources/locale_settings_en-GB.xtb index 074849e..a879f7d 100644 --- a/chrome/app/resources/locale_settings_en-GB.xtb +++ b/chrome/app/resources/locale_settings_en-GB.xtb @@ -5,8 +5,6 @@ <translation id="IDS_DEFAULT_ENCODING">ISO-8859-1</translation> <translation id="IDS_USES_UNIVERSAL_DETECTOR">false</translation> <translation id="IDS_SPELLCHECK_DICTIONARY">en-GB</translation> -<translation id="IDS_OPTIONS_DIALOG_WIDTH_CHARS">98</translation> -<translation id="IDS_OPTIONS_DIALOG_HEIGHT_LINES">39</translation> <translation id="IDS_OPTIONS_DIALOG_LEFT_COLUMN_WIDTH_CHARS">23</translation> <translation id="IDS_OPTIONS_RESET_CONFIRM_BOX_WIDTH_CHARS">80</translation> <translation id="IDS_URLPICKER_DIALOG_WIDTH_CHARS">80</translation> diff --git a/chrome/app/resources/locale_settings_es-419.xtb b/chrome/app/resources/locale_settings_es-419.xtb index a57d6a1..deeb693 100644 --- a/chrome/app/resources/locale_settings_es-419.xtb +++ b/chrome/app/resources/locale_settings_es-419.xtb @@ -5,8 +5,6 @@ <translation id="IDS_DEFAULT_ENCODING">ISO-8859-1</translation> <translation id="IDS_USES_UNIVERSAL_DETECTOR">false</translation> <translation id="IDS_SPELLCHECK_DICTIONARY">es</translation> -<translation id="IDS_OPTIONS_DIALOG_WIDTH_CHARS">104</translation> -<translation id="IDS_OPTIONS_DIALOG_HEIGHT_LINES">40</translation> <translation id="IDS_OPTIONS_DIALOG_LEFT_COLUMN_WIDTH_CHARS">24</translation> <translation id="IDS_OPTIONS_RESET_CONFIRM_BOX_WIDTH_CHARS">80</translation> <translation id="IDS_URLPICKER_DIALOG_WIDTH_CHARS">80</translation> diff --git a/chrome/app/resources/locale_settings_es.xtb b/chrome/app/resources/locale_settings_es.xtb index 9d89f10..bcb3afa 100644 --- a/chrome/app/resources/locale_settings_es.xtb +++ b/chrome/app/resources/locale_settings_es.xtb @@ -5,8 +5,6 @@ <translation id="IDS_DEFAULT_ENCODING">ISO-8859-1</translation> <translation id="IDS_USES_UNIVERSAL_DETECTOR">false</translation> <translation id="IDS_SPELLCHECK_DICTIONARY">es</translation> -<translation id="IDS_OPTIONS_DIALOG_WIDTH_CHARS">104</translation> -<translation id="IDS_OPTIONS_DIALOG_HEIGHT_LINES">40</translation> <translation id="IDS_OPTIONS_DIALOG_LEFT_COLUMN_WIDTH_CHARS">24</translation> <translation id="IDS_OPTIONS_RESET_CONFIRM_BOX_WIDTH_CHARS">80</translation> <translation id="IDS_URLPICKER_DIALOG_WIDTH_CHARS">80</translation> diff --git a/chrome/app/resources/locale_settings_et.xtb b/chrome/app/resources/locale_settings_et.xtb index c023344..1a2bed8 100644 --- a/chrome/app/resources/locale_settings_et.xtb +++ b/chrome/app/resources/locale_settings_et.xtb @@ -5,8 +5,6 @@ <translation id="IDS_DEFAULT_ENCODING">windows-1257</translation> <translation id="IDS_USES_UNIVERSAL_DETECTOR">false</translation> <translation id="IDS_SPELLCHECK_DICTIONARY">et</translation> -<translation id="IDS_OPTIONS_DIALOG_WIDTH_CHARS">102</translation> -<translation id="IDS_OPTIONS_DIALOG_HEIGHT_LINES">39</translation> <translation id="IDS_OPTIONS_DIALOG_LEFT_COLUMN_WIDTH_CHARS">26</translation> <translation id="IDS_OPTIONS_RESET_CONFIRM_BOX_WIDTH_CHARS">80</translation> <translation id="IDS_URLPICKER_DIALOG_WIDTH_CHARS">80</translation> diff --git a/chrome/app/resources/locale_settings_fi.xtb b/chrome/app/resources/locale_settings_fi.xtb index fd25c04..96b5866 100644 --- a/chrome/app/resources/locale_settings_fi.xtb +++ b/chrome/app/resources/locale_settings_fi.xtb @@ -5,8 +5,6 @@ <translation id="IDS_DEFAULT_ENCODING">ISO-8859-1</translation> <translation id="IDS_USES_UNIVERSAL_DETECTOR">false</translation> <translation id="IDS_SPELLCHECK_DICTIONARY">en-US</translation> -<translation id="IDS_OPTIONS_DIALOG_WIDTH_CHARS">98</translation> -<translation id="IDS_OPTIONS_DIALOG_HEIGHT_LINES">40</translation> <translation id="IDS_OPTIONS_DIALOG_LEFT_COLUMN_WIDTH_CHARS">26</translation> <translation id="IDS_OPTIONS_RESET_CONFIRM_BOX_WIDTH_CHARS">80</translation> <translation id="IDS_URLPICKER_DIALOG_WIDTH_CHARS">80</translation> diff --git a/chrome/app/resources/locale_settings_fil.xtb b/chrome/app/resources/locale_settings_fil.xtb index 17f2568..fabcb7d 100644 --- a/chrome/app/resources/locale_settings_fil.xtb +++ b/chrome/app/resources/locale_settings_fil.xtb @@ -5,8 +5,6 @@ <translation id="IDS_DEFAULT_ENCODING">ISO-8859-1</translation> <translation id="IDS_USES_UNIVERSAL_DETECTOR">false</translation> <translation id="IDS_SPELLCHECK_DICTIONARY">en-US</translation> -<translation id="IDS_OPTIONS_DIALOG_WIDTH_CHARS">106</translation> -<translation id="IDS_OPTIONS_DIALOG_HEIGHT_LINES">41</translation> <translation id="IDS_OPTIONS_DIALOG_LEFT_COLUMN_WIDTH_CHARS">26</translation> <translation id="IDS_OPTIONS_RESET_CONFIRM_BOX_WIDTH_CHARS">80</translation> <translation id="IDS_URLPICKER_DIALOG_WIDTH_CHARS">80</translation> diff --git a/chrome/app/resources/locale_settings_fr.xtb b/chrome/app/resources/locale_settings_fr.xtb index ac86bf0..0d4cc13 100644 --- a/chrome/app/resources/locale_settings_fr.xtb +++ b/chrome/app/resources/locale_settings_fr.xtb @@ -5,8 +5,6 @@ <translation id="IDS_DEFAULT_ENCODING">ISO-8859-1</translation> <translation id="IDS_USES_UNIVERSAL_DETECTOR">false</translation> <translation id="IDS_SPELLCHECK_DICTIONARY">fr</translation> -<translation id="IDS_OPTIONS_DIALOG_WIDTH_CHARS">112</translation> -<translation id="IDS_OPTIONS_DIALOG_HEIGHT_LINES">39</translation> <translation id="IDS_OPTIONS_DIALOG_LEFT_COLUMN_WIDTH_CHARS">24</translation> <translation id="IDS_OPTIONS_RESET_CONFIRM_BOX_WIDTH_CHARS">80</translation> <translation id="IDS_URLPICKER_DIALOG_WIDTH_CHARS">80</translation> diff --git a/chrome/app/resources/locale_settings_gu.xtb b/chrome/app/resources/locale_settings_gu.xtb index 66b719d..909f704 100644 --- a/chrome/app/resources/locale_settings_gu.xtb +++ b/chrome/app/resources/locale_settings_gu.xtb @@ -5,8 +5,6 @@ <translation id="IDS_DEFAULT_ENCODING">ISO-8859-1</translation> <translation id="IDS_USES_UNIVERSAL_DETECTOR">false</translation> <translation id="IDS_SPELLCHECK_DICTIONARY">en-US</translation> -<translation id="IDS_OPTIONS_DIALOG_WIDTH_CHARS">102</translation> -<translation id="IDS_OPTIONS_DIALOG_HEIGHT_LINES">39</translation> <translation id="IDS_OPTIONS_DIALOG_LEFT_COLUMN_WIDTH_CHARS">26</translation> <translation id="IDS_OPTIONS_RESET_CONFIRM_BOX_WIDTH_CHARS">80</translation> <translation id="IDS_URLPICKER_DIALOG_WIDTH_CHARS">80</translation> diff --git a/chrome/app/resources/locale_settings_he.xtb b/chrome/app/resources/locale_settings_he.xtb index a832f7f..2ddc8a8 100644 --- a/chrome/app/resources/locale_settings_he.xtb +++ b/chrome/app/resources/locale_settings_he.xtb @@ -5,8 +5,6 @@ <translation id="IDS_DEFAULT_ENCODING">windows-1255</translation> <translation id="IDS_USES_UNIVERSAL_DETECTOR">true</translation> <translation id="IDS_SPELLCHECK_DICTIONARY">he</translation> -<translation id="IDS_OPTIONS_DIALOG_WIDTH_CHARS">98</translation> -<translation id="IDS_OPTIONS_DIALOG_HEIGHT_LINES">40</translation> <translation id="IDS_OPTIONS_DIALOG_LEFT_COLUMN_WIDTH_CHARS">25</translation> <translation id="IDS_OPTIONS_RESET_CONFIRM_BOX_WIDTH_CHARS">80</translation> <translation id="IDS_URLPICKER_DIALOG_WIDTH_CHARS">80</translation> diff --git a/chrome/app/resources/locale_settings_hi.xtb b/chrome/app/resources/locale_settings_hi.xtb index 79b98a7..bb26525 100644 --- a/chrome/app/resources/locale_settings_hi.xtb +++ b/chrome/app/resources/locale_settings_hi.xtb @@ -5,8 +5,6 @@ <translation id="IDS_DEFAULT_ENCODING">ISO-8859-1</translation> <translation id="IDS_USES_UNIVERSAL_DETECTOR">false</translation> <translation id="IDS_SPELLCHECK_DICTIONARY">hi</translation> -<translation id="IDS_OPTIONS_DIALOG_WIDTH_CHARS">98</translation> -<translation id="IDS_OPTIONS_DIALOG_HEIGHT_LINES">34</translation> <translation id="IDS_OPTIONS_DIALOG_LEFT_COLUMN_WIDTH_CHARS">26</translation> <translation id="IDS_OPTIONS_RESET_CONFIRM_BOX_WIDTH_CHARS">80</translation> <translation id="IDS_URLPICKER_DIALOG_WIDTH_CHARS">80</translation> diff --git a/chrome/app/resources/locale_settings_hr.xtb b/chrome/app/resources/locale_settings_hr.xtb index c581fd0..e4c9aa2 100644 --- a/chrome/app/resources/locale_settings_hr.xtb +++ b/chrome/app/resources/locale_settings_hr.xtb @@ -5,8 +5,6 @@ <translation id="IDS_DEFAULT_ENCODING">windows-1250</translation> <translation id="IDS_USES_UNIVERSAL_DETECTOR">false</translation> <translation id="IDS_SPELLCHECK_DICTIONARY">hr</translation> -<translation id="IDS_OPTIONS_DIALOG_WIDTH_CHARS">102</translation> -<translation id="IDS_OPTIONS_DIALOG_HEIGHT_LINES">38</translation> <translation id="IDS_OPTIONS_DIALOG_LEFT_COLUMN_WIDTH_CHARS">26</translation> <translation id="IDS_OPTIONS_RESET_CONFIRM_BOX_WIDTH_CHARS">80</translation> <translation id="IDS_URLPICKER_DIALOG_WIDTH_CHARS">80</translation> diff --git a/chrome/app/resources/locale_settings_hu.xtb b/chrome/app/resources/locale_settings_hu.xtb index de89fc7..2cf74f8 100644 --- a/chrome/app/resources/locale_settings_hu.xtb +++ b/chrome/app/resources/locale_settings_hu.xtb @@ -5,8 +5,6 @@ <translation id="IDS_DEFAULT_ENCODING">ISO-8859-2</translation> <translation id="IDS_USES_UNIVERSAL_DETECTOR">false</translation> <translation id="IDS_SPELLCHECK_DICTIONARY">hu-HU</translation> -<translation id="IDS_OPTIONS_DIALOG_WIDTH_CHARS">106</translation> -<translation id="IDS_OPTIONS_DIALOG_HEIGHT_LINES">40</translation> <translation id="IDS_OPTIONS_DIALOG_LEFT_COLUMN_WIDTH_CHARS">26</translation> <translation id="IDS_OPTIONS_RESET_CONFIRM_BOX_WIDTH_CHARS">80</translation> <translation id="IDS_URLPICKER_DIALOG_WIDTH_CHARS">80</translation> diff --git a/chrome/app/resources/locale_settings_id.xtb b/chrome/app/resources/locale_settings_id.xtb index 4202bda..a384576 100644 --- a/chrome/app/resources/locale_settings_id.xtb +++ b/chrome/app/resources/locale_settings_id.xtb @@ -5,8 +5,6 @@ <translation id="IDS_DEFAULT_ENCODING">ISO-8859-1</translation> <translation id="IDS_USES_UNIVERSAL_DETECTOR">false</translation> <translation id="IDS_SPELLCHECK_DICTIONARY">id</translation> -<translation id="IDS_OPTIONS_DIALOG_WIDTH_CHARS">98</translation> -<translation id="IDS_OPTIONS_DIALOG_HEIGHT_LINES">40</translation> <translation id="IDS_OPTIONS_DIALOG_LEFT_COLUMN_WIDTH_CHARS">26</translation> <translation id="IDS_OPTIONS_RESET_CONFIRM_BOX_WIDTH_CHARS">80</translation> <translation id="IDS_URLPICKER_DIALOG_WIDTH_CHARS">80</translation> diff --git a/chrome/app/resources/locale_settings_it.xtb b/chrome/app/resources/locale_settings_it.xtb index 6ec00f6..46a86a0 100644 --- a/chrome/app/resources/locale_settings_it.xtb +++ b/chrome/app/resources/locale_settings_it.xtb @@ -5,13 +5,6 @@ <translation id="IDS_DEFAULT_ENCODING">ISO-8859-1</translation> <translation id="IDS_USES_UNIVERSAL_DETECTOR">false</translation> <translation id="IDS_SPELLCHECK_DICTIONARY">it</translation> -<if expr="pp_if('chromeos')"> - <translation id="IDS_OPTIONS_DIALOG_WIDTH_CHARS">114</translation> -</if> -<if expr="not pp_if('chromeos')"> - <translation id="IDS_OPTIONS_DIALOG_WIDTH_CHARS">98</translation> -</if> -<translation id="IDS_OPTIONS_DIALOG_HEIGHT_LINES">40</translation> <translation id="IDS_OPTIONS_DIALOG_LEFT_COLUMN_WIDTH_CHARS">26</translation> <translation id="IDS_OPTIONS_RESET_CONFIRM_BOX_WIDTH_CHARS">80</translation> <translation id="IDS_URLPICKER_DIALOG_WIDTH_CHARS">80</translation> diff --git a/chrome/app/resources/locale_settings_ja.xtb b/chrome/app/resources/locale_settings_ja.xtb index 1a531e7..8adf02e 100644 --- a/chrome/app/resources/locale_settings_ja.xtb +++ b/chrome/app/resources/locale_settings_ja.xtb @@ -5,8 +5,6 @@ <translation id="IDS_DEFAULT_ENCODING">Shift_JIS</translation> <translation id="IDS_USES_UNIVERSAL_DETECTOR">false</translation> <translation id="IDS_SPELLCHECK_DICTIONARY">en-US</translation> -<translation id="IDS_OPTIONS_DIALOG_WIDTH_CHARS">104</translation> -<translation id="IDS_OPTIONS_DIALOG_HEIGHT_LINES">39</translation> <translation id="IDS_OPTIONS_DIALOG_LEFT_COLUMN_WIDTH_CHARS">25</translation> <translation id="IDS_OPTIONS_RESET_CONFIRM_BOX_WIDTH_CHARS">80</translation> <translation id="IDS_URLPICKER_DIALOG_WIDTH_CHARS">80</translation> diff --git a/chrome/app/resources/locale_settings_kn.xtb b/chrome/app/resources/locale_settings_kn.xtb index f813251..490c366 100644 --- a/chrome/app/resources/locale_settings_kn.xtb +++ b/chrome/app/resources/locale_settings_kn.xtb @@ -5,8 +5,6 @@ <translation id="IDS_DEFAULT_ENCODING">ISO-8859-1</translation> <translation id="IDS_USES_UNIVERSAL_DETECTOR">false</translation> <translation id="IDS_SPELLCHECK_DICTIONARY">en-US</translation> -<translation id="IDS_OPTIONS_DIALOG_WIDTH_CHARS">106</translation> -<translation id="IDS_OPTIONS_DIALOG_HEIGHT_LINES">34</translation> <translation id="IDS_OPTIONS_DIALOG_LEFT_COLUMN_WIDTH_CHARS">26</translation> <translation id="IDS_OPTIONS_RESET_CONFIRM_BOX_WIDTH_CHARS">80</translation> <translation id="IDS_URLPICKER_DIALOG_WIDTH_CHARS">80</translation> diff --git a/chrome/app/resources/locale_settings_ko.xtb b/chrome/app/resources/locale_settings_ko.xtb index 33474c8..a27126f 100644 --- a/chrome/app/resources/locale_settings_ko.xtb +++ b/chrome/app/resources/locale_settings_ko.xtb @@ -9,8 +9,6 @@ <translation id="IDS_MINIMUM_LOGICAL_FONT_SIZE">10</translation> <translation id="IDS_USES_UNIVERSAL_DETECTOR">false</translation> <translation id="IDS_SPELLCHECK_DICTIONARY">en-US</translation> -<translation id="IDS_OPTIONS_DIALOG_WIDTH_CHARS">98</translation> -<translation id="IDS_OPTIONS_DIALOG_HEIGHT_LINES">39</translation> <translation id="IDS_OPTIONS_DIALOG_LEFT_COLUMN_WIDTH_CHARS">26</translation> <translation id="IDS_OPTIONS_RESET_CONFIRM_BOX_WIDTH_CHARS">80</translation> <translation id="IDS_URLPICKER_DIALOG_WIDTH_CHARS">80</translation> diff --git a/chrome/app/resources/locale_settings_lt.xtb b/chrome/app/resources/locale_settings_lt.xtb index 532ec55..b9b3890 100644 --- a/chrome/app/resources/locale_settings_lt.xtb +++ b/chrome/app/resources/locale_settings_lt.xtb @@ -5,8 +5,6 @@ <translation id="IDS_DEFAULT_ENCODING">windows-1257</translation> <translation id="IDS_USES_UNIVERSAL_DETECTOR">false</translation> <translation id="IDS_SPELLCHECK_DICTIONARY">lt</translation> -<translation id="IDS_OPTIONS_DIALOG_WIDTH_CHARS">104</translation> -<translation id="IDS_OPTIONS_DIALOG_HEIGHT_LINES">38</translation> <translation id="IDS_OPTIONS_DIALOG_LEFT_COLUMN_WIDTH_CHARS">26</translation> <translation id="IDS_OPTIONS_RESET_CONFIRM_BOX_WIDTH_CHARS">80</translation> <translation id="IDS_URLPICKER_DIALOG_WIDTH_CHARS">80</translation> diff --git a/chrome/app/resources/locale_settings_lv.xtb b/chrome/app/resources/locale_settings_lv.xtb index 113a216..4870327 100644 --- a/chrome/app/resources/locale_settings_lv.xtb +++ b/chrome/app/resources/locale_settings_lv.xtb @@ -5,8 +5,6 @@ <translation id="IDS_DEFAULT_ENCODING">windows-1257</translation> <translation id="IDS_USES_UNIVERSAL_DETECTOR">false</translation> <translation id="IDS_SPELLCHECK_DICTIONARY">lv</translation> -<translation id="IDS_OPTIONS_DIALOG_WIDTH_CHARS">102</translation> -<translation id="IDS_OPTIONS_DIALOG_HEIGHT_LINES">38</translation> <translation id="IDS_OPTIONS_DIALOG_LEFT_COLUMN_WIDTH_CHARS">26</translation> <translation id="IDS_OPTIONS_RESET_CONFIRM_BOX_WIDTH_CHARS">80</translation> <translation id="IDS_URLPICKER_DIALOG_WIDTH_CHARS">80</translation> diff --git a/chrome/app/resources/locale_settings_ml.xtb b/chrome/app/resources/locale_settings_ml.xtb index 96523fd..4195bd1 100644 --- a/chrome/app/resources/locale_settings_ml.xtb +++ b/chrome/app/resources/locale_settings_ml.xtb @@ -5,8 +5,6 @@ <translation id="IDS_DEFAULT_ENCODING">ISO-8859-1</translation> <translation id="IDS_USES_UNIVERSAL_DETECTOR">false</translation> <translation id="IDS_SPELLCHECK_DICTIONARY">en-US</translation> -<translation id="IDS_OPTIONS_DIALOG_WIDTH_CHARS">114</translation> -<translation id="IDS_OPTIONS_DIALOG_HEIGHT_LINES">36</translation> <translation id="IDS_OPTIONS_DIALOG_LEFT_COLUMN_WIDTH_CHARS">26</translation> <translation id="IDS_OPTIONS_RESET_CONFIRM_BOX_WIDTH_CHARS">87</translation> <translation id="IDS_URLPICKER_DIALOG_WIDTH_CHARS">80</translation> diff --git a/chrome/app/resources/locale_settings_mr.xtb b/chrome/app/resources/locale_settings_mr.xtb index fbcac2e..818c06c 100644 --- a/chrome/app/resources/locale_settings_mr.xtb +++ b/chrome/app/resources/locale_settings_mr.xtb @@ -5,8 +5,6 @@ <translation id="IDS_DEFAULT_ENCODING">ISO-8859-1</translation> <translation id="IDS_USES_UNIVERSAL_DETECTOR">false</translation> <translation id="IDS_SPELLCHECK_DICTIONARY">en-US</translation> -<translation id="IDS_OPTIONS_DIALOG_WIDTH_CHARS">98</translation> -<translation id="IDS_OPTIONS_DIALOG_HEIGHT_LINES">34</translation> <translation id="IDS_OPTIONS_DIALOG_LEFT_COLUMN_WIDTH_CHARS">26</translation> <translation id="IDS_OPTIONS_RESET_CONFIRM_BOX_WIDTH_CHARS">80</translation> <translation id="IDS_URLPICKER_DIALOG_WIDTH_CHARS">80</translation> diff --git a/chrome/app/resources/locale_settings_nb.xtb b/chrome/app/resources/locale_settings_nb.xtb index ef4109c..2d3fe94 100644 --- a/chrome/app/resources/locale_settings_nb.xtb +++ b/chrome/app/resources/locale_settings_nb.xtb @@ -5,8 +5,6 @@ <translation id="IDS_DEFAULT_ENCODING">ISO-8859-1</translation> <translation id="IDS_USES_UNIVERSAL_DETECTOR">false</translation> <translation id="IDS_SPELLCHECK_DICTIONARY">nb</translation> -<translation id="IDS_OPTIONS_DIALOG_WIDTH_CHARS">104</translation> -<translation id="IDS_OPTIONS_DIALOG_HEIGHT_LINES">39</translation> <translation id="IDS_OPTIONS_DIALOG_LEFT_COLUMN_WIDTH_CHARS">25</translation> <translation id="IDS_OPTIONS_RESET_CONFIRM_BOX_WIDTH_CHARS">80</translation> <translation id="IDS_URLPICKER_DIALOG_WIDTH_CHARS">80</translation> diff --git a/chrome/app/resources/locale_settings_nl.xtb b/chrome/app/resources/locale_settings_nl.xtb index 10f94a1..9cd360f 100644 --- a/chrome/app/resources/locale_settings_nl.xtb +++ b/chrome/app/resources/locale_settings_nl.xtb @@ -5,8 +5,6 @@ <translation id="IDS_DEFAULT_ENCODING">ISO-8859-1</translation> <translation id="IDS_USES_UNIVERSAL_DETECTOR">false</translation> <translation id="IDS_SPELLCHECK_DICTIONARY">nl</translation> -<translation id="IDS_OPTIONS_DIALOG_WIDTH_CHARS">108</translation> -<translation id="IDS_OPTIONS_DIALOG_HEIGHT_LINES">39</translation> <translation id="IDS_OPTIONS_DIALOG_LEFT_COLUMN_WIDTH_CHARS">30</translation> <translation id="IDS_OPTIONS_RESET_CONFIRM_BOX_WIDTH_CHARS">80</translation> <translation id="IDS_URLPICKER_DIALOG_WIDTH_CHARS">80</translation> diff --git a/chrome/app/resources/locale_settings_or.xtb b/chrome/app/resources/locale_settings_or.xtb index 9ab3eb6..f615091 100644 --- a/chrome/app/resources/locale_settings_or.xtb +++ b/chrome/app/resources/locale_settings_or.xtb @@ -5,8 +5,6 @@ <translation id="IDS_DEFAULT_ENCODING">ISO-8859-1</translation> <translation id="IDS_USES_UNIVERSAL_DETECTOR">false</translation> <translation id="IDS_SPELLCHECK_DICTIONARY">en-US</translation> -<translation id="IDS_OPTIONS_DIALOG_WIDTH_CHARS">98</translation> -<translation id="IDS_OPTIONS_DIALOG_HEIGHT_LINES">34</translation> <translation id="IDS_OPTIONS_DIALOG_LEFT_COLUMN_WIDTH_CHARS">26</translation> <translation id="IDS_OPTIONS_RESET_CONFIRM_BOX_WIDTH_CHARS">80</translation> <translation id="IDS_URLPICKER_DIALOG_WIDTH_CHARS">80</translation> diff --git a/chrome/app/resources/locale_settings_pl.xtb b/chrome/app/resources/locale_settings_pl.xtb index 1558d8e..d130b01 100644 --- a/chrome/app/resources/locale_settings_pl.xtb +++ b/chrome/app/resources/locale_settings_pl.xtb @@ -5,8 +5,6 @@ <translation id="IDS_DEFAULT_ENCODING">ISO-8859-2</translation> <translation id="IDS_USES_UNIVERSAL_DETECTOR">false</translation> <translation id="IDS_SPELLCHECK_DICTIONARY">pl</translation> -<translation id="IDS_OPTIONS_DIALOG_WIDTH_CHARS">105</translation> -<translation id="IDS_OPTIONS_DIALOG_HEIGHT_LINES">38</translation> <translation id="IDS_OPTIONS_DIALOG_LEFT_COLUMN_WIDTH_CHARS">25</translation> <translation id="IDS_OPTIONS_RESET_CONFIRM_BOX_WIDTH_CHARS">80</translation> <translation id="IDS_URLPICKER_DIALOG_WIDTH_CHARS">80</translation> diff --git a/chrome/app/resources/locale_settings_pt-BR.xtb b/chrome/app/resources/locale_settings_pt-BR.xtb index e0d3a64..fa74574 100644 --- a/chrome/app/resources/locale_settings_pt-BR.xtb +++ b/chrome/app/resources/locale_settings_pt-BR.xtb @@ -5,8 +5,6 @@ <translation id="IDS_DEFAULT_ENCODING">ISO-8859-1</translation> <translation id="IDS_USES_UNIVERSAL_DETECTOR">false</translation> <translation id="IDS_SPELLCHECK_DICTIONARY">pt-BR</translation> -<translation id="IDS_OPTIONS_DIALOG_WIDTH_CHARS">110</translation> -<translation id="IDS_OPTIONS_DIALOG_HEIGHT_LINES">40</translation> <translation id="IDS_OPTIONS_DIALOG_LEFT_COLUMN_WIDTH_CHARS">30</translation> <translation id="IDS_OPTIONS_RESET_CONFIRM_BOX_WIDTH_CHARS">80</translation> <translation id="IDS_URLPICKER_DIALOG_WIDTH_CHARS">80</translation> diff --git a/chrome/app/resources/locale_settings_pt-PT.xtb b/chrome/app/resources/locale_settings_pt-PT.xtb index 30da552..0f275cb 100644 --- a/chrome/app/resources/locale_settings_pt-PT.xtb +++ b/chrome/app/resources/locale_settings_pt-PT.xtb @@ -5,8 +5,6 @@ <translation id="IDS_DEFAULT_ENCODING">ISO-8859-1</translation> <translation id="IDS_USES_UNIVERSAL_DETECTOR">false</translation> <translation id="IDS_SPELLCHECK_DICTIONARY">pt-PT</translation> -<translation id="IDS_OPTIONS_DIALOG_WIDTH_CHARS">110</translation> -<translation id="IDS_OPTIONS_DIALOG_HEIGHT_LINES">40</translation> <translation id="IDS_OPTIONS_DIALOG_LEFT_COLUMN_WIDTH_CHARS">30</translation> <translation id="IDS_OPTIONS_RESET_CONFIRM_BOX_WIDTH_CHARS">80</translation> <translation id="IDS_URLPICKER_DIALOG_WIDTH_CHARS">80</translation> diff --git a/chrome/app/resources/locale_settings_ro.xtb b/chrome/app/resources/locale_settings_ro.xtb index 11c1ca4..1ce3d43 100644 --- a/chrome/app/resources/locale_settings_ro.xtb +++ b/chrome/app/resources/locale_settings_ro.xtb @@ -5,8 +5,6 @@ <translation id="IDS_DEFAULT_ENCODING">ISO-8859-2</translation> <translation id="IDS_USES_UNIVERSAL_DETECTOR">false</translation> <translation id="IDS_SPELLCHECK_DICTIONARY">ro</translation> -<translation id="IDS_OPTIONS_DIALOG_WIDTH_CHARS">104</translation> -<translation id="IDS_OPTIONS_DIALOG_HEIGHT_LINES">40</translation> <translation id="IDS_OPTIONS_DIALOG_LEFT_COLUMN_WIDTH_CHARS">26</translation> <translation id="IDS_OPTIONS_RESET_CONFIRM_BOX_WIDTH_CHARS">80</translation> <translation id="IDS_URLPICKER_DIALOG_WIDTH_CHARS">80</translation> diff --git a/chrome/app/resources/locale_settings_ru.xtb b/chrome/app/resources/locale_settings_ru.xtb index c837201..78c8730 100644 --- a/chrome/app/resources/locale_settings_ru.xtb +++ b/chrome/app/resources/locale_settings_ru.xtb @@ -5,8 +5,6 @@ <translation id="IDS_DEFAULT_ENCODING">windows-1251</translation> <translation id="IDS_USES_UNIVERSAL_DETECTOR">false</translation> <translation id="IDS_SPELLCHECK_DICTIONARY">ru</translation> -<translation id="IDS_OPTIONS_DIALOG_WIDTH_CHARS">122</translation> -<translation id="IDS_OPTIONS_DIALOG_HEIGHT_LINES">39</translation> <translation id="IDS_OPTIONS_DIALOG_LEFT_COLUMN_WIDTH_CHARS">26</translation> <translation id="IDS_OPTIONS_RESET_CONFIRM_BOX_WIDTH_CHARS">80</translation> <translation id="IDS_URLPICKER_DIALOG_WIDTH_CHARS">80</translation> diff --git a/chrome/app/resources/locale_settings_sk.xtb b/chrome/app/resources/locale_settings_sk.xtb index 147a656..211ef79 100644 --- a/chrome/app/resources/locale_settings_sk.xtb +++ b/chrome/app/resources/locale_settings_sk.xtb @@ -5,8 +5,6 @@ <translation id="IDS_DEFAULT_ENCODING">windows-1250</translation> <translation id="IDS_USES_UNIVERSAL_DETECTOR">false</translation> <translation id="IDS_SPELLCHECK_DICTIONARY">sk</translation> -<translation id="IDS_OPTIONS_DIALOG_WIDTH_CHARS">104</translation> -<translation id="IDS_OPTIONS_DIALOG_HEIGHT_LINES">38</translation> <translation id="IDS_OPTIONS_DIALOG_LEFT_COLUMN_WIDTH_CHARS">26</translation> <translation id="IDS_OPTIONS_RESET_CONFIRM_BOX_WIDTH_CHARS">80</translation> <translation id="IDS_URLPICKER_DIALOG_WIDTH_CHARS">80</translation> diff --git a/chrome/app/resources/locale_settings_sl.xtb b/chrome/app/resources/locale_settings_sl.xtb index 1329afa..ec7d084 100644 --- a/chrome/app/resources/locale_settings_sl.xtb +++ b/chrome/app/resources/locale_settings_sl.xtb @@ -5,8 +5,6 @@ <translation id="IDS_DEFAULT_ENCODING">ISO-8859-2</translation> <translation id="IDS_USES_UNIVERSAL_DETECTOR">false</translation> <translation id="IDS_SPELLCHECK_DICTIONARY">sl</translation> -<translation id="IDS_OPTIONS_DIALOG_WIDTH_CHARS">98</translation> -<translation id="IDS_OPTIONS_DIALOG_HEIGHT_LINES">39</translation> <translation id="IDS_OPTIONS_DIALOG_LEFT_COLUMN_WIDTH_CHARS">26</translation> <translation id="IDS_OPTIONS_RESET_CONFIRM_BOX_WIDTH_CHARS">80</translation> <translation id="IDS_URLPICKER_DIALOG_WIDTH_CHARS">80</translation> diff --git a/chrome/app/resources/locale_settings_sr.xtb b/chrome/app/resources/locale_settings_sr.xtb index 04a1b4e..3be27ea 100644 --- a/chrome/app/resources/locale_settings_sr.xtb +++ b/chrome/app/resources/locale_settings_sr.xtb @@ -5,8 +5,6 @@ <translation id="IDS_DEFAULT_ENCODING">windows-1251</translation> <translation id="IDS_USES_UNIVERSAL_DETECTOR">false</translation> <translation id="IDS_SPELLCHECK_DICTIONARY">en-US</translation> -<translation id="IDS_OPTIONS_DIALOG_WIDTH_CHARS">106</translation> -<translation id="IDS_OPTIONS_DIALOG_HEIGHT_LINES">40</translation> <translation id="IDS_OPTIONS_DIALOG_LEFT_COLUMN_WIDTH_CHARS">26</translation> <translation id="IDS_OPTIONS_RESET_CONFIRM_BOX_WIDTH_CHARS">80</translation> <translation id="IDS_URLPICKER_DIALOG_WIDTH_CHARS">80</translation> diff --git a/chrome/app/resources/locale_settings_sv.xtb b/chrome/app/resources/locale_settings_sv.xtb index d49037d..48c286b 100644 --- a/chrome/app/resources/locale_settings_sv.xtb +++ b/chrome/app/resources/locale_settings_sv.xtb @@ -5,8 +5,6 @@ <translation id="IDS_DEFAULT_ENCODING">ISO-8859-1</translation> <translation id="IDS_USES_UNIVERSAL_DETECTOR">false</translation> <translation id="IDS_SPELLCHECK_DICTIONARY">sv</translation> -<translation id="IDS_OPTIONS_DIALOG_WIDTH_CHARS">100</translation> -<translation id="IDS_OPTIONS_DIALOG_HEIGHT_LINES">40</translation> <translation id="IDS_OPTIONS_DIALOG_LEFT_COLUMN_WIDTH_CHARS">25</translation> <translation id="IDS_OPTIONS_RESET_CONFIRM_BOX_WIDTH_CHARS">80</translation> <translation id="IDS_URLPICKER_DIALOG_WIDTH_CHARS">80</translation> diff --git a/chrome/app/resources/locale_settings_sw.xtb b/chrome/app/resources/locale_settings_sw.xtb index a70cdde..c323604 100644 --- a/chrome/app/resources/locale_settings_sw.xtb +++ b/chrome/app/resources/locale_settings_sw.xtb @@ -5,8 +5,6 @@ <translation id="IDS_DEFAULT_ENCODING">ISO-8859-1</translation> <translation id="IDS_USES_UNIVERSAL_DETECTOR">false</translation> <translation id="IDS_SPELLCHECK_DICTIONARY">en-GB</translation> -<translation id="IDS_OPTIONS_DIALOG_WIDTH_CHARS">98</translation> -<translation id="IDS_OPTIONS_DIALOG_HEIGHT_LINES">40</translation> <translation id="IDS_OPTIONS_DIALOG_LEFT_COLUMN_WIDTH_CHARS">23</translation> <translation id="IDS_OPTIONS_RESET_CONFIRM_BOX_WIDTH_CHARS">80</translation> <translation id="IDS_URLPICKER_DIALOG_WIDTH_CHARS">80</translation> diff --git a/chrome/app/resources/locale_settings_ta.xtb b/chrome/app/resources/locale_settings_ta.xtb index 61edcd1..41c0005 100644 --- a/chrome/app/resources/locale_settings_ta.xtb +++ b/chrome/app/resources/locale_settings_ta.xtb @@ -5,8 +5,6 @@ <translation id="IDS_DEFAULT_ENCODING">ISO-8859-1</translation> <translation id="IDS_USES_UNIVERSAL_DETECTOR">false</translation> <translation id="IDS_SPELLCHECK_DICTIONARY">en-US</translation> -<translation id="IDS_OPTIONS_DIALOG_WIDTH_CHARS">120</translation> -<translation id="IDS_OPTIONS_DIALOG_HEIGHT_LINES">41</translation> <translation id="IDS_OPTIONS_DIALOG_LEFT_COLUMN_WIDTH_CHARS">26</translation> <translation id="IDS_OPTIONS_RESET_CONFIRM_BOX_WIDTH_CHARS">80</translation> <translation id="IDS_URLPICKER_DIALOG_WIDTH_CHARS">80</translation> diff --git a/chrome/app/resources/locale_settings_te.xtb b/chrome/app/resources/locale_settings_te.xtb index 6a53c74..f39635a 100644 --- a/chrome/app/resources/locale_settings_te.xtb +++ b/chrome/app/resources/locale_settings_te.xtb @@ -5,8 +5,6 @@ <translation id="IDS_DEFAULT_ENCODING">ISO-8859-1</translation> <translation id="IDS_USES_UNIVERSAL_DETECTOR">false</translation> <translation id="IDS_SPELLCHECK_DICTIONARY">en-US</translation> -<translation id="IDS_OPTIONS_DIALOG_WIDTH_CHARS">106</translation> -<translation id="IDS_OPTIONS_DIALOG_HEIGHT_LINES">32</translation> <translation id="IDS_OPTIONS_DIALOG_LEFT_COLUMN_WIDTH_CHARS">26</translation> <translation id="IDS_OPTIONS_RESET_CONFIRM_BOX_WIDTH_CHARS">80</translation> <translation id="IDS_URLPICKER_DIALOG_WIDTH_CHARS">80</translation> diff --git a/chrome/app/resources/locale_settings_th.xtb b/chrome/app/resources/locale_settings_th.xtb index cd538d9..a373609 100644 --- a/chrome/app/resources/locale_settings_th.xtb +++ b/chrome/app/resources/locale_settings_th.xtb @@ -5,8 +5,6 @@ <translation id="IDS_DEFAULT_ENCODING">windows-874</translation> <translation id="IDS_USES_UNIVERSAL_DETECTOR">false</translation> <translation id="IDS_SPELLCHECK_DICTIONARY">en-US</translation> -<translation id="IDS_OPTIONS_DIALOG_WIDTH_CHARS">98</translation> -<translation id="IDS_OPTIONS_DIALOG_HEIGHT_LINES">39</translation> <translation id="IDS_OPTIONS_DIALOG_LEFT_COLUMN_WIDTH_CHARS">26</translation> <translation id="IDS_OPTIONS_RESET_CONFIRM_BOX_WIDTH_CHARS">80</translation> <translation id="IDS_URLPICKER_DIALOG_WIDTH_CHARS">80</translation> diff --git a/chrome/app/resources/locale_settings_tr.xtb b/chrome/app/resources/locale_settings_tr.xtb index 8213ddd..ce582db 100644 --- a/chrome/app/resources/locale_settings_tr.xtb +++ b/chrome/app/resources/locale_settings_tr.xtb @@ -5,8 +5,6 @@ <translation id="IDS_DEFAULT_ENCODING">ISO-8859-9</translation> <translation id="IDS_USES_UNIVERSAL_DETECTOR">false</translation> <translation id="IDS_SPELLCHECK_DICTIONARY">tr</translation> -<translation id="IDS_OPTIONS_DIALOG_WIDTH_CHARS">100</translation> -<translation id="IDS_OPTIONS_DIALOG_HEIGHT_LINES">40</translation> <translation id="IDS_OPTIONS_DIALOG_LEFT_COLUMN_WIDTH_CHARS">26</translation> <translation id="IDS_OPTIONS_RESET_CONFIRM_BOX_WIDTH_CHARS">80</translation> <translation id="IDS_URLPICKER_DIALOG_WIDTH_CHARS">80</translation> diff --git a/chrome/app/resources/locale_settings_uk.xtb b/chrome/app/resources/locale_settings_uk.xtb index 696323f..7cb7a1d 100644 --- a/chrome/app/resources/locale_settings_uk.xtb +++ b/chrome/app/resources/locale_settings_uk.xtb @@ -5,8 +5,6 @@ <translation id="IDS_DEFAULT_ENCODING">windows-1251</translation> <translation id="IDS_USES_UNIVERSAL_DETECTOR">false</translation> <translation id="IDS_SPELLCHECK_DICTIONARY">en-US</translation> -<translation id="IDS_OPTIONS_DIALOG_WIDTH_CHARS">108</translation> -<translation id="IDS_OPTIONS_DIALOG_HEIGHT_LINES">40</translation> <translation id="IDS_OPTIONS_DIALOG_LEFT_COLUMN_WIDTH_CHARS">26</translation> <translation id="IDS_OPTIONS_RESET_CONFIRM_BOX_WIDTH_CHARS">80</translation> <translation id="IDS_URLPICKER_DIALOG_WIDTH_CHARS">80</translation> diff --git a/chrome/app/resources/locale_settings_vi.xtb b/chrome/app/resources/locale_settings_vi.xtb index 6246dd7..d7f626f 100644 --- a/chrome/app/resources/locale_settings_vi.xtb +++ b/chrome/app/resources/locale_settings_vi.xtb @@ -5,8 +5,6 @@ <translation id="IDS_DEFAULT_ENCODING">windows-1258</translation> <translation id="IDS_USES_UNIVERSAL_DETECTOR">false</translation> <translation id="IDS_SPELLCHECK_DICTIONARY">vi</translation> -<translation id="IDS_OPTIONS_DIALOG_WIDTH_CHARS">98</translation> -<translation id="IDS_OPTIONS_DIALOG_HEIGHT_LINES">41</translation> <translation id="IDS_OPTIONS_DIALOG_LEFT_COLUMN_WIDTH_CHARS">26</translation> <translation id="IDS_OPTIONS_RESET_CONFIRM_BOX_WIDTH_CHARS">80</translation> <translation id="IDS_URLPICKER_DIALOG_WIDTH_CHARS">80</translation> diff --git a/chrome/app/resources/locale_settings_zh-CN.xtb b/chrome/app/resources/locale_settings_zh-CN.xtb index 5d2fc0d..a8efab8 100644 --- a/chrome/app/resources/locale_settings_zh-CN.xtb +++ b/chrome/app/resources/locale_settings_zh-CN.xtb @@ -5,8 +5,6 @@ <translation id="IDS_DEFAULT_ENCODING">GBK</translation> <translation id="IDS_USES_UNIVERSAL_DETECTOR">false</translation> <translation id="IDS_SPELLCHECK_DICTIONARY">en-US</translation> -<translation id="IDS_OPTIONS_DIALOG_WIDTH_CHARS">98</translation> -<translation id="IDS_OPTIONS_DIALOG_HEIGHT_LINES">39</translation> <translation id="IDS_OPTIONS_DIALOG_LEFT_COLUMN_WIDTH_CHARS">26</translation> <translation id="IDS_OPTIONS_RESET_CONFIRM_BOX_WIDTH_CHARS">80</translation> <translation id="IDS_URLPICKER_DIALOG_WIDTH_CHARS">80</translation> diff --git a/chrome/app/resources/locale_settings_zh-TW.xtb b/chrome/app/resources/locale_settings_zh-TW.xtb index fa8b3ba..3ccbf87 100644 --- a/chrome/app/resources/locale_settings_zh-TW.xtb +++ b/chrome/app/resources/locale_settings_zh-TW.xtb @@ -5,8 +5,6 @@ <translation id="IDS_DEFAULT_ENCODING">Big5</translation> <translation id="IDS_USES_UNIVERSAL_DETECTOR">false</translation> <translation id="IDS_SPELLCHECK_DICTIONARY">en-US</translation> -<translation id="IDS_OPTIONS_DIALOG_WIDTH_CHARS">95</translation> -<translation id="IDS_OPTIONS_DIALOG_HEIGHT_LINES">39</translation> <translation id="IDS_OPTIONS_DIALOG_LEFT_COLUMN_WIDTH_CHARS">25</translation> <translation id="IDS_OPTIONS_RESET_CONFIRM_BOX_WIDTH_CHARS">80</translation> <translation id="IDS_URLPICKER_DIALOG_WIDTH_CHARS">80</translation> diff --git a/chrome/browser/chromeos/options/options_window_view.cc b/chrome/browser/chromeos/options/options_window_view.cc index d284ce3..4535e8b 100644 --- a/chrome/browser/chromeos/options/options_window_view.cc +++ b/chrome/browser/chromeos/options/options_window_view.cc @@ -35,6 +35,48 @@ namespace chromeos { /////////////////////////////////////////////////////////////////////////////// +// GtkPreferencePageHost +// +// Hosts a GTK preference page and takes care of sizing it appropriately. +// +class GtkPreferencePageHost : public views::NativeViewHost { + public: + explicit GtkPreferencePageHost(GtkWidget* widget); + + private: + // views::View overrides: + virtual void ViewHierarchyChanged(bool is_add, View* parent, View* child); + virtual gfx::Size GetPreferredSize(); + + GtkWidget* widget_; + + DISALLOW_COPY_AND_ASSIGN(GtkPreferencePageHost); +}; + +GtkPreferencePageHost::GtkPreferencePageHost(GtkWidget* widget) + : widget_(widget) { + set_background(views::Background::CreateSolidBackground(SK_ColorWHITE)); +} + +void GtkPreferencePageHost::ViewHierarchyChanged(bool is_add, + View* parent, + View* child) { + NativeViewHost::ViewHierarchyChanged(is_add, parent, child); + if (is_add && child == this) + Attach(widget_); +} + +gfx::Size GtkPreferencePageHost::GetPreferredSize() { + // We need to show the widget and its children since otherwise containers like + // gtk_box don't compute the correct size. + gtk_widget_show_all(widget_); + GtkRequisition requisition = { 0, 0 }; + gtk_widget_size_request(GTK_WIDGET(widget_), &requisition); + GtkRequisition& size(widget_->requisition); + return gfx::Size(size.width, size.height); +} + +/////////////////////////////////////////////////////////////////////////////// // OptionsWindowView // // The contents of the Options dialog window. @@ -214,9 +256,9 @@ void OptionsWindowView::Layout() { } gfx::Size OptionsWindowView::GetPreferredSize() { - return gfx::Size(views::Window::GetLocalizedContentsSize( - IDS_OPTIONS_DIALOG_WIDTH_CHARS, - IDS_OPTIONS_DIALOG_HEIGHT_LINES)); + gfx::Size size(tabs_->GetPreferredSize()); + size.Enlarge(2 * kDialogPadding, 2 * kDialogPadding); + return size; } void OptionsWindowView::ViewHierarchyChanged(bool is_add, @@ -263,29 +305,23 @@ void OptionsWindowView::Init() { l10n_util::GetString(IDS_OPTIONS_INTERNET_TAB_LABEL), internet_page, false); - views::NativeViewHost* general_page_view = new views::NativeViewHost(); - general_page_view->set_background(views::Background::CreateSolidBackground( - SK_ColorWHITE)); tabs_->AddTabAtIndex(tab_index++, l10n_util::GetString(IDS_OPTIONS_GENERAL_TAB_LABEL), - general_page_view, false); - general_page_view->Attach(general_page_.get_page_widget()); + new GtkPreferencePageHost( + general_page_.get_page_widget()), + false); - views::NativeViewHost* content_page_view = new views::NativeViewHost(); - content_page_view->set_background(views::Background::CreateSolidBackground( - SK_ColorWHITE)); tabs_->AddTabAtIndex(tab_index++, l10n_util::GetString(IDS_OPTIONS_CONTENT_TAB_LABEL), - content_page_view, false); - content_page_view->Attach(content_page_.get_page_widget()); + new GtkPreferencePageHost( + content_page_.get_page_widget()), + false); - views::NativeViewHost* advanced_page_view = new views::NativeViewHost(); - advanced_page_view->set_background(views::Background::CreateSolidBackground( - SK_ColorWHITE)); tabs_->AddTabAtIndex(tab_index++, l10n_util::GetString(IDS_OPTIONS_ADVANCED_TAB_LABEL), - advanced_page_view, false); - advanced_page_view->Attach(advanced_page_.get_page_widget()); + new GtkPreferencePageHost( + advanced_page_.get_page_widget()), + false); DCHECK(tabs_->GetTabCount() == OPTIONS_PAGE_COUNT); @@ -344,4 +380,3 @@ void ShowOptionsWindow(OptionsPage page, OptionsWindowView::instance_->ShowOptionsPage(page, highlight_group); } - diff --git a/chrome/browser/views/options/advanced_contents_view.cc b/chrome/browser/views/options/advanced_contents_view.cc index 9ee6485e..bbe232f 100644 --- a/chrome/browser/views/options/advanced_contents_view.cc +++ b/chrome/browser/views/options/advanced_contents_view.cc @@ -287,7 +287,6 @@ AdvancedSection::AdvancedSection(Profile* profile, void AdvancedSection::DidChangeBounds(const gfx::Rect& previous, const gfx::Rect& current) { Layout(); - contents_->Layout(); } //////////////////////////////////////////////////////////////////////////////// @@ -434,9 +433,6 @@ class PrivacySection : public AdvancedSection, // Overridden from views::LinkController: virtual void LinkActivated(views::Link* source, int event_flags); - // Overridden from views::View: - virtual void Layout(); - protected: // OptionsPageView overrides: virtual void InitControlLayout(); @@ -549,22 +545,6 @@ void PrivacySection::LinkActivated(views::Link* source, int event_flags) { } } -void PrivacySection::Layout() { - if (reporting_enabled_checkbox_) { - // We override this to try and set the width of the enable logging checkbox - // to the width of the parent less some fudging since the checkbox's - // preferred size calculation code is dependent on its width, and if we - // don't do this then it will return 0 as a preferred width when GridLayout - // (called from View::Layout) tries to access it. - views::View* parent = GetParent(); - if (parent && parent->width()) { - const int parent_width = parent->width(); - reporting_enabled_checkbox_->SetBounds(0, 0, parent_width - 20, 0); - } - } - View::Layout(); -} - void PrivacySection::InitControlLayout() { AdvancedSection::InitControlLayout(); @@ -636,8 +616,8 @@ void PrivacySection::InitControlLayout() { reporting_enabled_checkbox_ != NULL); // The "Help make Google Chrome better" checkbox. if (reporting_enabled_checkbox_) { - AddLeadingControl(layout, reporting_enabled_checkbox_, indented_view_set_id, - false); + AddWrappingCheckboxRow(layout, reporting_enabled_checkbox_, + indented_view_set_id, false); } // Init member prefs so we can update the controls if prefs change. @@ -1421,5 +1401,4 @@ void AdvancedScrollViewContainer::Layout() { gfx::NativeTheme::LIST); lb.Inset(border.width(), border.height()); scroll_view_->SetBounds(lb); - scroll_view_->Layout(); } diff --git a/chrome/browser/views/options/content_page_view.cc b/chrome/browser/views/options/content_page_view.cc index add146e..04ccf65 100644 --- a/chrome/browser/views/options/content_page_view.cc +++ b/chrome/browser/views/options/content_page_view.cc @@ -41,8 +41,10 @@ namespace { -const int kPasswordSavingRadioGroup = 1; -const int kFormAutofillRadioGroup = 2; +// All the options pages are in the same view hierarchy. This means we need to +// make sure group identifiers don't collide across different pages. +const int kPasswordSavingRadioGroup = 201; +const int kFormAutofillRadioGroup = 202; // Background color for the status label when it's showing an error. static const SkColor kSyncLabelErrorBgColor = SkColorSetRGB(0xff, 0x9a, 0x9a); @@ -252,17 +254,6 @@ void ContentPageView::NotifyPrefChanged(const std::wstring* pref_name) { void ContentPageView::Layout() { if (is_initialized()) UpdateSyncControls(); - // We need to Layout twice - once to get the width of the contents box... - View::Layout(); - passwords_asktosave_radio_->SetBounds( - 0, 0, passwords_group_->GetContentsWidth(), 0); - passwords_neversave_radio_->SetBounds( - 0, 0, passwords_group_->GetContentsWidth(), 0); - if (is_initialized()) { - sync_status_label_->SetBounds( - 0, 0, sync_group_->GetContentsWidth(), 0); - } - // ... and twice to get the height of multi-line items correct. View::Layout(); } @@ -308,10 +299,12 @@ void ContentPageView::InitPasswordSavingGroup() { GridLayout::USE_PREF, 0, 0); layout->StartRow(0, single_column_view_set_id); - layout->AddView(passwords_asktosave_radio_); + layout->AddView(passwords_asktosave_radio_, 1, 1, + GridLayout::FILL, GridLayout::LEADING); layout->AddPaddingRow(0, kRelatedControlVerticalSpacing); layout->StartRow(0, single_column_view_set_id); - layout->AddView(passwords_neversave_radio_); + layout->AddView(passwords_neversave_radio_, 1, 1, + GridLayout::FILL, GridLayout::LEADING); layout->AddPaddingRow(0, kUnrelatedControlVerticalSpacing); layout->StartRow(0, single_column_view_set_id); layout->AddView(show_passwords_button_); @@ -356,10 +349,12 @@ void ContentPageView::InitFormAutofillGroup() { GridLayout::USE_PREF, 0, 0); layout->StartRow(0, fill_column_view_set_id); - layout->AddView(form_autofill_enable_radio_); + layout->AddView(form_autofill_enable_radio_, 1, 1, + GridLayout::FILL, GridLayout::LEADING); layout->AddPaddingRow(0, kRelatedControlVerticalSpacing); layout->StartRow(0, fill_column_view_set_id); - layout->AddView(form_autofill_disable_radio_); + layout->AddView(form_autofill_disable_radio_, 1, 1, + GridLayout::FILL, GridLayout::LEADING); layout->AddPaddingRow(0, kRelatedControlVerticalSpacing); layout->StartRow(0, leading_column_view_set_id); layout->AddView(change_autofill_settings_button_); @@ -457,7 +452,8 @@ void ContentPageView::InitSyncGroup() { GridLayout::USE_PREF, 0, 0); layout->StartRow(0, single_column_view_set_id); - layout->AddView(sync_status_label_, 3, 1); + layout->AddView(sync_status_label_, 3, 1, + GridLayout::FILL, GridLayout::LEADING); layout->StartRow(0, single_column_view_set_id); layout->AddView(sync_action_link_, 3, 1); layout->AddPaddingRow(0, kRelatedControlVerticalSpacing); diff --git a/chrome/browser/views/options/general_page_view.cc b/chrome/browser/views/options/general_page_view.cc index 20504c9..f836ea4 100644 --- a/chrome/browser/views/options/general_page_view.cc +++ b/chrome/browser/views/options/general_page_view.cc @@ -35,10 +35,13 @@ namespace { -const int kStartupRadioGroup = 1; -const int kHomePageRadioGroup = 2; +// All the options pages are in the same view hierarchy. This means we need to +// make sure group identifiers don't collide across different pages. +const int kStartupRadioGroup = 101; +const int kHomePageRadioGroup = 102; const SkColor kDefaultBrowserLabelColor = SkColorSetRGB(0, 135, 0); const SkColor kNotDefaultBrowserLabelColor = SkColorSetRGB(135, 0, 0); +const int kHomePageTextfieldWidthChars = 40; } // namespace @@ -402,24 +405,6 @@ void GeneralPageView::HighlightGroup(OptionsGroup highlight_group) { } /////////////////////////////////////////////////////////////////////////////// -// GeneralPageView, views::View overrides: - -void GeneralPageView::Layout() { - // We need to Layout twice - once to get the width of the contents box... - View::Layout(); - startup_last_session_radio_->SetBounds( - 0, 0, startup_group_->GetContentsWidth(), 0); - homepage_use_newtab_radio_->SetBounds( - 0, 0, homepage_group_->GetContentsWidth(), 0); - homepage_show_home_button_checkbox_->SetBounds( - 0, 0, homepage_group_->GetContentsWidth(), 0); - default_browser_status_label_->SetBounds( - 0, 0, default_browser_group_->GetContentsWidth(), 0); - // ... and twice to get the height of multi-line items correct. - View::Layout(); -} - -/////////////////////////////////////////////////////////////////////////////// // GeneralPageView, private: void GeneralPageView::SetDefaultBrowserUIState( @@ -512,14 +497,16 @@ void GeneralPageView::InitStartupGroup() { layout->AddView(startup_homepage_radio_); layout->AddPaddingRow(0, kRelatedControlVerticalSpacing); layout->StartRow(0, single_column_view_set_id); - layout->AddView(startup_last_session_radio_); + layout->AddView(startup_last_session_radio_, 1, 1, + GridLayout::FILL, GridLayout::LEADING); layout->AddPaddingRow(0, kRelatedControlVerticalSpacing); layout->StartRow(0, single_column_view_set_id); layout->AddView(startup_custom_radio_); layout->AddPaddingRow(0, kRelatedControlVerticalSpacing); layout->StartRow(0, double_column_view_set_id); - layout->AddView(startup_custom_pages_table_); + layout->AddView(startup_custom_pages_table_, 1, 1, + GridLayout::FILL, GridLayout::FILL); views::View* button_stack = new views::View; GridLayout* button_stack_layout = new GridLayout(button_stack); @@ -558,6 +545,8 @@ void GeneralPageView::InitHomepageGroup() { homepage_use_url_radio_->set_listener(this); homepage_use_url_textfield_ = new views::Textfield; homepage_use_url_textfield_->SetController(this); + homepage_use_url_textfield_->set_default_width_in_chars( + kHomePageTextfieldWidthChars); homepage_show_home_button_checkbox_ = new views::Checkbox( l10n_util::GetString(IDS_OPTIONS_HOMEPAGE_SHOW_BUTTON)); homepage_show_home_button_checkbox_->set_listener(this); @@ -584,14 +573,16 @@ void GeneralPageView::InitHomepageGroup() { GridLayout::USE_PREF, 0, 0); layout->StartRow(0, single_column_view_set_id); - layout->AddView(homepage_use_newtab_radio_); + layout->AddView(homepage_use_newtab_radio_, 1, 1, + GridLayout::FILL, GridLayout::LEADING); layout->AddPaddingRow(0, kRelatedControlVerticalSpacing); layout->StartRow(0, double_column_view_set_id); layout->AddView(homepage_use_url_radio_); layout->AddView(homepage_use_url_textfield_); layout->AddPaddingRow(0, kRelatedControlVerticalSpacing); layout->StartRow(0, single_column_view_set_id); - layout->AddView(homepage_show_home_button_checkbox_); + layout->AddView(homepage_show_home_button_checkbox_, 1, 1, + GridLayout::FILL, GridLayout::LEADING); homepage_group_ = new OptionsGroupView( contents, l10n_util::GetString(IDS_OPTIONS_HOMEPAGE_GROUP_NAME), @@ -657,7 +648,8 @@ void GeneralPageView::InitDefaultBrowserGroup() { GridLayout::USE_PREF, 0, 0); layout->StartRow(0, single_column_view_set_id); - layout->AddView(default_browser_status_label_); + layout->AddView(default_browser_status_label_, 1, 1, + GridLayout::FILL, GridLayout::LEADING); layout->AddPaddingRow(0, kRelatedControlVerticalSpacing); layout->StartRow(0, single_column_view_set_id); layout->AddView(default_browser_use_as_default_button_); diff --git a/chrome/browser/views/options/general_page_view.h b/chrome/browser/views/options/general_page_view.h index 7838fbe..6cc4911 100644 --- a/chrome/browser/views/options/general_page_view.h +++ b/chrome/browser/views/options/general_page_view.h @@ -62,9 +62,6 @@ class GeneralPageView : public OptionsPageView, virtual void NotifyPrefChanged(const std::wstring* pref_name); virtual void HighlightGroup(OptionsGroup highlight_group); - // views::View overrides: - virtual void Layout(); - private: // ShellIntegration::DefaultBrowserObserver implementation: // Updates the UI state to reflect the current default browser state. diff --git a/chrome/browser/views/options/options_window_view.cc b/chrome/browser/views/options/options_window_view.cc index 76c219b..70a043d 100644 --- a/chrome/browser/views/options/options_window_view.cc +++ b/chrome/browser/views/options/options_window_view.cc @@ -183,9 +183,9 @@ void OptionsWindowView::Layout() { } gfx::Size OptionsWindowView::GetPreferredSize() { - return gfx::Size(views::Window::GetLocalizedContentsSize( - IDS_OPTIONS_DIALOG_WIDTH_CHARS, - IDS_OPTIONS_DIALOG_HEIGHT_LINES)); + gfx::Size size(tabs_->GetPreferredSize()); + size.Enlarge(2 * kDialogPadding, 2 * kDialogPadding); + return size; } void OptionsWindowView::ViewHierarchyChanged(bool is_add, diff --git a/chrome/browser/views/tab_contents/tab_contents_view_gtk.cc b/chrome/browser/views/tab_contents/tab_contents_view_gtk.cc index b3e8194d..b7915b1 100644 --- a/chrome/browser/views/tab_contents/tab_contents_view_gtk.cc +++ b/chrome/browser/views/tab_contents/tab_contents_view_gtk.cc @@ -217,8 +217,10 @@ void TabContentsViewGtk::GetContainerBounds(gfx::Rect* out) const { // Callers expect the requested bounds not the actual bounds. For example, // during init callers expect 0x0, but Gtk layout enforces a min size of 1x1. - out->set_width(GetNativeView()->requisition.width); - out->set_height(GetNativeView()->requisition.height); + GtkRequisition requisition; + gtk_widget_get_child_requisition(GetNativeView(), &requisition); + out->set_width(requisition.width); + out->set_height(requisition.height); } void TabContentsViewGtk::StartDragging(const WebDropData& drop_data, diff --git a/chrome/chrome_tests.gypi b/chrome/chrome_tests.gypi index bba32d2..e1d2434 100644 --- a/chrome/chrome_tests.gypi +++ b/chrome/chrome_tests.gypi @@ -23,6 +23,7 @@ '../views/focus/focus_manager_unittest.cc', '../views/controls/label_unittest.cc', '../views/controls/progress_bar_unittest.cc', + '../views/controls/tabbed_pane/tabbed_pane_unittest.cc', '../views/controls/table/table_view_unittest.cc', '../views/grid_layout_unittest.cc', ], diff --git a/views/controls/button/native_button_win.cc b/views/controls/button/native_button_win.cc index c485c71..9e24fc3 100644 --- a/views/controls/button/native_button_win.cc +++ b/views/controls/button/native_button_win.cc @@ -19,7 +19,8 @@ namespace views { // NativeButtonWin, public: NativeButtonWin::NativeButtonWin(NativeButton* native_button) - : native_button_(native_button) { + : native_button_(native_button), + button_size_valid_(false) { // Associates the actual HWND with the native_button so the native_button is // the one considered as having the focus (not the wrapper) when the HWND is // focused directly (with a click for example). @@ -43,12 +44,14 @@ void NativeButtonWin::UpdateLabel() { } SetWindowText(native_view(), native_button_->label().c_str()); + button_size_valid_ = false; } void NativeButtonWin::UpdateFont() { SendMessage(native_view(), WM_SETFONT, reinterpret_cast<WPARAM>(native_button_->font().hfont()), FALSE); + button_size_valid_ = false; } void NativeButtonWin::UpdateEnabled() { @@ -60,6 +63,7 @@ void NativeButtonWin::UpdateDefault() { SendMessage(native_view(), BM_SETSTYLE, native_button_->is_default() ? BS_DEFPUSHBUTTON : BS_PUSHBUTTON, true); + button_size_valid_ = false; } } @@ -88,10 +92,13 @@ gfx::NativeView NativeButtonWin::GetTestingHandle() const { // NativeButtonWin, View overrides: gfx::Size NativeButtonWin::GetPreferredSize() { - SIZE sz = {0}; - SendMessage(native_view(), BCM_GETIDEALSIZE, 0, reinterpret_cast<LPARAM>(&sz)); - - return gfx::Size(sz.cx, sz.cy); + if (!button_size_valid_) { + SIZE sz = {0}; + Button_GetIdealSize(native_view(), reinterpret_cast<LPARAM>(&sz)); + button_size_.SetSize(sz.cx, sz.cy); + button_size_valid_ = true; + } + return button_size_; } //////////////////////////////////////////////////////////////////////////////// diff --git a/views/controls/button/native_button_win.h b/views/controls/button/native_button_win.h index 20ce575..95b8a5ac 100644 --- a/views/controls/button/native_button_win.h +++ b/views/controls/button/native_button_win.h @@ -1,6 +1,6 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. Use of this -// source code is governed by a BSD-style license that can be found in the -// LICENSE file. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. #ifndef VIEWS_CONTROLS_BUTTON_NATIVE_BUTTON_WIN_H_ #define VIEWS_CONTROLS_BUTTON_NATIVE_BUTTON_WIN_H_ @@ -49,6 +49,10 @@ class NativeButtonWin : public NativeControlWin, // The NativeButton we are bound to. NativeButton* native_button_; + // It's expensive to find the size of a button on windows, so we cache it. + mutable gfx::Size button_size_; + mutable bool button_size_valid_; + DISALLOW_COPY_AND_ASSIGN(NativeButtonWin); }; diff --git a/views/controls/menu/menu_scroll_view_container.cc b/views/controls/menu/menu_scroll_view_container.cc index cb92284..532366c 100644 --- a/views/controls/menu/menu_scroll_view_container.cc +++ b/views/controls/menu/menu_scroll_view_container.cc @@ -257,6 +257,7 @@ void MenuScrollViewContainer::DidChangeBounds(const gfx::Rect& previous, gfx::Size content_pref = scroll_view_->GetContents()->GetPreferredSize(); scroll_up_button_->SetVisible(content_pref.height() > height()); scroll_down_button_->SetVisible(content_pref.height() > height()); + Layout(); } gfx::Size MenuScrollViewContainer::GetPreferredSize() { diff --git a/views/controls/native_control.cc b/views/controls/native_control.cc index f714382..0792b29 100644 --- a/views/controls/native_control.cc +++ b/views/controls/native_control.cc @@ -201,7 +201,7 @@ void NativeControl::ValidateNativeControl() { void NativeControl::ViewHierarchyChanged(bool is_add, View *parent, View *child) { - if (is_add && child == this && GetWidget()) { + if (is_add && parent != this && !container_ && GetWidget()) { ValidateNativeControl(); Layout(); } diff --git a/views/controls/scrollbar/native_scroll_bar_win.cc b/views/controls/scrollbar/native_scroll_bar_win.cc index e434b99..65350e0 100644 --- a/views/controls/scrollbar/native_scroll_bar_win.cc +++ b/views/controls/scrollbar/native_scroll_bar_win.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -200,15 +200,15 @@ NativeScrollBarWin::NativeScrollBarWin(NativeScrollBar* scroll_bar) : native_scroll_bar_(scroll_bar), sb_container_(NULL) { set_focus_view(scroll_bar); + memset(&scroll_info_, 0, sizeof(scroll_info_)); } NativeScrollBarWin::~NativeScrollBarWin() { - if (sb_container_) { + if (sb_container_.get()) { // We always destroy the scrollbar container explicitly to cover all // cases including when the container is no longer connected to a // widget tree. DestroyWindow(sb_container_->hwnd()); - delete sb_container_; } } @@ -227,7 +227,7 @@ gfx::Size NativeScrollBarWin::GetPreferredSize() { } bool NativeScrollBarWin::OnKeyPressed(const KeyEvent& event) { - if (!sb_container_) + if (!sb_container_.get()) return false; int code = -1; switch (event.GetKeyCode()) { @@ -270,7 +270,7 @@ bool NativeScrollBarWin::OnKeyPressed(const KeyEvent& event) { } bool NativeScrollBarWin::OnMouseWheel(const MouseWheelEvent& e) { - if (!sb_container_) + if (!sb_container_.get()) return false; sb_container_->ScrollWithOffset(e.GetOffset()); return true; @@ -280,8 +280,12 @@ bool NativeScrollBarWin::OnMouseWheel(const MouseWheelEvent& e) { // NativeScrollBarWin, NativeControlWin overrides: void NativeScrollBarWin::CreateNativeControl() { - sb_container_ = new ScrollBarContainer(native_scroll_bar_); + sb_container_.reset(new ScrollBarContainer(native_scroll_bar_)); NativeControlCreated(sb_container_->hwnd()); + // Reinstall scroll state if we have valid information. + if (scroll_info_.cbSize) + SetScrollInfo(sb_container_->GetScrollBarHWND(), SB_CTL, &scroll_info_, + TRUE); } //////////////////////////////////////////////////////////////////////////////// @@ -302,7 +306,7 @@ View* NativeScrollBarWin::GetView() { void NativeScrollBarWin::Update(int viewport_size, int content_size, int current_pos) { - if (!sb_container_) + if (!sb_container_.get()) return; if (content_size < 0) @@ -314,14 +318,13 @@ void NativeScrollBarWin::Update(int viewport_size, if (current_pos > content_size) current_pos = content_size; - SCROLLINFO si; - si.cbSize = sizeof(si); - si.fMask = SIF_DISABLENOSCROLL | SIF_POS | SIF_RANGE | SIF_PAGE; - si.nMin = 0; - si.nMax = content_size; - si.nPos = current_pos; - si.nPage = viewport_size; - SetScrollInfo(sb_container_->GetScrollBarHWND(), SB_CTL, &si, TRUE); + scroll_info_.cbSize = sizeof(scroll_info_); + scroll_info_.fMask = SIF_DISABLENOSCROLL | SIF_POS | SIF_RANGE | SIF_PAGE; + scroll_info_.nMin = 0; + scroll_info_.nMax = content_size; + scroll_info_.nPos = current_pos; + scroll_info_.nPage = viewport_size; + SetScrollInfo(sb_container_->GetScrollBarHWND(), SB_CTL, &scroll_info_, TRUE); } //////////////////////////////////////////////////////////////////////////////// @@ -344,4 +347,3 @@ int NativeScrollBarWrapper::GetVerticalScrollBarWidth() { } } // namespace views - diff --git a/views/controls/scrollbar/native_scroll_bar_win.h b/views/controls/scrollbar/native_scroll_bar_win.h index 566f036..ba7dc25 100644 --- a/views/controls/scrollbar/native_scroll_bar_win.h +++ b/views/controls/scrollbar/native_scroll_bar_win.h @@ -1,4 +1,4 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -51,7 +51,12 @@ class NativeScrollBarWin : public NativeControlWin, // sb_container_ is a custom hwnd that we use to wrap the real // windows scrollbar. We need to do this to get the scroll events // without having to do anything special in the high level hwnd. - ScrollBarContainer* sb_container_; + scoped_ptr<ScrollBarContainer> sb_container_; + + // Last scrollbar state we wrote to the scrollbar. We keep it here, so we can + // reinitialize the scrollbar to its previous state in case it gets hidden and + // recreated. + SCROLLINFO scroll_info_; DISALLOW_COPY_AND_ASSIGN(NativeScrollBarWin); }; @@ -59,4 +64,3 @@ class NativeScrollBarWin : public NativeControlWin, } // namespace views #endif // #ifndef VIEWS_CONTROLS_SCROLLBAR_NATIVE_SCROLL_BAR_WIN_H_ - diff --git a/views/controls/tabbed_pane/native_tabbed_pane_gtk.cc b/views/controls/tabbed_pane/native_tabbed_pane_gtk.cc index 8900de3..25705fc 100644 --- a/views/controls/tabbed_pane/native_tabbed_pane_gtk.cc +++ b/views/controls/tabbed_pane/native_tabbed_pane_gtk.cc @@ -75,6 +75,11 @@ View* NativeTabbedPaneGtk::RemoveTabAtIndex(int index) { // widget delete itself when native_view is deleted. gtk_notebook_remove_page(GTK_NOTEBOOK(native_view()), index); + // Removing a tab might change the size of the tabbed pane. + RootView* root_view = GetRootView(); + if (root_view) + GetRootView()->Layout(); + return removed_tab; } @@ -103,6 +108,19 @@ void NativeTabbedPaneGtk::SetFocus() { Focus(); } +gfx::Size NativeTabbedPaneGtk::GetPreferredSize() { + if (!native_view()) + return gfx::Size(); + + // For some strange reason (or maybe it's a bug), the requisition is not + // returned in the passed requisition parameter, but instead written to the + // widget's requisition field. + GtkRequisition requisition = { 0, 0 }; + gtk_widget_size_request(GTK_WIDGET(native_view()), &requisition); + GtkRequisition& size(GTK_WIDGET(native_view())->requisition); + return gfx::Size(size.width, size.height); +} + gfx::NativeView NativeTabbedPaneGtk::GetTestingHandle() const { return native_view(); } @@ -166,6 +184,11 @@ void NativeTabbedPaneGtk::DoAddTabAtIndex(int index, const std::wstring& title, if (tab_count == 0 && select_if_first_tab) gtk_notebook_set_current_page(GTK_NOTEBOOK(native_view()), 0); + + // Relayout the hierarchy, since the added tab might require more space. + RootView* root_view = GetRootView(); + if (root_view) + GetRootView()->Layout(); } WidgetGtk* NativeTabbedPaneGtk::GetWidgetAt(int index) { diff --git a/views/controls/tabbed_pane/native_tabbed_pane_gtk.h b/views/controls/tabbed_pane/native_tabbed_pane_gtk.h index d586e74..229faa5 100644 --- a/views/controls/tabbed_pane/native_tabbed_pane_gtk.h +++ b/views/controls/tabbed_pane/native_tabbed_pane_gtk.h @@ -1,4 +1,4 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -31,6 +31,7 @@ class NativeTabbedPaneGtk : public NativeControlGtk, virtual View* GetSelectedTab(); virtual View* GetView(); virtual void SetFocus(); + virtual gfx::Size GetPreferredSize(); virtual gfx::NativeView GetTestingHandle() const; // NativeControlGtk overrides. diff --git a/views/controls/tabbed_pane/native_tabbed_pane_win.cc b/views/controls/tabbed_pane/native_tabbed_pane_win.cc index 388cb56..838991f 100644 --- a/views/controls/tabbed_pane/native_tabbed_pane_win.cc +++ b/views/controls/tabbed_pane/native_tabbed_pane_win.cc @@ -46,12 +46,64 @@ class TabBackground : public Background { DISALLOW_COPY_AND_ASSIGN(TabBackground); }; +// Custom layout manager that takes care of sizing and displaying the tab pages. +class TabLayout : public LayoutManager { + public: + TabLayout() {} + + // Switches to the tab page identified by the given index. + void SwitchToPage(View* host, View* page) { + for (int i = 0; i < host->GetChildViewCount(); ++i) { + View* child = host->GetChildViewAt(i); + // The child might not have been laid out yet. + if (child == page) + child->SetBounds(gfx::Rect(host->size())); + child->SetVisible(child == page); + } + } + + private: + // LayoutManager overrides: + virtual void Layout(View* host) { + gfx::Rect bounds(host->size()); + for (int i = 0; i < host->GetChildViewCount(); ++i) { + View* child = host->GetChildViewAt(i); + // We only layout visible children, since it may be expensive. + if (child->IsVisible() && child->bounds() != bounds) + child->SetBounds(bounds); + } + } + + virtual gfx::Size GetPreferredSize(View* host) { + // First, query the preferred sizes to determine a good width. + int width = 0; + for (int i = 0; i < host->GetChildViewCount(); ++i) { + View* page = host->GetChildViewAt(i); + width = std::max(width, page->GetPreferredSize().width()); + } + // After we know the width, decide on the height. + return gfx::Size(width, GetPreferredHeightForWidth(host, width)); + } + + virtual int GetPreferredHeightForWidth(View* host, int width) { + int height = 0; + for (int i = 0; i < host->GetChildViewCount(); ++i) { + View* page = host->GetChildViewAt(i); + height = std::max(height, page->GetHeightForWidth(width)); + } + return height; + } + + DISALLOW_COPY_AND_ASSIGN(TabLayout); +}; + //////////////////////////////////////////////////////////////////////////////// // NativeTabbedPaneWin, public: NativeTabbedPaneWin::NativeTabbedPaneWin(TabbedPane* tabbed_pane) : NativeControlWin(), tabbed_pane_(tabbed_pane), + tab_layout_manager_(NULL), content_window_(NULL), selected_index_(-1) { // Associates the actual HWND with the tabbed-pane so the tabbed-pane is @@ -77,31 +129,32 @@ void NativeTabbedPaneWin::AddTabAtIndex(int index, const std::wstring& title, bool select_if_first_tab) { DCHECK(index <= static_cast<int>(tab_views_.size())); contents->set_parent_owned(false); + contents->SetVisible(false); tab_views_.insert(tab_views_.begin() + index, contents); tab_titles_.insert(tab_titles_.begin() + index, title); if (!contents->background()) contents->set_background(new TabBackground); - if (tab_views_.size() == 1 && select_if_first_tab) { - // If this is the only tab displayed, make sure the contents is set. + if (tab_views_.size() == 1 && select_if_first_tab) selected_index_ = 0; - if (content_window_) - content_window_->GetRootView()->AddChildView(contents); - } // Add native tab only if the native control is alreay created. if (content_window_) { - AddNativeTab(index, title, contents); - + AddNativeTab(index, title); // The newly added tab may have made the contents window smaller. ResizeContents(); + + RootView* content_root = content_window_->GetRootView(); + content_root->AddChildView(contents); + // Switch to the newly added tab if requested; + if (tab_views_.size() == 1 && select_if_first_tab) + tab_layout_manager_->SwitchToPage(content_root, contents); } } void NativeTabbedPaneWin::AddNativeTab(int index, - const std::wstring &title, - views::View* contents) { + const std::wstring &title) { TCITEM tcitem; tcitem.mask = TCIF_TEXT; @@ -140,6 +193,8 @@ View* NativeTabbedPaneWin::RemoveTabAtIndex(int index) { std::vector<View*>::iterator iter = tab_views_.begin() + index; View* removed_tab = *iter; + if (content_window_) + content_window_->GetRootView()->RemoveChildView(removed_tab); tab_views_.erase(iter); tab_titles_.erase(tab_titles_.begin() + index); @@ -176,6 +231,17 @@ void NativeTabbedPaneWin::SetFocus() { Focus(); } +gfx::Size NativeTabbedPaneWin::GetPreferredSize() { + if (!native_view()) + return gfx::Size(); + + gfx::Rect contentSize(content_window_->GetRootView()->GetPreferredSize()); + RECT paneSize = { 0, 0, contentSize.width(), contentSize.height() }; + TabCtrl_AdjustRect(native_view(), TRUE, &paneSize); + return gfx::Size(paneSize.right - paneSize.left, + paneSize.bottom - paneSize.top); +} + gfx::NativeView NativeTabbedPaneWin::GetTestingHandle() const { return native_view(); } @@ -225,7 +291,8 @@ void NativeTabbedPaneWin::CreateNativeControl() { l10n_util::HWNDSetRTLLayout(tab_control); RootView* root_view = content_window_->GetRootView(); - root_view->SetLayoutManager(new FillLayout()); + tab_layout_manager_ = new TabLayout(); + root_view->SetLayoutManager(tab_layout_manager_); DWORD sys_color = ::GetSysColor(COLOR_3DHILIGHT); SkColor color = SkColorSetRGB(GetRValue(sys_color), GetGValue(sys_color), GetBValue(sys_color)); @@ -287,9 +354,13 @@ void NativeTabbedPaneWin::ViewHierarchyChanged(bool is_add, // NativeTabbedPaneWin, private: void NativeTabbedPaneWin::InitializeTabs() { - for (size_t i = 0; i < tab_views_.size(); ++i) { - AddNativeTab(i, tab_titles_[i], tab_views_[i]); - } + for (size_t i = 0; i < tab_titles_.size(); ++i) + AddNativeTab(i, tab_titles_[i]); + + RootView* content_root = content_window_->GetRootView(); + for (std::vector<View*>::iterator tab(tab_views_.begin()); + tab != tab_views_.end(); ++tab) + content_root->AddChildView(*tab); } void NativeTabbedPaneWin::DoSelectTabAt(int index, boolean invoke_listener) { @@ -303,10 +374,7 @@ void NativeTabbedPaneWin::DoSelectTabAt(int index, boolean invoke_listener) { View* focused_view = focus_manager->GetFocusedView(); if (focused_view && content_root->IsParentOf(focused_view)) focus_manager->ClearFocus(); - - content_root->RemoveAllChildViews(false); - content_root->AddChildView(tab_views_[index]); - content_root->Layout(); + tab_layout_manager_->SwitchToPage(content_root, tab_views_.at(index)); } if (invoke_listener && tabbed_pane_->listener()) tabbed_pane_->listener()->TabSelectedAt(index); diff --git a/views/controls/tabbed_pane/native_tabbed_pane_win.h b/views/controls/tabbed_pane/native_tabbed_pane_win.h index c3dcaed..4e4cc2a 100644 --- a/views/controls/tabbed_pane/native_tabbed_pane_win.h +++ b/views/controls/tabbed_pane/native_tabbed_pane_win.h @@ -13,6 +13,7 @@ namespace views { class WidgetWin; +class TabLayout; class NativeTabbedPaneWin : public NativeControlWin, public NativeTabbedPaneWrapper { @@ -33,6 +34,7 @@ class NativeTabbedPaneWin : public NativeControlWin, virtual View* GetSelectedTab(); virtual View* GetView(); virtual void SetFocus(); + virtual gfx::Size GetPreferredSize(); virtual gfx::NativeView GetTestingHandle() const; // NativeControlWin overrides. @@ -57,7 +59,7 @@ class NativeTabbedPaneWin : public NativeControlWin, void InitializeTabs(); // Adds a tab with the given content to native control at the given index. - void AddNativeTab(int index, const std::wstring& title, View* contents); + void AddNativeTab(int index, const std::wstring& title); // Changes the contents view to the view associated with the tab at |index|. // |invoke_listener| controls if this methold should invoke the @@ -70,6 +72,9 @@ class NativeTabbedPaneWin : public NativeControlWin, // The tabbed-pane we are bound to. TabbedPane* tabbed_pane_; + // The layout manager we use for managing our tabs. + TabLayout* tab_layout_manager_; + // The views associated with the different tabs. std::vector<View*> tab_views_; diff --git a/views/controls/tabbed_pane/native_tabbed_pane_wrapper.h b/views/controls/tabbed_pane/native_tabbed_pane_wrapper.h index a051898..97c5fba 100644 --- a/views/controls/tabbed_pane/native_tabbed_pane_wrapper.h +++ b/views/controls/tabbed_pane/native_tabbed_pane_wrapper.h @@ -1,4 +1,4 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -56,6 +56,9 @@ class NativeTabbedPaneWrapper { // Sets the focus to the tabbed pane native view. virtual void SetFocus() = 0; + // Gets the preferred size of the tabbed pane. + virtual gfx::Size GetPreferredSize() = 0; + // Returns a handle to the underlying native view for testing. virtual gfx::NativeView GetTestingHandle() const = 0; diff --git a/views/controls/tabbed_pane/tabbed_pane.cc b/views/controls/tabbed_pane/tabbed_pane.cc index 5cb570a..1a7b0f0 100644 --- a/views/controls/tabbed_pane/tabbed_pane.cc +++ b/views/controls/tabbed_pane/tabbed_pane.cc @@ -102,10 +102,8 @@ void TabbedPane::LoadAccelerators() { } void TabbedPane::Layout() { - if (native_tabbed_pane_) { + if (native_tabbed_pane_) native_tabbed_pane_->GetView()->SetBounds(0, 0, width(), height()); - native_tabbed_pane_->GetView()->Layout(); - } } void TabbedPane::Focus() { @@ -129,4 +127,9 @@ bool TabbedPane::GetAccessibleRole(AccessibilityTypes::Role* role) { return true; } +gfx::Size TabbedPane::GetPreferredSize() { + return native_tabbed_pane_ ? + native_tabbed_pane_->GetPreferredSize() : gfx::Size(); +} + } // namespace views diff --git a/views/controls/tabbed_pane/tabbed_pane.h b/views/controls/tabbed_pane/tabbed_pane.h index 2fe503e..36026a0 100644 --- a/views/controls/tabbed_pane/tabbed_pane.h +++ b/views/controls/tabbed_pane/tabbed_pane.h @@ -13,7 +13,6 @@ class NativeTabbedPaneWrapper; // The TabbedPane class is a view that shows tabs. When the user clicks on a // tab, the associated view is displayed. -// TODO (jcampan): implement GetPreferredSize(). class TabbedPane : public View { public: @@ -72,6 +71,7 @@ class TabbedPane : public View { virtual void Focus(); virtual void PaintFocusBorder(gfx::Canvas* canvas); virtual bool GetAccessibleRole(AccessibilityTypes::Role* role); + virtual gfx::Size GetPreferredSize(); NativeTabbedPaneWrapper* native_wrapper() const { return native_tabbed_pane_; diff --git a/views/controls/tabbed_pane/tabbed_pane_unittest.cc b/views/controls/tabbed_pane/tabbed_pane_unittest.cc new file mode 100644 index 0000000..51a4acb --- /dev/null +++ b/views/controls/tabbed_pane/tabbed_pane_unittest.cc @@ -0,0 +1,83 @@ +// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "base/message_loop.h" +#include "testing/gtest/include/gtest/gtest.h" +#include "views/controls/tabbed_pane/tabbed_pane.h" +#include "views/window/window.h" +#include "views/window/window_delegate.h" + +namespace views { + +// A view for testing that takes a fixed preferred size upon construction. +class FixedSizeView : public View { + public: + FixedSizeView(const gfx::Size& size) + : size_(size) {} + + virtual gfx::Size GetPreferredSize() { + return size_; + } + + private: + const gfx::Size size_; + + DISALLOW_COPY_AND_ASSIGN(FixedSizeView); +}; + +class TabbedPaneTest : public testing::Test, WindowDelegate { + public: + TabbedPaneTest() {} + + TabbedPane* tabbed_pane_; + + private: + virtual void SetUp() { + tabbed_pane_ = new TabbedPane(); + window_ = Window::CreateChromeWindow(NULL, gfx::Rect(0, 0, 100, 100), this); + window_->Show(); + } + + virtual void TearDown() { + window_->Close(); + message_loop_.RunAllPending(); + } + + virtual views::View* GetContentsView() { + return tabbed_pane_; + } + + MessageLoopForUI message_loop_; + Window* window_; + + DISALLOW_COPY_AND_ASSIGN(TabbedPaneTest); +}; + +// Tests that TabbedPane::GetPreferredSize() and TabbedPane::Layout(). +TEST_F(TabbedPaneTest, SizeAndLayout) { + View* child1 = new FixedSizeView(gfx::Size(20, 10)); + tabbed_pane_->AddTab(L"tab1", child1); + View* child2 = new FixedSizeView(gfx::Size(5, 5)); + tabbed_pane_->AddTab(L"tab2", child2); + tabbed_pane_->SelectTabAt(0); + + // Check that the preferred size is larger than the largest child. + gfx::Size pref(tabbed_pane_->GetPreferredSize()); + EXPECT_GT(pref.width(), 20); + EXPECT_GT(pref.height(), 10); + + // The bounds of our children should be smaller than the tabbed pane's bounds. + tabbed_pane_->SetBounds(0, 0, 100, 200); + gfx::Rect bounds(child1->bounds()); + EXPECT_GT(bounds.width(), 0); + EXPECT_LT(bounds.width(), 100); + EXPECT_GT(bounds.height(), 0); + EXPECT_LT(bounds.height(), 200); + + // If we switch to the other tab, it should get assigned the same bounds. + tabbed_pane_->SelectTabAt(1); + EXPECT_EQ(bounds, child2->bounds()); +} + +} // namespace views diff --git a/views/controls/table/table_view.cc b/views/controls/table/table_view.cc index 8b86a6e..7ab4c91 100644 --- a/views/controls/table/table_view.cc +++ b/views/controls/table/table_view.cc @@ -64,7 +64,6 @@ TableView::TableView(TableModel* model, single_selection_(single_selection), ignore_listview_change_(false), custom_colors_enabled_(false), - sized_columns_(false), autosize_columns_(autosize_columns), resizable_columns_(resizable_columns), list_view_(NULL), @@ -133,10 +132,8 @@ void TableView::DidChangeBounds(const gfx::Rect& previous, return; SendMessage(list_view_, WM_SETREDRAW, static_cast<WPARAM>(FALSE), 0); Layout(); - if ((!sized_columns_ || autosize_columns_) && width() > 0) { - sized_columns_ = true; + if (autosize_columns_ && width() > 0) ResetColumnSizes(); - } UpdateContentOffset(); SendMessage(list_view_, WM_SETREDRAW, static_cast<WPARAM>(TRUE), 0); } @@ -1551,6 +1548,15 @@ gfx::Font TableView::GetAltTextFont() { return ResourceBundle::GetSharedInstance().GetFont(ResourceBundle::BaseFont); } +void TableView::VisibilityChanged(View* starting_from, bool is_visible) { + // GetClientRect as used by ResetColumnSize to obtain the total width + // available to the columns only works when the native control is visible, so + // update the column sizes in case we become visible. This depends on + // VisibilityChanged() being called in post order on the view tree. + if (is_visible && autosize_columns_) + ResetColumnSizes(); +} + // // TableSelectionIterator diff --git a/views/controls/table/table_view.h b/views/controls/table/table_view.h index f237df2..28d877e 100644 --- a/views/controls/table/table_view.h +++ b/views/controls/table/table_view.h @@ -407,6 +407,10 @@ class TableView : public NativeControl, // Returns the font used for alt text. gfx::Font GetAltTextFont(); + // Overriden in order to update the column sizes, which can only be sized + // accurately when the native control is available. + virtual void VisibilityChanged(View* starting_from, bool is_visible); + TableModel* model_; TableTypes table_type_; TableViewObserver* table_view_observer_; @@ -432,10 +436,6 @@ class TableView : public NativeControl, // Reflects the value passed to SetCustomColorsEnabled. bool custom_colors_enabled_; - // Whether or not the columns have been sized in the ListView. This is - // set to true the first time Layout() is invoked and we have a valid size. - bool sized_columns_; - // Whether or not columns should automatically be resized to fill the // the available width when the list view is resized. bool autosize_columns_; diff --git a/views/examples/tabbed_pane_example.h b/views/examples/tabbed_pane_example.h index 4b4bdfc..1b712a8 100644 --- a/views/examples/tabbed_pane_example.h +++ b/views/examples/tabbed_pane_example.h @@ -1,4 +1,4 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -109,4 +109,3 @@ class TabbedPaneExample : public ExampleBase, } // namespace examples #endif // VIEWS_EXAMPLES_TABBED_PANE_EXAMPLE_H_ - diff --git a/views/grid_layout.cc b/views/grid_layout.cc index b3f0625..5e685ac 100644 --- a/views/grid_layout.cc +++ b/views/grid_layout.cc @@ -844,22 +844,26 @@ void GridLayout::SizeRowsAndColumns(bool layout, int width, int height, if (rows_.empty()) return; - // Calculate the size of each of the columns. Some views preferred heights are - // derived from their width, as such we need to calculate the size of the - // columns first. + // Calculate the preferred width of each of the columns. Some views' + // preferred heights are derived from their width, as such we need to + // calculate the size of the columns first. for (std::vector<ColumnSet*>::iterator i = column_sets_.begin(); i != column_sets_.end(); ++i) { (*i)->CalculateSize(); - if (layout || width > 0) { - // We're doing a layout, divy up any extra space. - (*i)->Resize(width - (*i)->LayoutWidth() - left_inset_ - right_inset_); - // And reset the x coordinates. - (*i)->ResetColumnXCoordinates(); - } pref->set_width(std::max(pref->width(), (*i)->LayoutWidth())); } pref->set_width(pref->width() + left_inset_ + right_inset_); + // Go over the columns again and set them all to the size we settled for. + width = width ? width : pref->width(); + for (std::vector<ColumnSet*>::iterator i = column_sets_.begin(); + i != column_sets_.end(); ++i) { + // We're doing a layout, divy up any extra space. + (*i)->Resize(width - (*i)->LayoutWidth() - left_inset_ - right_inset_); + // And reset the x coordinates. + (*i)->ResetColumnXCoordinates(); + } + // Reset the height of each row. LayoutElement::ResetSizes(&rows_); @@ -1063,4 +1067,3 @@ views::GridLayout* CreatePanelGridLayout(views::View* host) { kPanelVertMargin, kPanelHorizMargin); return layout; } - diff --git a/views/grid_layout.h b/views/grid_layout.h index 6d6c61c..bb882ad 100644 --- a/views/grid_layout.h +++ b/views/grid_layout.h @@ -183,8 +183,7 @@ class GridLayout : public LayoutManager { // they both call into this method. This sizes the Columns/Rows as // appropriate. If layout is true, width/height give the width/height the // of the host, otherwise they are ignored. - void SizeRowsAndColumns(bool layout, int width, int height, - gfx::Size* pref); + void SizeRowsAndColumns(bool layout, int width, int height, gfx::Size* pref); // Calculates the master columns of all the column sets. See Column for // a description of what a master column is. diff --git a/views/grid_layout_unittest.cc b/views/grid_layout_unittest.cc index c5e56fd..a70ae5f 100644 --- a/views/grid_layout_unittest.cc +++ b/views/grid_layout_unittest.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -32,6 +32,25 @@ class SettableSizeView : public View { gfx::Size pref_; }; +// A view with fixed circumference that trades height for width. +class FlexibleView : public View { + public: + explicit FlexibleView(int circumference) { + circumference_ = circumference; + } + + virtual gfx::Size GetPreferredSize() { + return gfx::Size(0, circumference_ / 2); + } + + virtual int GetHeightForWidth(int width) { + return std::max(0, circumference_ / 2 - width); + } + + private: + int circumference_; +}; + class GridLayoutTest : public testing::Test { public: virtual void SetUp() { @@ -548,3 +567,42 @@ TEST_F(GridLayoutTest, ColumnSpanResizing) { // 4 + (6 * 4 / 6). ExpectViewBoundsEquals(4, 40, 8, 40, view2); } + +// Check that GetPreferredSize() takes resizing of columns into account when +// there is additional space in the case we have column sets of different +// preferred sizes. +TEST_F(GridLayoutTest, ColumnResizingOnGetPreferredSize) { + views::ColumnSet* set = layout->AddColumnSet(0); + set->AddColumn(views::GridLayout::FILL, views::GridLayout::CENTER, + 1, views::GridLayout::USE_PREF, 0, 0); + + set = layout->AddColumnSet(1); + set->AddColumn(views::GridLayout::FILL, views::GridLayout::CENTER, + 1, views::GridLayout::USE_PREF, 0, 0); + + set = layout->AddColumnSet(2); + set->AddColumn(views::GridLayout::FILL, views::GridLayout::CENTER, + 1, views::GridLayout::USE_PREF, 0, 0); + + // Make a row containing a flexible view that trades width for height. + layout->StartRow(0, 0); + View* view1 = new FlexibleView(100); + layout->AddView(view1, 1, 1, GridLayout::FILL, GridLayout::LEADING); + + // The second row contains a view of fixed size that will enforce a column + // width of 20 pixels. + layout->StartRow(0, 1); + View* view2 = new SettableSizeView(gfx::Size(20, 20)); + layout->AddView(view2, 1, 1, GridLayout::FILL, GridLayout::LEADING); + + // Add another flexible view in row three in order to ensure column set + // ordering doesn't influence sizing behaviour. + layout->StartRow(0, 2); + View* view3 = new FlexibleView(40); + layout->AddView(view3, 1, 1, GridLayout::FILL, GridLayout::LEADING); + + // We expect a height of 50: 30 from the variable width view in the first row + // plus 20 from the statically sized view in the second row. The flexible + // view in the third row should contribute no height. + EXPECT_EQ(gfx::Size(20, 50), layout->GetPreferredSize(&host)); +} diff --git a/views/view.cc b/views/view.cc index 90fb2bc..22b048b 100644 --- a/views/view.cc +++ b/views/view.cc @@ -218,17 +218,14 @@ void View::ScrollRectToVisible(const gfx::Rect& rect) { ///////////////////////////////////////////////////////////////////////////// void View::Layout() { - // Layout child Views + // If we have a layout manager, let it handle the layout for us. if (layout_manager_.get()) { layout_manager_->Layout(this); SchedulePaint(); - // TODO(beng): We believe the right thing to do here is return since the - // layout manager should be handling things, but it causes - // regressions (missing options from Options dialog and a hang - // in interactive_ui_tests). + return; } - // Lay out contents of child Views + // Otherwise, just pass on to the child views. for (int i = 0, count = GetChildViewCount(); i < count; ++i) { View* child = GetChildViewAt(i); child->Layout(); diff --git a/views/widget/widget_gtk.cc b/views/widget/widget_gtk.cc index 1e73e38..c9144d7 100644 --- a/views/widget/widget_gtk.cc +++ b/views/widget/widget_gtk.cc @@ -500,6 +500,8 @@ void WidgetGtk::Init(GtkWidget* parent, GDK_KEY_RELEASE_MASK); SetRootViewForWidget(widget_, root_view_.get()); + g_signal_connect_after(G_OBJECT(window_contents_), "size_request", + G_CALLBACK(&OnSizeRequestThunk), this); g_signal_connect_after(G_OBJECT(window_contents_), "size_allocate", G_CALLBACK(&OnSizeAllocateThunk), this); gtk_widget_set_app_paintable(window_contents_, true); @@ -883,6 +885,18 @@ int WidgetGtk::GetFlagsForEventButton(const GdkEventButton& event) { return flags; } +void WidgetGtk::OnSizeRequest(GtkWidget* widget, GtkRequisition* requisition) { + // Do only return the preferred size for child windows. GtkWindow interprets + // the requisition as a minimum size for top level windows, returning a + // preferred size for these would prevents us from setting smaller window + // sizes. + if (type_ == TYPE_CHILD) { + gfx::Size size(root_view_->GetPreferredSize()); + requisition->width = size.width(); + requisition->height = size.height(); + } +} + void WidgetGtk::OnSizeAllocate(GtkWidget* widget, GtkAllocation* allocation) { // See comment next to size_ as to why we do this. Also note, it's tempting // to put this in the static method so subclasses don't need to worry about diff --git a/views/widget/widget_gtk.h b/views/widget/widget_gtk.h index 816a263..3700aa3 100644 --- a/views/widget/widget_gtk.h +++ b/views/widget/widget_gtk.h @@ -223,6 +223,7 @@ class WidgetGtk // Event handlers: CHROMEGTK_CALLBACK_1(WidgetGtk, gboolean, OnButtonPress, GdkEventButton*); + CHROMEGTK_CALLBACK_1(WidgetGtk, void, OnSizeRequest, GtkRequisition*); CHROMEGTK_CALLBACK_1(WidgetGtk, void, OnSizeAllocate, GtkAllocation*); CHROMEGTK_CALLBACK_1(WidgetGtk, gboolean, OnPaint, GdkEventExpose*); CHROMEGTK_CALLBACK_4(WidgetGtk, void, OnDragDataGet, |