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_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 |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 int GetTextWidth() const override; | 94 int GetTextWidth() const override; |
95 int GetWidth() const override; | 95 int GetWidth() const override; |
96 bool IsImeComposing() const override; | 96 bool IsImeComposing() const override; |
97 | 97 |
98 // Implement the AutocompleteTextFieldObserver interface. | 98 // Implement the AutocompleteTextFieldObserver interface. |
99 NSRange SelectionRangeForProposedRange(NSRange proposed_range) override; | 99 NSRange SelectionRangeForProposedRange(NSRange proposed_range) override; |
100 void OnControlKeyChanged(bool pressed) override; | 100 void OnControlKeyChanged(bool pressed) override; |
101 bool CanCopy() override; | 101 bool CanCopy() override; |
102 base::scoped_nsobject<NSPasteboardItem> CreatePasteboardItem() override; | 102 base::scoped_nsobject<NSPasteboardItem> CreatePasteboardItem() override; |
103 void CopyToPasteboard(NSPasteboard* pboard) override; | 103 void CopyToPasteboard(NSPasteboard* pboard) override; |
104 bool ShouldEnableShowURL() override; | |
105 void ShowURL() override; | |
106 void OnPaste() override; | 104 void OnPaste() override; |
107 bool CanPasteAndGo() override; | 105 bool CanPasteAndGo() override; |
108 int GetPasteActionStringId() override; | 106 int GetPasteActionStringId() override; |
109 void OnPasteAndGo() override; | 107 void OnPasteAndGo() override; |
110 void OnFrameChanged() override; | 108 void OnFrameChanged() override; |
111 void ClosePopup() override; | 109 void ClosePopup() override; |
112 void OnDidBeginEditing() override; | 110 void OnDidBeginEditing() override; |
113 void OnBeforeChange() override; | 111 void OnBeforeChange() override; |
114 void OnDidChange() override; | 112 void OnDidChange() override; |
115 void OnDidEndEditing() override; | 113 void OnDidEndEditing() override; |
116 void OnInsertText() override; | 114 void OnInsertText() override; |
117 void OnDidDrawRect() override; | 115 void OnDidDrawRect() override; |
118 bool OnDoCommandBySelector(SEL cmd) override; | 116 bool OnDoCommandBySelector(SEL cmd) override; |
119 void OnSetFocus(bool control_down) override; | 117 void OnSetFocus(bool control_down) override; |
120 void OnKillFocus() override; | 118 void OnKillFocus() override; |
121 void OnMouseDown(NSInteger button_number) override; | 119 void OnMouseDown(NSInteger button_number) override; |
122 bool ShouldSelectAllOnMouseDown() override; | |
123 | 120 |
124 // Helper for LocationBarViewMac. Optionally selects all in |field_|. | 121 // Helper for LocationBarViewMac. Optionally selects all in |field_|. |
125 void FocusLocation(bool select_all); | 122 void FocusLocation(bool select_all); |
126 | 123 |
127 // Helper to get the font to use in the field, exposed for the | 124 // Helper to get the font to use in the field, exposed for the |
128 // popup. | 125 // popup. |
129 static NSFont* GetNormalFieldFont(); | 126 static NSFont* GetNormalFieldFont(); |
130 static NSFont* GetBoldFieldFont(); | 127 static NSFont* GetBoldFieldFont(); |
131 static NSFont* GetLargeFont(); | 128 static NSFont* GetLargeFont(); |
132 static NSFont* GetSmallFont(); | 129 static NSFont* GetSmallFont(); |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
232 NSRange coalesced_range_update_; | 229 NSRange coalesced_range_update_; |
233 | 230 |
234 // The time of the first character insert operation that has not yet been | 231 // The time of the first character insert operation that has not yet been |
235 // painted. Used to measure omnibox responsiveness with a histogram. | 232 // painted. Used to measure omnibox responsiveness with a histogram. |
236 base::TimeTicks insert_char_time_; | 233 base::TimeTicks insert_char_time_; |
237 | 234 |
238 DISALLOW_COPY_AND_ASSIGN(OmniboxViewMac); | 235 DISALLOW_COPY_AND_ASSIGN(OmniboxViewMac); |
239 }; | 236 }; |
240 | 237 |
241 #endif // CHROME_BROWSER_UI_COCOA_OMNIBOX_OMNIBOX_VIEW_MAC_H_ | 238 #endif // CHROME_BROWSER_UI_COCOA_OMNIBOX_OMNIBOX_VIEW_MAC_H_ |
OLD | NEW |