| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/ui/views/omnibox/omnibox_view_views.h" | 5 #include "chrome/browser/ui/views/omnibox/omnibox_view_views.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/string_util.h" | 8 #include "base/string_util.h" |
| 9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
| 10 #include "chrome/app/chrome_command_ids.h" | 10 #include "chrome/app/chrome_command_ids.h" |
| 11 #include "chrome/browser/autocomplete/autocomplete_edit.h" | 11 #include "chrome/browser/autocomplete/autocomplete_edit.h" |
| 12 #include "chrome/browser/autocomplete/autocomplete_match.h" | 12 #include "chrome/browser/autocomplete/autocomplete_match.h" |
| 13 #include "chrome/browser/autocomplete/autocomplete_popup_model.h" | 13 #include "chrome/browser/autocomplete/autocomplete_popup_model.h" |
| 14 #include "chrome/browser/command_updater.h" | 14 #include "chrome/browser/command_updater.h" |
| 15 #include "chrome/browser/ui/view_ids.h" |
| 15 #include "chrome/browser/ui/views/autocomplete/autocomplete_popup_contents_view.
h" | 16 #include "chrome/browser/ui/views/autocomplete/autocomplete_popup_contents_view.
h" |
| 16 #include "chrome/browser/ui/views/location_bar/location_bar_view.h" | 17 #include "chrome/browser/ui/views/location_bar/location_bar_view.h" |
| 17 #include "chrome/common/chrome_notification_types.h" | 18 #include "chrome/common/chrome_notification_types.h" |
| 18 #include "content/browser/tab_contents/tab_contents.h" | 19 #include "content/browser/tab_contents/tab_contents.h" |
| 19 #include "googleurl/src/gurl.h" | 20 #include "googleurl/src/gurl.h" |
| 20 #include "grit/generated_resources.h" | 21 #include "grit/generated_resources.h" |
| 21 #include "net/base/escape.h" | 22 #include "net/base/escape.h" |
| 22 #include "third_party/skia/include/core/SkColor.h" | 23 #include "third_party/skia/include/core/SkColor.h" |
| 23 #include "ui/base/accessibility/accessible_view_state.h" | 24 #include "ui/base/accessibility/accessible_view_state.h" |
| 24 #include "ui/base/dragdrop/drag_drop_types.h" | 25 #include "ui/base/dragdrop/drag_drop_types.h" |
| (...skipping 15 matching lines...) Expand all Loading... |
| 40 | 41 |
| 41 // Textfield for autocomplete that intercepts events that are necessary | 42 // Textfield for autocomplete that intercepts events that are necessary |
| 42 // for OmniboxViewViews. | 43 // for OmniboxViewViews. |
| 43 class AutocompleteTextfield : public views::Textfield { | 44 class AutocompleteTextfield : public views::Textfield { |
| 44 public: | 45 public: |
| 45 explicit AutocompleteTextfield(OmniboxViewViews* omnibox_view) | 46 explicit AutocompleteTextfield(OmniboxViewViews* omnibox_view) |
| 46 : views::Textfield(views::Textfield::STYLE_DEFAULT), | 47 : views::Textfield(views::Textfield::STYLE_DEFAULT), |
| 47 omnibox_view_(omnibox_view) { | 48 omnibox_view_(omnibox_view) { |
| 48 DCHECK(omnibox_view_); | 49 DCHECK(omnibox_view_); |
| 49 RemoveBorder(); | 50 RemoveBorder(); |
| 51 set_id(VIEW_ID_OMNIBOX); |
| 50 } | 52 } |
| 51 | 53 |
| 52 // views::View implementation | 54 // views::View implementation |
| 53 virtual void OnFocus() OVERRIDE { | 55 virtual void OnFocus() OVERRIDE { |
| 54 views::Textfield::OnFocus(); | 56 views::Textfield::OnFocus(); |
| 55 omnibox_view_->HandleFocusIn(); | 57 omnibox_view_->HandleFocusIn(); |
| 56 } | 58 } |
| 57 | 59 |
| 58 virtual void OnBlur() OVERRIDE { | 60 virtual void OnBlur() OVERRIDE { |
| 59 views::Textfield::OnBlur(); | 61 views::Textfield::OnBlur(); |
| (...skipping 679 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 739 OmniboxViewViews* omnibox_view = new OmniboxViewViews(controller, | 741 OmniboxViewViews* omnibox_view = new OmniboxViewViews(controller, |
| 740 toolbar_model, | 742 toolbar_model, |
| 741 profile, | 743 profile, |
| 742 command_updater, | 744 command_updater, |
| 743 popup_window_mode, | 745 popup_window_mode, |
| 744 location_bar); | 746 location_bar); |
| 745 omnibox_view->Init(); | 747 omnibox_view->Init(); |
| 746 return omnibox_view; | 748 return omnibox_view; |
| 747 } | 749 } |
| 748 #endif | 750 #endif |
| OLD | NEW |