| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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_AUTOCOMPLETE_AUTOCOMPLETE_POPUP_VIEW_MAC_H_ | 5 #ifndef CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_POPUP_VIEW_MAC_H_ |
| 6 #define CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_POPUP_VIEW_MAC_H_ | 6 #define CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_POPUP_VIEW_MAC_H_ |
| 7 | 7 |
| 8 #import <Cocoa/Cocoa.h> | 8 #import <Cocoa/Cocoa.h> |
| 9 | 9 |
| 10 #include <string> | 10 #include <string> |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 // Implements AutocompletePopupView using a raw NSWindow containing an | 26 // Implements AutocompletePopupView using a raw NSWindow containing an |
| 27 // NSTableView. | 27 // NSTableView. |
| 28 // | 28 // |
| 29 // TODO(rohitrao): This class is set up in a way that makes testing hard. | 29 // TODO(rohitrao): This class is set up in a way that makes testing hard. |
| 30 // Refactor and write unittests. http://crbug.com/9977 | 30 // Refactor and write unittests. http://crbug.com/9977 |
| 31 | 31 |
| 32 class AutocompletePopupViewMac : public AutocompletePopupView { | 32 class AutocompletePopupViewMac : public AutocompletePopupView { |
| 33 public: | 33 public: |
| 34 AutocompletePopupViewMac(AutocompleteEditViewMac* edit_view, | 34 AutocompletePopupViewMac(AutocompleteEditViewMac* edit_view, |
| 35 AutocompleteEditModel* edit_model, | 35 AutocompleteEditModel* edit_model, |
| 36 AutocompletePopupPositioner* positioner, |
| 36 Profile* profile, | 37 Profile* profile, |
| 37 NSTextField* field); | 38 NSTextField* field); |
| 38 virtual ~AutocompletePopupViewMac(); | 39 virtual ~AutocompletePopupViewMac(); |
| 39 | 40 |
| 40 // Implement the AutocompletePopupView interface. | 41 // Implement the AutocompletePopupView interface. |
| 41 virtual bool IsOpen() const; | 42 virtual bool IsOpen() const; |
| 42 virtual void InvalidateLine(size_t line) { | 43 virtual void InvalidateLine(size_t line) { |
| 43 // TODO(shess): Verify that there is no need to implement this. | 44 // TODO(shess): Verify that there is no need to implement this. |
| 44 // This is currently used in two places in the model: | 45 // This is currently used in two places in the model: |
| 45 // | 46 // |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 const std::wstring &matchString, | 89 const std::wstring &matchString, |
| 89 const AutocompleteMatch::ACMatchClassifications &classifications, | 90 const AutocompleteMatch::ACMatchClassifications &classifications, |
| 90 NSColor* textColor, gfx::Font& font); | 91 NSColor* textColor, gfx::Font& font); |
| 91 | 92 |
| 92 private: | 93 private: |
| 93 // Create the popup_ instance if needed. | 94 // Create the popup_ instance if needed. |
| 94 void CreatePopupIfNeeded(); | 95 void CreatePopupIfNeeded(); |
| 95 | 96 |
| 96 scoped_ptr<AutocompletePopupModel> model_; | 97 scoped_ptr<AutocompletePopupModel> model_; |
| 97 AutocompleteEditViewMac* edit_view_; | 98 AutocompleteEditViewMac* edit_view_; |
| 98 | 99 AutocompletePopupPositioner* positioner_; // owned by toolbar controller |
| 99 NSTextField* field_; // owned by tab controller | 100 NSTextField* field_; // owned by tab controller |
| 100 | 101 |
| 101 scoped_nsobject<AutocompleteMatrixTarget> matrix_target_; | 102 scoped_nsobject<AutocompleteMatrixTarget> matrix_target_; |
| 102 // TODO(shess): Before checkin review implementation to make sure | 103 // TODO(shess): Before checkin review implementation to make sure |
| 103 // that popup_'s object hierarchy doesn't keep references to | 104 // that popup_'s object hierarchy doesn't keep references to |
| 104 // destructed objects. | 105 // destructed objects. |
| 105 scoped_nsobject<NSWindow> popup_; | 106 scoped_nsobject<NSWindow> popup_; |
| 106 | 107 |
| 107 DISALLOW_COPY_AND_ASSIGN(AutocompletePopupViewMac); | 108 DISALLOW_COPY_AND_ASSIGN(AutocompletePopupViewMac); |
| 108 }; | 109 }; |
| 109 | 110 |
| 110 #endif // CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_POPUP_VIEW_MAC_H_ | 111 #endif // CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_POPUP_VIEW_MAC_H_ |
| OLD | NEW |