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/strings/string_util.h" | 9 #include "base/strings/string_util.h" |
10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
(...skipping 567 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
578 } | 578 } |
579 | 579 |
580 bool OmniboxViewViews::IsImeComposing() const { | 580 bool OmniboxViewViews::IsImeComposing() const { |
581 return IsIMEComposing(); | 581 return IsIMEComposing(); |
582 } | 582 } |
583 | 583 |
584 bool OmniboxViewViews::IsImeShowingPopup() const { | 584 bool OmniboxViewViews::IsImeShowingPopup() const { |
585 #if defined(OS_CHROMEOS) | 585 #if defined(OS_CHROMEOS) |
586 return ime_candidate_window_open_; | 586 return ime_candidate_window_open_; |
587 #else | 587 #else |
588 // TODO(yukishiino): Implement detection of candidate windows on Windows. | 588 views::InputMethod* input_method = |
589 // We can detect whether any candidate window is open or not on Windows. | 589 const_cast<OmniboxViewViews*>(this)->GetInputMethod(); |
590 // Currently we simply fall back to IsImeComposing() as a second best way. | 590 return input_method && input_method->IsPopupOpen(); |
591 return IsImeComposing(); | |
592 #endif | 591 #endif |
593 } | 592 } |
594 | 593 |
595 int OmniboxViewViews::GetMaxEditWidth(int entry_width) const { | 594 int OmniboxViewViews::GetMaxEditWidth(int entry_width) const { |
596 return entry_width; | 595 return entry_width; |
597 } | 596 } |
598 | 597 |
599 views::View* OmniboxViewViews::AddToView(views::View* parent) { | 598 views::View* OmniboxViewViews::AddToView(views::View* parent) { |
600 parent->AddChildView(this); | 599 parent->AddChildView(this); |
601 return this; | 600 return this; |
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
888 const string16 text(GetClipboardText()); | 887 const string16 text(GetClipboardText()); |
889 if (!text.empty()) { | 888 if (!text.empty()) { |
890 // Record this paste, so we can do different behavior. | 889 // Record this paste, so we can do different behavior. |
891 model()->on_paste(); | 890 model()->on_paste(); |
892 // Force a Paste operation to trigger the text_changed code in | 891 // Force a Paste operation to trigger the text_changed code in |
893 // OnAfterPossibleChange(), even if identical contents are pasted. | 892 // OnAfterPossibleChange(), even if identical contents are pasted. |
894 text_before_change_.clear(); | 893 text_before_change_.clear(); |
895 ReplaceSelection(text); | 894 ReplaceSelection(text); |
896 } | 895 } |
897 } | 896 } |
OLD | NEW |