Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(82)

Side by Side Diff: chrome/browser/ui/views/omnibox/omnibox_popup_contents_view.h

Issue 1300843003: Change width of rows in material design omnibox dropdown (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: change left/right to start/end Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | chrome/browser/ui/views/omnibox/omnibox_popup_contents_view.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/views/omnibox/omnibox_popup_contents_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698