| 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 const BubblePositioner* bubble_positioner, |
| 37 Profile* profile, | 37 Profile* profile, |
| 38 NSTextField* field); | 38 NSTextField* field); |
| 39 virtual ~AutocompletePopupViewMac(); | 39 virtual ~AutocompletePopupViewMac(); |
| 40 | 40 |
| 41 // Implement the AutocompletePopupView interface. | 41 // Implement the AutocompletePopupView interface. |
| 42 virtual bool IsOpen() const; | 42 virtual bool IsOpen() const; |
| 43 virtual void InvalidateLine(size_t line) { | 43 virtual void InvalidateLine(size_t line) { |
| 44 // TODO(shess): Verify that there is no need to implement this. | 44 // TODO(shess): Verify that there is no need to implement this. |
| 45 // This is currently used in two places in the model: | 45 // This is currently used in two places in the model: |
| 46 // | 46 // |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 const std::wstring &matchString, | 92 const std::wstring &matchString, |
| 93 const AutocompleteMatch::ACMatchClassifications &classifications, | 93 const AutocompleteMatch::ACMatchClassifications &classifications, |
| 94 NSColor* textColor, gfx::Font& font); | 94 NSColor* textColor, gfx::Font& font); |
| 95 | 95 |
| 96 private: | 96 private: |
| 97 // Create the popup_ instance if needed. | 97 // Create the popup_ instance if needed. |
| 98 void CreatePopupIfNeeded(); | 98 void CreatePopupIfNeeded(); |
| 99 | 99 |
| 100 scoped_ptr<AutocompletePopupModel> model_; | 100 scoped_ptr<AutocompletePopupModel> model_; |
| 101 AutocompleteEditViewMac* edit_view_; | 101 AutocompleteEditViewMac* edit_view_; |
| 102 AutocompletePopupPositioner* positioner_; // owned by toolbar controller | 102 const BubblePositioner* bubble_positioner_; // owned by toolbar controller |
| 103 NSTextField* field_; // owned by tab controller | 103 NSTextField* field_; // owned by tab controller |
| 104 | 104 |
| 105 scoped_nsobject<AutocompleteMatrixTarget> matrix_target_; | 105 scoped_nsobject<AutocompleteMatrixTarget> matrix_target_; |
| 106 // TODO(shess): Before checkin review implementation to make sure | 106 // TODO(shess): Before checkin review implementation to make sure |
| 107 // that popup_'s object hierarchy doesn't keep references to | 107 // that popup_'s object hierarchy doesn't keep references to |
| 108 // destructed objects. | 108 // destructed objects. |
| 109 scoped_nsobject<NSWindow> popup_; | 109 scoped_nsobject<NSWindow> popup_; |
| 110 | 110 |
| 111 DISALLOW_COPY_AND_ASSIGN(AutocompletePopupViewMac); | 111 DISALLOW_COPY_AND_ASSIGN(AutocompletePopupViewMac); |
| 112 }; | 112 }; |
| 113 | 113 |
| 114 #endif // CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_POPUP_VIEW_MAC_H_ | 114 #endif // CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_POPUP_VIEW_MAC_H_ |
| OLD | NEW |