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

Unified Diff: chrome/browser/ui/views/location_bar/keyword_hint_view.cc

Issue 2815523003: Guard ui/keyboard include (which is Aura-only) in location_bar/keyword_hint_view.cc (Closed)
Patch Set: Created 3 years, 8 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: chrome/browser/ui/views/location_bar/keyword_hint_view.cc
diff --git a/chrome/browser/ui/views/location_bar/keyword_hint_view.cc b/chrome/browser/ui/views/location_bar/keyword_hint_view.cc
index 1e1fed8a465a8e08f47caee882636523590c2833..2c0db47e9c027d48e0686b733789a504bca20eb5 100644
--- a/chrome/browser/ui/views/location_bar/keyword_hint_view.cc
+++ b/chrome/browser/ui/views/location_bar/keyword_hint_view.cc
@@ -17,11 +17,14 @@
#include "components/search_engines/template_url_service.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/gfx/color_utils.h"
-#include "ui/keyboard/keyboard_util.h"
#include "ui/strings/grit/ui_strings.h"
#include "ui/views/border.h"
#include "ui/views/controls/label.h"
+#if defined(USE_AURA)
+#include "ui/keyboard/keyboard_util.h"
+#endif
+
namespace {
// This view looks somewhat like a keyboard key.
@@ -37,6 +40,14 @@ class KeyboardKeyView : public views::Label {
DISALLOW_COPY_AND_ASSIGN(KeyboardKeyView);
};
+bool IsVirtualKeyboardVisible() {
+#if defined(USE_AURA)
+ return keyboard::IsKeyboardVisible();
+#else
+ return false;
+#endif
+}
+
KeyboardKeyView::KeyboardKeyView(const gfx::FontList& font_list)
: views::Label(base::string16(), {font_list}) {
SetBorder(views::CreateEmptyBorder(
@@ -99,7 +110,7 @@ void KeywordHintView::SetKeyword(const base::string16& keyword) {
base::string16 short_name(
url_service->GetKeywordShortName(keyword, &is_extension_keyword));
- if (keyboard::IsKeyboardVisible()) {
+ if (IsVirtualKeyboardVisible()) {
int message_id = is_extension_keyword
? IDS_OMNIBOX_EXTENSION_KEYWORD_HINT_TOUCH
: IDS_OMNIBOX_KEYWORD_HINT_TOUCH;
« 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