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

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

Issue 10677009: Move command handling and updating off Browser and onto a helper object. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 6 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 | Annotate | Revision Log
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/memory/scoped_nsobject.h" 7 #import "base/memory/scoped_nsobject.h"
8 #include "chrome/app/chrome_command_ids.h" 8 #include "chrome/app/chrome_command_ids.h"
9 #include "chrome/browser/ui/cocoa/cocoa_profile_test.h" 9 #include "chrome/browser/ui/cocoa/cocoa_profile_test.h"
10 #import "chrome/browser/ui/cocoa/gradient_button_cell.h" 10 #import "chrome/browser/ui/cocoa/gradient_button_cell.h"
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 // |-toolbarViews| method. 43 // |-toolbarViews| method.
44 enum { 44 enum {
45 kBackIndex, kForwardIndex, kReloadIndex, kHomeIndex, 45 kBackIndex, kForwardIndex, kReloadIndex, kHomeIndex,
46 kWrenchIndex, kLocationIndex, kBrowserActionContainerViewIndex 46 kWrenchIndex, kLocationIndex, kBrowserActionContainerViewIndex
47 }; 47 };
48 48
49 virtual void SetUp() { 49 virtual void SetUp() {
50 CocoaProfileTest::SetUp(); 50 CocoaProfileTest::SetUp();
51 ASSERT_TRUE(browser()); 51 ASSERT_TRUE(browser());
52 52
53 CommandUpdater* updater = browser()->command_updater(); 53 CommandUpdater* updater =
54 browser()->command_controller()->command_updater();
54 // The default state for the commands is true, set a couple to false to 55 // The default state for the commands is true, set a couple to false to
55 // ensure they get picked up correct on initialization 56 // ensure they get picked up correct on initialization
56 updater->UpdateCommandEnabled(IDC_BACK, false); 57 updater->UpdateCommandEnabled(IDC_BACK, false);
57 updater->UpdateCommandEnabled(IDC_FORWARD, false); 58 updater->UpdateCommandEnabled(IDC_FORWARD, false);
58 resizeDelegate_.reset([[ViewResizerPong alloc] init]); 59 resizeDelegate_.reset([[ViewResizerPong alloc] init]);
59 bar_.reset( 60 bar_.reset(
60 [[ToolbarController alloc] initWithModel:browser()->toolbar_model() 61 [[ToolbarController alloc] initWithModel:browser()->toolbar_model()
61 commands:browser()->command_updater() 62 commands:browser()->command_updater()
62 profile:profile() 63 profile:profile()
63 browser:browser() 64 browser:browser()
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
229 [view setHitTestReturn:button]; 230 [view setHitTestReturn:button];
230 EXPECT_FALSE([bar_ hoverButtonForEvent:event]); 231 EXPECT_FALSE([bar_ hoverButtonForEvent:event]);
231 232
232 // Now! 233 // Now!
233 scoped_nsobject<GradientButtonCell> cell([[GradientButtonCell alloc] init]); 234 scoped_nsobject<GradientButtonCell> cell([[GradientButtonCell alloc] init]);
234 [button setCell:cell.get()]; 235 [button setCell:cell.get()];
235 EXPECT_TRUE([bar_ hoverButtonForEvent:nil]); 236 EXPECT_TRUE([bar_ hoverButtonForEvent:nil]);
236 } 237 }
237 238
238 } // namespace 239 } // namespace
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698