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

Side by Side Diff: chrome/browser/ui/cocoa/location_bar/autocomplete_text_field_editor.mm

Issue 7566016: Fullscreen support for Lion. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 4 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "chrome/browser/ui/cocoa/location_bar/autocomplete_text_field_editor.h" 5 #import "chrome/browser/ui/cocoa/location_bar/autocomplete_text_field_editor.h"
6 6
7 #include "base/string_util.h" 7 #include "base/string_util.h"
8 #include "base/sys_string_conversions.h" 8 #include "base/sys_string_conversions.h"
9 #include "chrome/app/chrome_command_ids.h" // IDC_* 9 #include "chrome/app/chrome_command_ids.h" // IDC_*
10 #include "chrome/browser/ui/browser_list.h" 10 #include "chrome/browser/ui/browser_list.h"
(...skipping 384 matching lines...) Expand 10 before | Expand all | Expand 10 after
395 // method from being called unnecessarily. 395 // method from being called unnecessarily.
396 textChangedByKeyEvents_ = NO; 396 textChangedByKeyEvents_ = NO;
397 return; 397 return;
398 } 398 }
399 399
400 // If the escape key was pressed and no revert happened and we're in 400 // If the escape key was pressed and no revert happened and we're in
401 // fullscreen mode, make it resign key. 401 // fullscreen mode, make it resign key.
402 if (cmd == @selector(cancelOperation:)) { 402 if (cmd == @selector(cancelOperation:)) {
403 BrowserWindowController* windowController = 403 BrowserWindowController* windowController =
404 [BrowserWindowController browserWindowControllerForView:self]; 404 [BrowserWindowController browserWindowControllerForView:self];
405 if ([windowController isFullscreen]) { 405 if ([windowController inPresentationMode]) {
406 [windowController focusTabContents]; 406 [windowController focusTabContents];
407 return; 407 return;
408 } 408 }
409 } 409 }
410 410
411 [super doCommandBySelector:cmd]; 411 [super doCommandBySelector:cmd];
412 } 412 }
413 413
414 - (void)setAttributedString:(NSAttributedString*)aString { 414 - (void)setAttributedString:(NSAttributedString*)aString {
415 NSTextStorage* textStorage = [self textStorage]; 415 NSTextStorage* textStorage = [self textStorage];
416 DCHECK(textStorage); 416 DCHECK(textStorage);
417 [textStorage setAttributedString:aString]; 417 [textStorage setAttributedString:aString];
418 418
419 // The text has been changed programmatically. The observer should know 419 // The text has been changed programmatically. The observer should know
420 // this change, so setting |textChangedByKeyEvents_| to NO to 420 // this change, so setting |textChangedByKeyEvents_| to NO to
421 // prevent its OnDidChange() method from being called unnecessarily. 421 // prevent its OnDidChange() method from being called unnecessarily.
422 textChangedByKeyEvents_ = NO; 422 textChangedByKeyEvents_ = NO;
423 } 423 }
424 424
425 - (void)mouseDown:(NSEvent*)theEvent { 425 - (void)mouseDown:(NSEvent*)theEvent {
426 // Close the popup before processing the event. 426 // Close the popup before processing the event.
427 AutocompleteTextFieldObserver* observer = [self observer]; 427 AutocompleteTextFieldObserver* observer = [self observer];
428 if (observer) 428 if (observer)
429 observer->ClosePopup(); 429 observer->ClosePopup();
430 430
431 [super mouseDown:theEvent]; 431 [super mouseDown:theEvent];
432 } 432 }
433 433
434 @end 434 @end
OLDNEW
« no previous file with comments | « chrome/browser/ui/cocoa/fullscreen_controller.mm ('k') | chrome/browser/ui/cocoa/presentation_mode_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698