| Index: chrome/browser/ui/views/omnibox/omnibox_view_win.cc
|
| ===================================================================
|
| --- chrome/browser/ui/views/omnibox/omnibox_view_win.cc (revision 144499)
|
| +++ chrome/browser/ui/views/omnibox/omnibox_view_win.cc (working copy)
|
| @@ -1026,7 +1026,9 @@
|
| else
|
| InsertText(string_drop_position, text);
|
| } else {
|
| - PasteAndGo(CollapseWhitespace(text, true));
|
| + string16 collapsed_text(CollapseWhitespace(text, true));
|
| + if (model_->CanPasteAndGo(collapsed_text))
|
| + model_->PasteAndGo(collapsed_text);
|
| }
|
| return CopyOrLinkDragOperation(event.source_operations());
|
| }
|
| @@ -1035,11 +1037,6 @@
|
| return ui::DragDropTypes::DRAG_NONE;
|
| }
|
|
|
| -void OmniboxViewWin::PasteAndGo(const string16& text) {
|
| - if (CanPasteAndGo(text))
|
| - model_->PasteAndGo();
|
| -}
|
| -
|
| bool OmniboxViewWin::SkipDefaultKeyEventProcessing(
|
| const views::KeyEvent& event) {
|
| ui::KeyboardCode key = event.key_code();
|
| @@ -1111,7 +1108,7 @@
|
| case IDC_CUT: return !!CanCut();
|
| case IDC_COPY: return !!CanCopy();
|
| case IDC_PASTE: return !!CanPaste();
|
| - case IDS_PASTE_AND_GO: return CanPasteAndGo(GetClipboardText());
|
| + case IDS_PASTE_AND_GO: return model_->CanPasteAndGo(GetClipboardText());
|
| case IDS_SELECT_ALL: return !!CanSelectAll();
|
| case IDS_EDIT_SEARCH_ENGINES:
|
| return command_updater_->IsCommandEnabled(IDC_EDIT_SEARCH_ENGINES);
|
| @@ -1135,7 +1132,8 @@
|
|
|
| string16 OmniboxViewWin::GetLabelForCommandId(int command_id) const {
|
| DCHECK_EQ(IDS_PASTE_AND_GO, command_id);
|
| - return l10n_util::GetStringUTF16(model_->is_paste_and_search() ?
|
| + return l10n_util::GetStringUTF16(
|
| + model_->IsPasteAndSearch(GetClipboardText()) ?
|
| IDS_PASTE_AND_SEARCH : IDS_PASTE_AND_GO);
|
| }
|
|
|
| @@ -1144,7 +1142,7 @@
|
| if (command_id == IDS_PASTE_AND_GO) {
|
| // This case is separate from the switch() below since we don't want to wrap
|
| // it in OnBefore/AfterPossibleChange() calls.
|
| - model_->PasteAndGo();
|
| + model_->PasteAndGo(GetClipboardText());
|
| return;
|
| }
|
|
|
| @@ -2462,10 +2460,6 @@
|
| model_->OnChanged();
|
| }
|
|
|
| -bool OmniboxViewWin::CanPasteAndGo(const string16& text) const {
|
| - return !popup_window_mode_ && model_->CanPasteAndGo(text);
|
| -}
|
| -
|
| ITextDocument* OmniboxViewWin::GetTextObjectModel() const {
|
| if (!text_object_model_) {
|
| // This is lazily initialized, instead of being initialized in the
|
|
|