| OLD | NEW | 
|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be | 
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. | 
| 4 | 4 | 
| 5 #include "chrome/browser/ui/views/location_bar/location_bar_view.h" | 5 #include "chrome/browser/ui/views/location_bar/location_bar_view.h" | 
| 6 | 6 | 
| 7 #include <algorithm> | 7 #include <algorithm> | 
| 8 #include <map> | 8 #include <map> | 
| 9 | 9 | 
| 10 #include "base/feature_list.h" | 10 #include "base/feature_list.h" | 
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 96 #include "ui/views/widget/widget.h" | 96 #include "ui/views/widget/widget.h" | 
| 97 | 97 | 
| 98 #if !defined(OS_CHROMEOS) | 98 #if !defined(OS_CHROMEOS) | 
| 99 #include "chrome/browser/ui/views/first_run_bubble.h" | 99 #include "chrome/browser/ui/views/first_run_bubble.h" | 
| 100 #endif | 100 #endif | 
| 101 | 101 | 
| 102 #if defined(USE_AURA) | 102 #if defined(USE_AURA) | 
| 103 #include "ui/keyboard/keyboard_util.h" | 103 #include "ui/keyboard/keyboard_util.h" | 
| 104 #endif | 104 #endif | 
| 105 | 105 | 
|  | 106 #if defined(OS_WIN) | 
|  | 107 #include "ui/base/win/osk_display_manager.h" | 
|  | 108 #endif | 
|  | 109 | 
| 106 using content::WebContents; | 110 using content::WebContents; | 
| 107 using views::View; | 111 using views::View; | 
| 108 | 112 | 
| 109 | 113 | 
| 110 // LocationBarView ----------------------------------------------------------- | 114 // LocationBarView ----------------------------------------------------------- | 
| 111 | 115 | 
| 112 // static | 116 // static | 
| 113 const char LocationBarView::kViewClassName[] = "LocationBarView"; | 117 const char LocationBarView::kViewClassName[] = "LocationBarView"; | 
| 114 | 118 | 
| 115 LocationBarView::LocationBarView(Browser* browser, | 119 LocationBarView::LocationBarView(Browser* browser, | 
| (...skipping 618 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 734     omnibox_view_->model()->AcceptKeyword( | 738     omnibox_view_->model()->AcceptKeyword( | 
| 735         event.IsMouseEvent() ? KeywordModeEntryMethod::CLICK_ON_VIEW | 739         event.IsMouseEvent() ? KeywordModeEntryMethod::CLICK_ON_VIEW | 
| 736                              : KeywordModeEntryMethod::TAP_ON_VIEW); | 740                              : KeywordModeEntryMethod::TAP_ON_VIEW); | 
| 737   } else { | 741   } else { | 
| 738     DCHECK_EQ(clear_all_button_, sender); | 742     DCHECK_EQ(clear_all_button_, sender); | 
| 739     omnibox_view_->SetUserText(base::string16()); | 743     omnibox_view_->SetUserText(base::string16()); | 
| 740   } | 744   } | 
| 741 } | 745 } | 
| 742 | 746 | 
| 743 bool LocationBarView::IsVirtualKeyboardVisible() { | 747 bool LocationBarView::IsVirtualKeyboardVisible() { | 
| 744 #if defined(USE_AURA) | 748 #if defined(OS_WIN) | 
|  | 749   return ui::OnScreenKeyboardDisplayManager::GetInstance()->IsKeyboardVisible(); | 
|  | 750 #elif defined(USE_AURA) | 
| 745   return keyboard::IsKeyboardVisible(); | 751   return keyboard::IsKeyboardVisible(); | 
| 746 #else | 752 #else | 
| 747   return false; | 753   return false; | 
| 748 #endif | 754 #endif | 
| 749 } | 755 } | 
| 750 | 756 | 
| 751 bool LocationBarView::RefreshSaveCreditCardIconView() { | 757 bool LocationBarView::RefreshSaveCreditCardIconView() { | 
| 752   WebContents* web_contents = GetWebContents(); | 758   WebContents* web_contents = GetWebContents(); | 
| 753   if (!web_contents) | 759   if (!web_contents) | 
| 754     return false; | 760     return false; | 
| (...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 1087 // LocationBarView, private TemplateURLServiceObserver implementation: | 1093 // LocationBarView, private TemplateURLServiceObserver implementation: | 
| 1088 | 1094 | 
| 1089 void LocationBarView::OnTemplateURLServiceChanged() { | 1095 void LocationBarView::OnTemplateURLServiceChanged() { | 
| 1090   template_url_service_->RemoveObserver(this); | 1096   template_url_service_->RemoveObserver(this); | 
| 1091   template_url_service_ = nullptr; | 1097   template_url_service_ = nullptr; | 
| 1092   // If the browser is no longer active, let's not show the info bubble, as this | 1098   // If the browser is no longer active, let's not show the info bubble, as this | 
| 1093   // would make the browser the active window again. | 1099   // would make the browser the active window again. | 
| 1094   if (omnibox_view_ && omnibox_view_->GetWidget()->IsActive()) | 1100   if (omnibox_view_ && omnibox_view_->GetWidget()->IsActive()) | 
| 1095     ShowFirstRunBubble(); | 1101     ShowFirstRunBubble(); | 
| 1096 } | 1102 } | 
| OLD | NEW | 
|---|