#include "chrome/app/chrome_command_ids.h"
#include "chrome/browser/autocomplete/autocomplete_classifier.h"
#include "chrome/browser/autocomplete/autocomplete_classifier_factory.h"
+#include "chrome/browser/autocomplete/autocomplete_input.h"
#include "chrome/browser/autocomplete/autocomplete_match.h"
#include "chrome/browser/chrome_notification_types.h"
#include "chrome/browser/command_updater.h"
}
- (void)focusLocationBar:(BOOL)selectAll {
- if (locationBarView_.get())
- locationBarView_->FocusLocation(selectAll ? true : false);
+ if (locationBarView_.get()) {
+ if (selectAll &&
+ locationBarView_->GetToolbarModel()->WouldOmitURLDueToOriginChip()) {
+ // select_all is true when it's expected that the user may want to copy
+ // the URL to the clipboard. If the origin chip is being displayed (and
+ // thus the URL is not being shown in the Omnibox) show it now to support
+ // the same functionality.
+ locationBarView_->GetOmniboxView()->ShowURL();
+ } else {
+ locationBarView_->FocusLocation(selectAll ? true : false);
+ }
+ }
}
// Called when the state for a command changes to |enabled|. Update the
// If the input is plain text, classify the input and make the URL.
AutocompleteMatch match;
AutocompleteClassifierFactory::GetForProfile(browser_->profile())->Classify(
- base::SysNSStringToUTF16(text), false, false, &match, NULL);
+ base::SysNSStringToUTF16(text), false, false, AutocompleteInput::BLANK,
+ &match, NULL);
GURL url(match.destination_url);
OpenURLParams params(