Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1212)

Unified Diff: webkit/glue/webview_impl.cc

Issue 20030: Autocomplete popup uses its own style (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/glue/webview_impl.cc
===================================================================
--- webkit/glue/webview_impl.cc (revision 8974)
+++ webkit/glue/webview_impl.cc (working copy)
@@ -36,6 +36,7 @@
#include "base/compiler_specific.h"
MSVC_PUSH_WARNING_LEVEL(0);
#include "CSSStyleSelector.h"
+#include "CSSValueKeywords.h"
#include "Cursor.h"
#include "Document.h"
#include "DocumentLoader.h"
@@ -132,6 +133,18 @@
: text_field_(text_field),
selected_index_(default_suggestion_index),
webview_(webview) {
+ FontDescription font_description;
+#if defined(OS_WIN)
+ theme()->systemFont(CSSValueWebkitControl, text_field->document(),
+ font_description);
+#else
+ NOTIMPLEMENTED();
+#endif
+ // Use a smaller font size to match IE/Firefox.
+ font_description.setComputedSize(12.0);
ojan 2009/02/04 02:12:47 Please add a TODO to make sure that this works wel
+ Font font(font_description, 0, 0);
+ font.update(text_field->document()->styleSelector()->fontSelector());
+ style_.reset(new PopupMenuStyle(Color::black, Color::white, font, true));
SetSuggestions(suggestions);
}
virtual ~AutocompletePopupMenuClient() {
@@ -150,15 +163,11 @@
}
virtual PopupMenuStyle itemStyle(unsigned listIndex) const {
- return menuStyle();
+ return *style_;
}
virtual PopupMenuStyle menuStyle() const {
- RenderStyle* style = text_field_->renderStyle() ?
- text_field_->renderStyle() :
- text_field_->computedStyle();
- return PopupMenuStyle(style->color(), Color::white, style->font(),
- style->visibility() == VISIBLE);
+ return *style_;
}
virtual int clientInsetLeft() const {
@@ -250,6 +259,7 @@
std::vector<WebCore::String> suggestions_;
int selected_index_;
WebViewImpl* webview_;
+ scoped_ptr<PopupMenuStyle> style_;
};
// WebView ----------------------------------------------------------------
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698