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

Side by Side Diff: ui/views/widget/native_widget_aura.cc

Issue 8821004: Move {Restore,Store}FocusedView to NativeWidgetAura::On{Activated,LostActive} (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years 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) 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 #include "ui/views/widget/native_widget_aura.h" 5 #include "ui/views/widget/native_widget_aura.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/string_util.h" 8 #include "base/string_util.h"
9 #include "ui/aura/client/aura_constants.h" 9 #include "ui/aura/client/aura_constants.h"
10 #include "ui/aura/client/drag_drop_client.h" 10 #include "ui/aura/client/drag_drop_client.h"
(...skipping 392 matching lines...) Expand 10 before | Expand all | Expand 10 after
403 ShowWithWindowState(ui::SHOW_STATE_MAXIMIZED); 403 ShowWithWindowState(ui::SHOW_STATE_MAXIMIZED);
404 } 404 }
405 405
406 void NativeWidgetAura::ShowWithWindowState(ui::WindowShowState state) { 406 void NativeWidgetAura::ShowWithWindowState(ui::WindowShowState state) {
407 if (state == ui::SHOW_STATE_MAXIMIZED || 407 if (state == ui::SHOW_STATE_MAXIMIZED ||
408 state == ui::SHOW_STATE_FULLSCREEN) { 408 state == ui::SHOW_STATE_FULLSCREEN) {
409 window_->SetIntProperty(aura::kShowStateKey, state); 409 window_->SetIntProperty(aura::kShowStateKey, state);
410 } 410 }
411 window_->Show(); 411 window_->Show();
412 if (can_activate_ && (state != ui::SHOW_STATE_INACTIVE || 412 if (can_activate_ && (state != ui::SHOW_STATE_INACTIVE ||
413 !GetWidget()->SetInitialFocus())) { 413 !GetWidget()->SetInitialFocus())) {
oshima 2011/12/06 19:30:37 This looks wrong. Could be the cause of crbug.com/
414 window_->Activate(); 414 window_->Activate();
415 } 415 }
416 } 416 }
417 417
418 bool NativeWidgetAura::IsVisible() const { 418 bool NativeWidgetAura::IsVisible() const {
419 return window_->IsVisible(); 419 return window_->IsVisible();
420 } 420 }
421 421
422 void NativeWidgetAura::Activate() { 422 void NativeWidgetAura::Activate() {
423 window_->Activate(); 423 window_->Activate();
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
546 GetWidget()->widget_delegate()->OnWidgetMove(); 546 GetWidget()->widget_delegate()->OnWidgetMove();
547 if (old_bounds.size() != new_bounds.size()) 547 if (old_bounds.size() != new_bounds.size())
548 delegate_->OnNativeWidgetSizeChanged(new_bounds.size()); 548 delegate_->OnNativeWidgetSizeChanged(new_bounds.size());
549 } 549 }
550 550
551 void NativeWidgetAura::OnFocus() { 551 void NativeWidgetAura::OnFocus() {
552 Widget* widget = GetWidget(); 552 Widget* widget = GetWidget();
553 if (widget->is_top_level()) { 553 if (widget->is_top_level()) {
554 InputMethod* input_method = widget->GetInputMethod(); 554 InputMethod* input_method = widget->GetInputMethod();
555 input_method->OnFocus(); 555 input_method->OnFocus();
556 // See description of got_initial_focus_in_ for details on this. 556 // See description of got_initial_focus_in_ for details on this.
oshima 2011/12/06 19:30:37 please remove this as this is a copy from gtk and
mazda 2011/12/07 04:51:51 Done.
557 // TODO(mazda): Investigate this is actually necessary. 557 widget->GetFocusManager()->RestoreFocusedView();
558 // widget->GetFocusManager()->RestoreFocusedView();
559 } 558 }
560 delegate_->OnNativeFocus(window_); 559 delegate_->OnNativeFocus(window_);
561 } 560 }
562 561
563 void NativeWidgetAura::OnBlur() { 562 void NativeWidgetAura::OnBlur() {
564 Widget* widget = GetWidget(); 563 Widget* widget = GetWidget();
565 if (widget->is_top_level()) { 564 if (widget->is_top_level()) {
566 InputMethod* input_method = widget->GetInputMethod(); 565 InputMethod* input_method = widget->GetInputMethod();
567 input_method->OnBlur(); 566 input_method->OnBlur();
568 widget->GetFocusManager()->StoreFocusedView(); 567 widget->GetFocusManager()->StoreFocusedView();
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after
768 NOTIMPLEMENTED(); 767 NOTIMPLEMENTED();
769 } 768 }
770 769
771 // static 770 // static
772 bool NativeWidgetPrivate::IsMouseButtonDown() { 771 bool NativeWidgetPrivate::IsMouseButtonDown() {
773 return aura::Desktop::GetInstance()->IsMouseButtonDown(); 772 return aura::Desktop::GetInstance()->IsMouseButtonDown();
774 } 773 }
775 774
776 } // namespace internal 775 } // namespace internal
777 } // namespace views 776 } // namespace views
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