| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #import <Cocoa/Cocoa.h> | 5 #import <Cocoa/Cocoa.h> |
| 6 | 6 |
| 7 #include "app/resource_bundle.h" | 7 #include "app/resource_bundle.h" |
| 8 #import "base/cocoa_protocols_mac.h" | 8 #import "base/cocoa_protocols_mac.h" |
| 9 #include "base/scoped_nsobject.h" | 9 #include "base/scoped_nsobject.h" |
| 10 #import "chrome/browser/cocoa/location_bar/autocomplete_text_field.h" | 10 #import "chrome/browser/cocoa/location_bar/autocomplete_text_field.h" |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 | 25 |
| 26 namespace { | 26 namespace { |
| 27 | 27 |
| 28 class MockDecoration : public LocationBarDecoration { | 28 class MockDecoration : public LocationBarDecoration { |
| 29 public: | 29 public: |
| 30 virtual CGFloat GetWidthForSpace(CGFloat width) { return 20.0; } | 30 virtual CGFloat GetWidthForSpace(CGFloat width) { return 20.0; } |
| 31 virtual bool IsVisible() const { return visible_; } | 31 virtual bool IsVisible() const { return visible_; } |
| 32 void SetVisible(bool visible) { visible_ = visible; } | 32 void SetVisible(bool visible) { visible_ = visible; } |
| 33 | 33 |
| 34 virtual void DrawInFrame(NSRect frame, NSView* control_view) { ; } | 34 virtual void DrawInFrame(NSRect frame, NSView* control_view) { ; } |
| 35 virtual bool AcceptsMousePress() { return true; } |
| 35 MOCK_METHOD1(OnMousePressed, bool(NSRect frame)); | 36 MOCK_METHOD1(OnMousePressed, bool(NSRect frame)); |
| 36 MOCK_METHOD0(GetMenu, NSMenu*()); | 37 MOCK_METHOD0(GetMenu, NSMenu*()); |
| 37 | 38 |
| 38 bool visible_; | 39 bool visible_; |
| 39 }; | 40 }; |
| 40 | 41 |
| 41 // Mock up an incrementing event number. | 42 // Mock up an incrementing event number. |
| 42 NSUInteger eventNumber = 0; | 43 NSUInteger eventNumber = 0; |
| 43 | 44 |
| 44 // Create an event of the indicated |type| at |point| within |view|. | 45 // Create an event of the indicated |type| at |point| within |view|. |
| (...skipping 757 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 802 scoped_nsobject<AutocompleteTextField> pin([field_ retain]); | 803 scoped_nsobject<AutocompleteTextField> pin([field_ retain]); |
| 803 [field_ removeFromSuperview]; | 804 [field_ removeFromSuperview]; |
| 804 [test_window() resignKeyWindow]; | 805 [test_window() resignKeyWindow]; |
| 805 | 806 |
| 806 [[test_window() contentView] addSubview:field_]; | 807 [[test_window() contentView] addSubview:field_]; |
| 807 EXPECT_CALL(field_observer_, ClosePopup()); | 808 EXPECT_CALL(field_observer_, ClosePopup()); |
| 808 [test_window() resignKeyWindow]; | 809 [test_window() resignKeyWindow]; |
| 809 } | 810 } |
| 810 | 811 |
| 811 } // namespace | 812 } // namespace |
| OLD | NEW |