| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #ifndef CHROME_BROWSER_UI_VIEWS_OMNIBOX_OMNIBOX_POPUP_CONTENTS_VIEW_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_OMNIBOX_OMNIBOX_POPUP_CONTENTS_VIEW_H_ |
| 6 #define CHROME_BROWSER_UI_VIEWS_OMNIBOX_OMNIBOX_POPUP_CONTENTS_VIEW_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_OMNIBOX_OMNIBOX_POPUP_CONTENTS_VIEW_H_ |
| 7 | 7 |
| 8 #include "base/memory/weak_ptr.h" | 8 #include "base/memory/weak_ptr.h" |
| 9 #include "components/omnibox/browser/omnibox_popup_model.h" | 9 #include "components/omnibox/browser/omnibox_popup_model.h" |
| 10 #include "components/omnibox/browser/omnibox_popup_view.h" | 10 #include "components/omnibox/browser/omnibox_popup_view.h" |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 void OnMouseMoved(const ui::MouseEvent& event) override; | 61 void OnMouseMoved(const ui::MouseEvent& event) override; |
| 62 void OnMouseEntered(const ui::MouseEvent& event) override; | 62 void OnMouseEntered(const ui::MouseEvent& event) override; |
| 63 void OnMouseExited(const ui::MouseEvent& event) override; | 63 void OnMouseExited(const ui::MouseEvent& event) override; |
| 64 void OnGestureEvent(ui::GestureEvent* event) override; | 64 void OnGestureEvent(ui::GestureEvent* event) override; |
| 65 | 65 |
| 66 bool IsSelectedIndex(size_t index) const; | 66 bool IsSelectedIndex(size_t index) const; |
| 67 bool IsHoveredIndex(size_t index) const; | 67 bool IsHoveredIndex(size_t index) const; |
| 68 gfx::Image GetIconIfExtensionMatch(size_t index) const; | 68 gfx::Image GetIconIfExtensionMatch(size_t index) const; |
| 69 bool IsStarredMatch(const AutocompleteMatch& match) const; | 69 bool IsStarredMatch(const AutocompleteMatch& match) const; |
| 70 | 70 |
| 71 int max_match_contents_width() const { | 71 int max_match_contents_width() const { return max_match_contents_width_; } |
| 72 return max_match_contents_width_; | 72 int start_margin() const { return start_margin_; } |
| 73 } | 73 int end_margin() const { return end_margin_; } |
| 74 | 74 |
| 75 protected: | 75 protected: |
| 76 OmniboxPopupContentsView(const gfx::FontList& font_list, | 76 OmniboxPopupContentsView(const gfx::FontList& font_list, |
| 77 OmniboxView* omnibox_view, | 77 OmniboxView* omnibox_view, |
| 78 OmniboxEditModel* edit_model, | 78 OmniboxEditModel* edit_model, |
| 79 LocationBarView* location_bar_view); | 79 LocationBarView* location_bar_view); |
| 80 ~OmniboxPopupContentsView() override; | 80 ~OmniboxPopupContentsView() override; |
| 81 | 81 |
| 82 LocationBarView* location_bar_view() { return location_bar_view_; } | 82 LocationBarView* location_bar_view() { return location_bar_view_; } |
| 83 | 83 |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 146 // flag is reset to false on a mouse pressed event, to make sure we don't | 146 // flag is reset to false on a mouse pressed event, to make sure we don't |
| 147 // erroneously ignore the next drag. | 147 // erroneously ignore the next drag. |
| 148 bool ignore_mouse_drag_; | 148 bool ignore_mouse_drag_; |
| 149 | 149 |
| 150 // The popup sizes vertically using an animation when the popup is getting | 150 // The popup sizes vertically using an animation when the popup is getting |
| 151 // shorter (not larger, that makes it look "slow"). | 151 // shorter (not larger, that makes it look "slow"). |
| 152 gfx::SlideAnimation size_animation_; | 152 gfx::SlideAnimation size_animation_; |
| 153 gfx::Rect start_bounds_; | 153 gfx::Rect start_bounds_; |
| 154 gfx::Rect target_bounds_; | 154 gfx::Rect target_bounds_; |
| 155 | 155 |
| 156 int left_margin_; | 156 int start_margin_; |
| 157 int right_margin_; | 157 int end_margin_; |
| 158 | 158 |
| 159 const gfx::ImageSkia* bottom_shadow_; // Ptr owned by resource bundle. | 159 const gfx::ImageSkia* bottom_shadow_; // Ptr owned by resource bundle. |
| 160 | 160 |
| 161 // When the dropdown is not wide enough while displaying postfix suggestions, | 161 // When the dropdown is not wide enough while displaying postfix suggestions, |
| 162 // we use the width of widest match contents to shift the suggestions so that | 162 // we use the width of widest match contents to shift the suggestions so that |
| 163 // the widest suggestion just reaches the end edge. | 163 // the widest suggestion just reaches the end edge. |
| 164 int max_match_contents_width_; | 164 int max_match_contents_width_; |
| 165 | 165 |
| 166 DISALLOW_COPY_AND_ASSIGN(OmniboxPopupContentsView); | 166 DISALLOW_COPY_AND_ASSIGN(OmniboxPopupContentsView); |
| 167 }; | 167 }; |
| 168 | 168 |
| 169 #endif // CHROME_BROWSER_UI_VIEWS_OMNIBOX_OMNIBOX_POPUP_CONTENTS_VIEW_H_ | 169 #endif // CHROME_BROWSER_UI_VIEWS_OMNIBOX_OMNIBOX_POPUP_CONTENTS_VIEW_H_ |
| OLD | NEW |