| 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 // This file defines helper functions shared by the various implementations | 5 // This file defines helper functions shared by the various implementations |
| 6 // of OmniboxView. | 6 // of OmniboxView. |
| 7 | 7 |
| 8 #include "chrome/browser/ui/omnibox/omnibox_view.h" | 8 #include "chrome/browser/ui/omnibox/omnibox_view.h" |
| 9 | 9 |
| 10 #include "base/strings/string16.h" | 10 #include "base/strings/string16.h" |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 TextChanged(); | 122 TextChanged(); |
| 123 } | 123 } |
| 124 | 124 |
| 125 void OmniboxView::CloseOmniboxPopup() { | 125 void OmniboxView::CloseOmniboxPopup() { |
| 126 if (model_.get()) | 126 if (model_.get()) |
| 127 model_->StopAutocomplete(); | 127 model_->StopAutocomplete(); |
| 128 } | 128 } |
| 129 | 129 |
| 130 bool OmniboxView::IsImeShowingPopup() const { | 130 bool OmniboxView::IsImeShowingPopup() const { |
| 131 // Since not all the IMEs/platforms support the detection of a IME's popup | 131 // Since not all the IMEs/platforms support the detection of a IME's popup |
| 132 // window, falls back to IsImeComposing(). | 132 // window, returns false if unsure. |
| 133 return IsImeComposing(); | 133 return false; |
| 134 } | 134 } |
| 135 | 135 |
| 136 OmniboxView::OmniboxView(Profile* profile, | 136 OmniboxView::OmniboxView(Profile* profile, |
| 137 OmniboxEditController* controller, | 137 OmniboxEditController* controller, |
| 138 ToolbarModel* toolbar_model, | 138 ToolbarModel* toolbar_model, |
| 139 CommandUpdater* command_updater) | 139 CommandUpdater* command_updater) |
| 140 : controller_(controller), | 140 : controller_(controller), |
| 141 toolbar_model_(toolbar_model), | 141 toolbar_model_(toolbar_model), |
| 142 command_updater_(command_updater) { | 142 command_updater_(command_updater) { |
| 143 // |profile| can be NULL in tests. | 143 // |profile| can be NULL in tests. |
| 144 if (profile) | 144 if (profile) |
| 145 model_.reset(new OmniboxEditModel(this, controller, profile)); | 145 model_.reset(new OmniboxEditModel(this, controller, profile)); |
| 146 } | 146 } |
| 147 | 147 |
| 148 void OmniboxView::TextChanged() { | 148 void OmniboxView::TextChanged() { |
| 149 EmphasizeURLComponents(); | 149 EmphasizeURLComponents(); |
| 150 if (model_.get()) | 150 if (model_.get()) |
| 151 model_->OnChanged(); | 151 model_->OnChanged(); |
| 152 } | 152 } |
| OLD | NEW |