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

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

Issue 2555783002: [Mac] Ensure Omnibox text is always right-aligned in RTL (Closed)
Patch Set: User ScopedForceRTLMac for RTL test setup Created 4 years 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/gtest_prod_util.h"
13 #include "base/macros.h" 14 #include "base/macros.h"
14 #include "base/strings/string16.h" 15 #include "base/strings/string16.h"
15 #include "chrome/browser/ui/cocoa/location_bar/autocomplete_text_field.h" 16 #include "chrome/browser/ui/cocoa/location_bar/autocomplete_text_field.h"
16 #include "components/omnibox/browser/omnibox_view.h" 17 #include "components/omnibox/browser/omnibox_view.h"
17 #include "components/security_state/core/security_state.h" 18 #include "components/security_state/core/security_state.h"
18 #include "third_party/skia/include/core/SkColor.h" 19 #include "third_party/skia/include/core/SkColor.h"
19 20
20 class CommandUpdater; 21 class CommandUpdater;
21 class OmniboxPopupView; 22 class OmniboxPopupView;
22 class Profile; 23 class Profile;
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 // If |resource_id| has a PDF image which can be used, return it. 127 // If |resource_id| has a PDF image which can be used, return it.
127 // Otherwise return the PNG image from the resource bundle. 128 // Otherwise return the PNG image from the resource bundle.
128 static NSImage* ImageForResource(int resource_id); 129 static NSImage* ImageForResource(int resource_id);
129 130
130 // Color used to draw suggest text. 131 // Color used to draw suggest text.
131 static NSColor* SuggestTextColor(); 132 static NSColor* SuggestTextColor();
132 133
133 AutocompleteTextField* field() const { return field_; } 134 AutocompleteTextField* field() const { return field_; }
134 135
135 private: 136 private:
137 FRIEND_TEST_ALL_PREFIXES(OmniboxViewMacTest, WritingDirectionLTR);
138 FRIEND_TEST_ALL_PREFIXES(OmniboxViewMacTest, WritingDirectionRTL);
136 // Called when the user hits backspace in |field_|. Checks whether 139 // Called when the user hits backspace in |field_|. Checks whether
137 // keyword search is being terminated. Returns true if the 140 // keyword search is being terminated. Returns true if the
138 // backspace should be intercepted (not forwarded on to the standard 141 // backspace should be intercepted (not forwarded on to the standard
139 // machinery). 142 // machinery).
140 bool OnBackspacePressed(); 143 bool OnBackspacePressed();
141 144
142 // Returns the field's currently selected range. Only valid if the 145 // Returns the field's currently selected range. Only valid if the
143 // field has focus. 146 // field has focus.
144 NSRange GetSelectedRange() const; 147 NSRange GetSelectedRange() const;
145 148
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
225 // painted. Used to measure omnibox responsiveness with a histogram. 228 // painted. Used to measure omnibox responsiveness with a histogram.
226 base::TimeTicks insert_char_time_; 229 base::TimeTicks insert_char_time_;
227 230
228 // The time when OnBeforeDrawRect() was called. 231 // The time when OnBeforeDrawRect() was called.
229 base::TimeTicks draw_rect_start_time_; 232 base::TimeTicks draw_rect_start_time_;
230 233
231 DISALLOW_COPY_AND_ASSIGN(OmniboxViewMac); 234 DISALLOW_COPY_AND_ASSIGN(OmniboxViewMac);
232 }; 235 };
233 236
234 #endif // CHROME_BROWSER_UI_COCOA_OMNIBOX_OMNIBOX_VIEW_MAC_H_ 237 #endif // CHROME_BROWSER_UI_COCOA_OMNIBOX_OMNIBOX_VIEW_MAC_H_
OLDNEW
« no previous file with comments | « chrome/browser/ui/cocoa/location_bar/autocomplete_text_field.mm ('k') | chrome/browser/ui/cocoa/omnibox/omnibox_view_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698