| 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/omnibox/omnibox_view_views.h" | 5 #include "chrome/browser/ui/views/omnibox/omnibox_view_views.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/metrics/histogram.h" | 9 #include "base/metrics/histogram.h" |
| 10 #include "base/strings/string_util.h" | 10 #include "base/strings/string_util.h" |
| (...skipping 676 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 687 | 687 |
| 688 bool OmniboxViewViews::IsImeShowingPopup() const { | 688 bool OmniboxViewViews::IsImeShowingPopup() const { |
| 689 #if defined(OS_CHROMEOS) | 689 #if defined(OS_CHROMEOS) |
| 690 return ime_candidate_window_open_; | 690 return ime_candidate_window_open_; |
| 691 #else | 691 #else |
| 692 const views::InputMethod* input_method = this->GetInputMethod(); | 692 const views::InputMethod* input_method = this->GetInputMethod(); |
| 693 return input_method && input_method->IsCandidatePopupOpen(); | 693 return input_method && input_method->IsCandidatePopupOpen(); |
| 694 #endif | 694 #endif |
| 695 } | 695 } |
| 696 | 696 |
| 697 void OmniboxViewViews::ShowImeIfNeeded() { |
| 698 GetInputMethod()->ShowImeIfNeeded(); |
| 699 } |
| 700 |
| 697 //////////////////////////////////////////////////////////////////////////////// | 701 //////////////////////////////////////////////////////////////////////////////// |
| 698 // OmniboxViewViews, views::TextfieldController implementation: | 702 // OmniboxViewViews, views::TextfieldController implementation: |
| 699 | 703 |
| 700 void OmniboxViewViews::ContentsChanged(views::Textfield* sender, | 704 void OmniboxViewViews::ContentsChanged(views::Textfield* sender, |
| 701 const base::string16& new_contents) { | 705 const base::string16& new_contents) { |
| 702 } | 706 } |
| 703 | 707 |
| 704 bool OmniboxViewViews::HandleKeyEvent(views::Textfield* textfield, | 708 bool OmniboxViewViews::HandleKeyEvent(views::Textfield* textfield, |
| 705 const ui::KeyEvent& event) { | 709 const ui::KeyEvent& event) { |
| 706 delete_at_end_pressed_ = false; | 710 delete_at_end_pressed_ = false; |
| (...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 975 const base::string16 text(GetClipboardText()); | 979 const base::string16 text(GetClipboardText()); |
| 976 if (!text.empty()) { | 980 if (!text.empty()) { |
| 977 // Record this paste, so we can do different behavior. | 981 // Record this paste, so we can do different behavior. |
| 978 model()->OnPaste(); | 982 model()->OnPaste(); |
| 979 // Force a Paste operation to trigger the text_changed code in | 983 // Force a Paste operation to trigger the text_changed code in |
| 980 // OnAfterPossibleChange(), even if identical contents are pasted. | 984 // OnAfterPossibleChange(), even if identical contents are pasted. |
| 981 text_before_change_.clear(); | 985 text_before_change_.clear(); |
| 982 InsertOrReplaceText(text); | 986 InsertOrReplaceText(text); |
| 983 } | 987 } |
| 984 } | 988 } |
| OLD | NEW |