| Index: chrome/browser/ui/views/omnibox/omnibox_view_views.cc
|
| diff --git a/chrome/browser/ui/views/omnibox/omnibox_view_views.cc b/chrome/browser/ui/views/omnibox/omnibox_view_views.cc
|
| index f6212641d21c8a69135c2e723696fee42ff51a16..34349bf533b89ea981c7ccf6f77acf112595d3e6 100644
|
| --- a/chrome/browser/ui/views/omnibox/omnibox_view_views.cc
|
| +++ b/chrome/browser/ui/views/omnibox/omnibox_view_views.cc
|
| @@ -28,6 +28,7 @@
|
| #include "ui/gfx/render_text.h"
|
| #include "views/border.h"
|
| #include "views/controls/textfield/textfield.h"
|
| +#include "views/events/event.h"
|
| #include "views/layout/fill_layout.h"
|
|
|
| #if defined(TOUCH_UI)
|
| @@ -79,6 +80,10 @@ class AutocompleteTextfield : public views::Textfield {
|
| return views::View::IsFocusable();
|
| }
|
|
|
| + virtual bool OnMousePressed(const views::MouseEvent& event) OVERRIDE {
|
| + return omnibox_view_->HandleMousePressEvent(event);
|
| + }
|
| +
|
| private:
|
| OmniboxViewViews* omnibox_view_;
|
|
|
| @@ -266,6 +271,16 @@ bool OmniboxViewViews::HandleKeyReleaseEvent(const views::KeyEvent& event) {
|
| return false;
|
| }
|
|
|
| +bool OmniboxViewViews::HandleMousePressEvent(const views::MouseEvent& event) {
|
| + if (!textfield_->HasFocus() && !textfield_->HasSelection()) {
|
| + textfield_->SelectAll();
|
| + textfield_->RequestFocus();
|
| + return true;
|
| + }
|
| +
|
| + return false;
|
| +}
|
| +
|
| void OmniboxViewViews::HandleFocusIn() {
|
| // TODO(oshima): Get control key state.
|
| model_->OnSetFocus(false);
|
|
|