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

Side by Side Diff: chrome/browser/cocoa/find_bar_cocoa_controller.mm

Issue 793003: Pick up a GTM roll and update the apis that changed in this roll.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 10 years, 9 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) 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 #import <Cocoa/Cocoa.h> 5 #import <Cocoa/Cocoa.h>
6 6
7 #include "base/mac_util.h" 7 #include "base/mac_util.h"
8 #include "base/sys_string_conversions.h" 8 #include "base/sys_string_conversions.h"
9 #include "chrome/browser/find_bar_controller.h" 9 #include "chrome/browser/find_bar_controller.h"
10 #include "chrome/browser/cocoa/browser_window_cocoa.h" 10 #include "chrome/browser/cocoa/browser_window_cocoa.h"
(...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after
335 335
336 // Reset the frame to what was saved above. 336 // Reset the frame to what was saved above.
337 [findBarView_ setFrame:startFrame]; 337 [findBarView_ setFrame:startFrame];
338 NSDictionary* dict = [NSDictionary dictionaryWithObjectsAndKeys: 338 NSDictionary* dict = [NSDictionary dictionaryWithObjectsAndKeys:
339 findBarView_, NSViewAnimationTargetKey, 339 findBarView_, NSViewAnimationTargetKey,
340 [NSValue valueWithRect:endFrame], NSViewAnimationEndFrameKey, nil]; 340 [NSValue valueWithRect:endFrame], NSViewAnimationEndFrameKey, nil];
341 341
342 currentAnimation_.reset( 342 currentAnimation_.reset(
343 [[NSViewAnimation alloc] 343 [[NSViewAnimation alloc]
344 initWithViewAnimations:[NSArray arrayWithObjects:dict, nil]]); 344 initWithViewAnimations:[NSArray arrayWithObjects:dict, nil]]);
345 [currentAnimation_ gtm_setDuration:duration]; 345 [currentAnimation_ gtm_setDuration:duration
346 eventMask:NSLeftMouseDownMask];
346 [currentAnimation_ setDelegate:self]; 347 [currentAnimation_ setDelegate:self];
347 [currentAnimation_ startAnimation]; 348 [currentAnimation_ startAnimation];
348 } 349 }
349 350
350 - (void)prepopulateText:(NSString*)text stopSearch:(BOOL)stopSearch{ 351 - (void)prepopulateText:(NSString*)text stopSearch:(BOOL)stopSearch{
351 [self setFindText:text]; 352 [self setFindText:text];
352 353
353 // End the find session, hide the "x of y" text and disable the 354 // End the find session, hide the "x of y" text and disable the
354 // buttons, but do not close the find bar or raise the window here. 355 // buttons, but do not close the find bar or raise the window here.
355 if (stopSearch && findBarBridge_) { 356 if (stopSearch && findBarBridge_) {
356 TabContents* contents = 357 TabContents* contents =
357 findBarBridge_->GetFindBarController()->tab_contents(); 358 findBarBridge_->GetFindBarController()->tab_contents();
358 if (contents) { 359 if (contents) {
359 contents->StopFinding(true); 360 contents->StopFinding(true);
360 findBarBridge_->ClearResults(contents->find_result()); 361 findBarBridge_->ClearResults(contents->find_result());
361 } 362 }
362 } 363 }
363 364
364 // Has to happen after |ClearResults()| above. 365 // Has to happen after |ClearResults()| above.
365 BOOL buttonsEnabled = [text length] > 0 ? YES : NO; 366 BOOL buttonsEnabled = [text length] > 0 ? YES : NO;
366 [previousButton_ setEnabled:buttonsEnabled]; 367 [previousButton_ setEnabled:buttonsEnabled];
367 [nextButton_ setEnabled:buttonsEnabled]; 368 [nextButton_ setEnabled:buttonsEnabled];
368 } 369 }
369 370
370 @end 371 @end
OLDNEW
« no previous file with comments | « chrome/browser/cocoa/download_started_animation_mac.mm ('k') | chrome/browser/cocoa/fullscreen_controller.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698