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

Side by Side Diff: chrome/browser/ui/cocoa/omnibox/omnibox_view_mac.h

Issue 2057043002: Align the Mac Omnibox items vertically again. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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
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_COCOA_OMNIBOX_OMNIBOX_VIEW_MAC_H_ 5 #ifndef CHROME_BROWSER_UI_COCOA_OMNIBOX_OMNIBOX_VIEW_MAC_H_
6 #define CHROME_BROWSER_UI_COCOA_OMNIBOX_OMNIBOX_VIEW_MAC_H_ 6 #define CHROME_BROWSER_UI_COCOA_OMNIBOX_OMNIBOX_VIEW_MAC_H_
7 7
8 #import <Cocoa/Cocoa.h> 8 #import <Cocoa/Cocoa.h>
9 #include <stddef.h> 9 #include <stddef.h>
10 10
11 #include <memory> 11 #include <memory>
12 12
13 #include "base/macros.h" 13 #include "base/macros.h"
14 #include "base/strings/string16.h" 14 #include "base/strings/string16.h"
15 #include "chrome/browser/ui/cocoa/location_bar/autocomplete_text_field.h" 15 #include "chrome/browser/ui/cocoa/location_bar/autocomplete_text_field.h"
16 #include "components/omnibox/browser/omnibox_view.h" 16 #include "components/omnibox/browser/omnibox_view.h"
17 #include "components/security_state/security_state_model.h" 17 #include "components/security_state/security_state_model.h"
18 #include "third_party/skia/include/core/SkColor.h" 18 #include "third_party/skia/include/core/SkColor.h"
19 #include "ui/gfx/font.h"
19 20
20 class CommandUpdater; 21 class CommandUpdater;
21 class OmniboxPopupView; 22 class OmniboxPopupView;
22 class Profile; 23 class Profile;
23 24
24 namespace content { 25 namespace content {
25 class WebContents; 26 class WebContents;
26 } 27 }
27 28
28 namespace ui { 29 namespace ui {
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 void OnSetFocus(bool control_down) override; 120 void OnSetFocus(bool control_down) override;
120 void OnKillFocus() override; 121 void OnKillFocus() override;
121 void OnMouseDown(NSInteger button_number) override; 122 void OnMouseDown(NSInteger button_number) override;
122 bool ShouldSelectAllOnMouseDown() override; 123 bool ShouldSelectAllOnMouseDown() override;
123 124
124 // Helper for LocationBarViewMac. Optionally selects all in |field_|. 125 // Helper for LocationBarViewMac. Optionally selects all in |field_|.
125 void FocusLocation(bool select_all); 126 void FocusLocation(bool select_all);
126 127
127 // Helper to get the font to use in the field, exposed for the 128 // Helper to get the font to use in the field, exposed for the
128 // popup. 129 // popup.
129 static NSFont* GetNormalFieldFont(); 130 // The |style| parameter specifies the new style for the font, and is a
130 static NSFont* GetBoldFieldFont(); 131 // bitmask of the values ITALIC and UNDERLINE (see ui/gfx/font.h).
131 static NSFont* GetLargeFont(); 132 static NSFont* GetFieldFont(int style, gfx::Font::Weight weight);
132 static NSFont* GetSmallFont(); 133 static NSFont* GetLargeFont(int style, gfx::Font::Weight weight);
134 static NSFont* GetSmallFont(int style, gfx::Font::Weight weight);
133 135
134 // If |resource_id| has a PDF image which can be used, return it. 136 // If |resource_id| has a PDF image which can be used, return it.
135 // Otherwise return the PNG image from the resource bundle. 137 // Otherwise return the PNG image from the resource bundle.
136 static NSImage* ImageForResource(int resource_id); 138 static NSImage* ImageForResource(int resource_id);
137 139
138 // Color used to draw suggest text. 140 // Color used to draw suggest text.
139 static NSColor* SuggestTextColor(); 141 static NSColor* SuggestTextColor();
140 142
141 AutocompleteTextField* field() const { return field_; } 143 AutocompleteTextField* field() const { return field_; }
142 144
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
232 NSRange coalesced_range_update_; 234 NSRange coalesced_range_update_;
233 235
234 // The time of the first character insert operation that has not yet been 236 // The time of the first character insert operation that has not yet been
235 // painted. Used to measure omnibox responsiveness with a histogram. 237 // painted. Used to measure omnibox responsiveness with a histogram.
236 base::TimeTicks insert_char_time_; 238 base::TimeTicks insert_char_time_;
237 239
238 DISALLOW_COPY_AND_ASSIGN(OmniboxViewMac); 240 DISALLOW_COPY_AND_ASSIGN(OmniboxViewMac);
239 }; 241 };
240 242
241 #endif // CHROME_BROWSER_UI_COCOA_OMNIBOX_OMNIBOX_VIEW_MAC_H_ 243 #endif // CHROME_BROWSER_UI_COCOA_OMNIBOX_OMNIBOX_VIEW_MAC_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698