diff options
author | tc@google.com <tc@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-24 21:08:43 +0000 |
---|---|---|
committer | tc@google.com <tc@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-24 21:08:43 +0000 |
commit | df722f89f5ad78156319c5a0ff071641a205a78d (patch) | |
tree | 09e76fd83a7d1f05eb7084f75a5f10eaf8a58cde /chrome/browser/autocomplete | |
parent | b13e3fb787be91e19c66df036a231a2e84a7d321 (diff) | |
download | chromium_src-df722f89f5ad78156319c5a0ff071641a205a78d.zip chromium_src-df722f89f5ad78156319c5a0ff071641a205a78d.tar.gz chromium_src-df722f89f5ad78156319c5a0ff071641a205a78d.tar.bz2 |
Implement location only display mode (used by popup windows).
This matches the pixel sizes on Windows. The location bar is
a couple pixels shorter and the font is a little smaller.
BUG=17580
Review URL: http://codereview.chromium.org/159303
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@21578 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/autocomplete')
-rw-r--r-- | chrome/browser/autocomplete/autocomplete_edit_view_gtk.cc | 11 | ||||
-rw-r--r-- | chrome/browser/autocomplete/autocomplete_edit_view_gtk.h | 4 |
2 files changed, 11 insertions, 4 deletions
diff --git a/chrome/browser/autocomplete/autocomplete_edit_view_gtk.cc b/chrome/browser/autocomplete/autocomplete_edit_view_gtk.cc index 4a2d975..d44f8f0 100644 --- a/chrome/browser/autocomplete/autocomplete_edit_view_gtk.cc +++ b/chrome/browser/autocomplete/autocomplete_edit_view_gtk.cc @@ -70,6 +70,7 @@ AutocompleteEditViewGtk::AutocompleteEditViewGtk( ToolbarModel* toolbar_model, Profile* profile, CommandUpdater* command_updater, + bool popup_window_mode, AutocompletePopupPositioner* popup_positioner) : text_view_(NULL), tag_table_(NULL), @@ -83,7 +84,7 @@ AutocompleteEditViewGtk::AutocompleteEditViewGtk( controller_(controller), toolbar_model_(toolbar_model), command_updater_(command_updater), - popup_window_mode_(false), // TODO(deanm) + popup_window_mode_(popup_window_mode), scheme_security_level_(ToolbarModel::NORMAL), selection_saved_(false), mark_set_handler_id_(0), @@ -125,9 +126,15 @@ void AutocompleteEditViewGtk::Init() { tag_table_ = gtk_text_tag_table_new(); text_buffer_ = gtk_text_buffer_new(tag_table_); text_view_ = gtk_text_view_new_with_buffer(text_buffer_); + if (popup_window_mode_) + gtk_text_view_set_editable(GTK_TEXT_VIEW(text_view_), false); if (browser_defaults::kForceAutocompleteEditFontSize) { // Until we switch to vector graphics, force the font size. - gtk_util::ForceFontSizePixels(text_view_, 13.4); // 13.4px == 10pt @ 96dpi + const double kFontSize = 13.4; // 13.4px == 10pt @ 96dpi + // On Windows, popups have a font size 5/6 the size of non-popups. + const double kPopupWindowFontSize = kFontSize * 5.0 / 6.0; + gtk_util::ForceFontSizePixels(text_view_, + popup_window_mode_ ? kPopupWindowFontSize : kFontSize); } // Override the background color for now. http://crbug.com/12195 diff --git a/chrome/browser/autocomplete/autocomplete_edit_view_gtk.h b/chrome/browser/autocomplete/autocomplete_edit_view_gtk.h index c0f6dd4..720dd00 100644 --- a/chrome/browser/autocomplete/autocomplete_edit_view_gtk.h +++ b/chrome/browser/autocomplete/autocomplete_edit_view_gtk.h @@ -42,6 +42,7 @@ class AutocompleteEditViewGtk : public AutocompleteEditView { ToolbarModel* toolbar_model, Profile* profile, CommandUpdater* command_updater, + bool popup_window_mode, AutocompletePopupPositioner* popup_positioner); ~AutocompleteEditViewGtk(); @@ -280,8 +281,7 @@ class AutocompleteEditViewGtk : public AutocompleteEditView { CommandUpdater* command_updater_; // When true, the location bar view is read only and also is has a slightly - // different presentation (font size / color). This is used for popups. - // TODO(deanm). + // different presentation (smaller font size). This is used for popups. bool popup_window_mode_; ToolbarModel::SecurityLevel scheme_security_level_; |