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

Side by Side Diff: chrome/browser/renderer_host/render_widget_host_view_mac.mm

Issue 113922: Make sure that we're restoring focus to a valid subview. (with Rohit)... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | 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) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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 #include "chrome/browser/renderer_host/render_widget_host_view_mac.h" 5 #include "chrome/browser/renderer_host/render_widget_host_view_mac.h"
6 6
7 #include "base/histogram.h" 7 #include "base/histogram.h"
8 #include "base/sys_string_conversions.h" 8 #include "base/sys_string_conversions.h"
9 #include "chrome/browser/browser_trial.h" 9 #include "chrome/browser/browser_trial.h"
10 #include "chrome/browser/renderer_host/backing_store.h" 10 #include "chrome/browser/renderer_host/backing_store.h"
(...skipping 437 matching lines...) Expand 10 before | Expand all | Expand 10 after
448 448
449 - (BOOL)canBecomeKeyView { 449 - (BOOL)canBecomeKeyView {
450 return canBeKeyView_; 450 return canBeKeyView_;
451 } 451 }
452 452
453 - (BOOL)acceptsFirstResponder { 453 - (BOOL)acceptsFirstResponder {
454 return canBeKeyView_; 454 return canBeKeyView_;
455 } 455 }
456 456
457 - (BOOL)becomeFirstResponder { 457 - (BOOL)becomeFirstResponder {
458 if (![self superview]) {
pink (ping after 24hrs) 2009/05/28 12:35:23 I usually check [self window] when determining if
459 // We're dead, so becoming first responder is probably a bad idea.
460 return NO;
461 }
462
458 renderWidgetHostView_->render_widget_host_->Focus(); 463 renderWidgetHostView_->render_widget_host_->Focus();
459
460 return YES; 464 return YES;
461 } 465 }
462 466
463 - (BOOL)resignFirstResponder { 467 - (BOOL)resignFirstResponder {
464 if (closeOnDeactivate_) 468 if (closeOnDeactivate_)
465 renderWidgetHostView_->KillSelf(); 469 renderWidgetHostView_->KillSelf();
466 470
467 renderWidgetHostView_->render_widget_host_->Blur(); 471 renderWidgetHostView_->render_widget_host_->Blur();
468 472
469 return YES; 473 return YES;
470 } 474 }
471 475
472 @end 476 @end
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698