This source file includes following definitions.
- OnAutocompleteAccept
- transition_
- HideOriginChip
- ShowOriginChip
#include "chrome/browser/ui/omnibox/omnibox_edit_controller.h"
#include "chrome/app/chrome_command_ids.h"
#include "chrome/browser/command_updater.h"
#include "chrome/browser/ui/toolbar/toolbar_model.h"
void OmniboxEditController::OnAutocompleteAccept(
const GURL& destination_url,
WindowOpenDisposition disposition,
content::PageTransition transition) {
destination_url_ = destination_url;
disposition_ = disposition;
transition_ = transition;
if (command_updater_)
command_updater_->ExecuteCommand(IDC_OPEN_CURRENT_URL);
}
OmniboxEditController::OmniboxEditController(CommandUpdater* command_updater)
: command_updater_(command_updater),
disposition_(CURRENT_TAB),
transition_(content::PageTransitionFromInt(
content::PAGE_TRANSITION_TYPED |
content::PAGE_TRANSITION_FROM_ADDRESS_BAR)) {
}
void OmniboxEditController::HideOriginChip() {
GetToolbarModel()->set_origin_chip_enabled(false);
OnChanged();
}
void OmniboxEditController::ShowOriginChip() {
if (GetToolbarModel()->url_replacement_enabled()) {
GetToolbarModel()->set_origin_chip_enabled(true);
OnChanged();
} else {
HideURL();
}
}
OmniboxEditController::~OmniboxEditController() {
}