omnibox_edit_controller.cc revision 4e180b6a0b4720a9b8e9e959a882386f690f08ff
14e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles)// Copyright (c) 2013 The Chromium Authors. All rights reserved. 24e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles)// Use of this source code is governed by a BSD-style license that can be 34e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles)// found in the LICENSE file. 44e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles) 54e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles)#include "chrome/browser/ui/omnibox/omnibox_edit_controller.h" 64e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles) 74e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles)#include "chrome/app/chrome_command_ids.h" 84e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles)#include "chrome/browser/command_updater.h" 94e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles) 104e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles)void OmniboxEditController::OnAutocompleteAccept( 114e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles) const GURL& destination_url, 124e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles) WindowOpenDisposition disposition, 134e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles) content::PageTransition transition) { 144e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles) destination_url_ = destination_url; 154e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles) disposition_ = disposition; 164e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles) transition_ = transition; 174e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles) if (command_updater_) 184e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles) command_updater_->ExecuteCommand(IDC_OPEN_CURRENT_URL); 194e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles)} 204e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles) 214e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles)OmniboxEditController::OmniboxEditController(CommandUpdater* command_updater) 224e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles) : command_updater_(command_updater), 234e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles) disposition_(CURRENT_TAB), 244e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles) transition_(content::PageTransitionFromInt( 254e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles) content::PAGE_TRANSITION_TYPED | 264e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles) content::PAGE_TRANSITION_FROM_ADDRESS_BAR)) { 274e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles)} 284e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles) 294e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles)OmniboxEditController::~OmniboxEditController() { 304e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles)} 31