| 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/omnibox/omnibox_edit_model.h" | 5 #include "chrome/browser/ui/omnibox/omnibox_edit_model.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/format_macros.h" | 9 #include "base/format_macros.h" |
| 10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
| (...skipping 431 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 442 if (popup_->IsOpen() && !in_revert_) { | 442 if (popup_->IsOpen() && !in_revert_) { |
| 443 InstantController* instant = controller_->GetInstant(); | 443 InstantController* instant = controller_->GetInstant(); |
| 444 if (instant && !instant->commit_on_pointer_release()) | 444 if (instant && !instant->commit_on_pointer_release()) |
| 445 instant->DestroyPreviewContents(); | 445 instant->DestroyPreviewContents(); |
| 446 } | 446 } |
| 447 | 447 |
| 448 autocomplete_controller_->Stop(true); | 448 autocomplete_controller_->Stop(true); |
| 449 } | 449 } |
| 450 | 450 |
| 451 bool OmniboxEditModel::CanPasteAndGo(const string16& text) const { | 451 bool OmniboxEditModel::CanPasteAndGo(const string16& text) const { |
| 452 if (!view_->GetCommandUpdater()->IsCommandEnabled(IDC_OPEN_CURRENT_URL)) | 452 if (!view_->command_updater()->IsCommandEnabled(IDC_OPEN_CURRENT_URL)) |
| 453 return false; | 453 return false; |
| 454 | 454 |
| 455 AutocompleteMatch match; | 455 AutocompleteMatch match; |
| 456 ClassifyStringForPasteAndGo(text, &match, NULL); | 456 ClassifyStringForPasteAndGo(text, &match, NULL); |
| 457 return match.destination_url.is_valid(); | 457 return match.destination_url.is_valid(); |
| 458 } | 458 } |
| 459 | 459 |
| 460 void OmniboxEditModel::PasteAndGo(const string16& text) { | 460 void OmniboxEditModel::PasteAndGo(const string16& text) { |
| 461 DCHECK(CanPasteAndGo(text)); | 461 DCHECK(CanPasteAndGo(text)); |
| 462 view_->RevertAll(); | 462 view_->RevertAll(); |
| (...skipping 728 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1191 } | 1191 } |
| 1192 | 1192 |
| 1193 void OmniboxEditModel::ClassifyStringForPasteAndGo( | 1193 void OmniboxEditModel::ClassifyStringForPasteAndGo( |
| 1194 const string16& text, | 1194 const string16& text, |
| 1195 AutocompleteMatch* match, | 1195 AutocompleteMatch* match, |
| 1196 GURL* alternate_nav_url) const { | 1196 GURL* alternate_nav_url) const { |
| 1197 DCHECK(match); | 1197 DCHECK(match); |
| 1198 AutocompleteClassifierFactory::GetForProfile(profile_)->Classify(text, | 1198 AutocompleteClassifierFactory::GetForProfile(profile_)->Classify(text, |
| 1199 string16(), false, false, match, alternate_nav_url); | 1199 string16(), false, false, match, alternate_nav_url); |
| 1200 } | 1200 } |
| OLD | NEW |