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

Side by Side Diff: chrome/browser/ui/cocoa/toolbar/toolbar_controller_unittest.mm

Issue 299633002: Fix BrowserActionButton's hover state in ToolbarController (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix conflit with AUTHORS Created 6 years, 7 months 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
« no previous file with comments | « chrome/browser/ui/cocoa/toolbar/toolbar_controller.mm ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #import <Cocoa/Cocoa.h> 5 #import <Cocoa/Cocoa.h>
6 6
7 #import "base/mac/scoped_nsobject.h" 7 #import "base/mac/scoped_nsobject.h"
8 #include "base/prefs/pref_service.h" 8 #include "base/prefs/pref_service.h"
9 #include "chrome/app/chrome_command_ids.h" 9 #include "chrome/app/chrome_command_ids.h"
10 #include "chrome/browser/command_updater.h" 10 #include "chrome/browser/command_updater.h"
11 #include "chrome/browser/ui/browser.h" 11 #include "chrome/browser/ui/browser.h"
12 #include "chrome/browser/ui/browser_command_controller.h" 12 #include "chrome/browser/ui/browser_command_controller.h"
13 #include "chrome/browser/ui/browser_commands.h" 13 #include "chrome/browser/ui/browser_commands.h"
14 #include "chrome/browser/ui/cocoa/cocoa_profile_test.h" 14 #include "chrome/browser/ui/cocoa/cocoa_profile_test.h"
15 #import "chrome/browser/ui/cocoa/gradient_button_cell.h" 15 #import "chrome/browser/ui/cocoa/image_button_cell.h"
16 #import "chrome/browser/ui/cocoa/toolbar/toolbar_controller.h" 16 #import "chrome/browser/ui/cocoa/toolbar/toolbar_controller.h"
17 #import "chrome/browser/ui/cocoa/view_resizer_pong.h" 17 #import "chrome/browser/ui/cocoa/view_resizer_pong.h"
18 #include "chrome/common/pref_names.h" 18 #include "chrome/common/pref_names.h"
19 #include "chrome/test/base/testing_profile.h" 19 #include "chrome/test/base/testing_profile.h"
20 #include "testing/gtest/include/gtest/gtest.h" 20 #include "testing/gtest/include/gtest/gtest.h"
21 #include "testing/platform_test.h" 21 #include "testing/platform_test.h"
22 22
23 // An NSView that fakes out hitTest:. 23 // An NSView that fakes out hitTest:.
24 @interface HitView : NSView { 24 @interface HitView : NSView {
25 id hitTestReturn_; 25 id hitTestReturn_;
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after
240 // NOT a match. 240 // NOT a match.
241 [view setHitTestReturn:bar_.get()]; 241 [view setHitTestReturn:bar_.get()];
242 EXPECT_FALSE([bar_ hoverButtonForEvent:event]); 242 EXPECT_FALSE([bar_ hoverButtonForEvent:event]);
243 243
244 // Not yet... 244 // Not yet...
245 base::scoped_nsobject<NSButton> button([[NSButton alloc] init]); 245 base::scoped_nsobject<NSButton> button([[NSButton alloc] init]);
246 [view setHitTestReturn:button]; 246 [view setHitTestReturn:button];
247 EXPECT_FALSE([bar_ hoverButtonForEvent:event]); 247 EXPECT_FALSE([bar_ hoverButtonForEvent:event]);
248 248
249 // Now! 249 // Now!
250 base::scoped_nsobject<GradientButtonCell> cell( 250 base::scoped_nsobject<ImageButtonCell> cell(
251 [[GradientButtonCell alloc] init]); 251 [[ImageButtonCell alloc] init]);
252 [button setCell:cell.get()]; 252 [button setCell:cell.get()];
253 EXPECT_TRUE([bar_ hoverButtonForEvent:nil]); 253 EXPECT_TRUE([bar_ hoverButtonForEvent:nil]);
254 } 254 }
255 255
256 } // namespace 256 } // namespace
OLDNEW
« no previous file with comments | « chrome/browser/ui/cocoa/toolbar/toolbar_controller.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698