OLD | NEW |
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 #include "ui/app_list/views/app_list_view.h" | 5 #include "ui/app_list/views/app_list_view.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 484 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
495 // forward the focus search into to the search box. | 495 // forward the focus search into to the search box. |
496 search_box_focus_host_ = new SearchBoxFocusHost(search_box_widget_); | 496 search_box_focus_host_ = new SearchBoxFocusHost(search_box_widget_); |
497 AddChildView(search_box_focus_host_); | 497 AddChildView(search_box_focus_host_); |
498 search_box_widget_->SetFocusTraversableParentView(search_box_focus_host_); | 498 search_box_widget_->SetFocusTraversableParentView(search_box_focus_host_); |
499 search_box_widget_->SetFocusTraversableParent( | 499 search_box_widget_->SetFocusTraversableParent( |
500 GetWidget()->GetFocusTraversable()); | 500 GetWidget()->GetFocusTraversable()); |
501 | 501 |
502 #if defined(USE_AURA) | 502 #if defined(USE_AURA) |
503 // Mouse events on the search box shadow should not be captured. | 503 // Mouse events on the search box shadow should not be captured. |
504 aura::Window* window = search_box_widget_->GetNativeWindow(); | 504 aura::Window* window = search_box_widget_->GetNativeWindow(); |
505 window->SetEventTargeter(scoped_ptr<ui::EventTargeter>( | 505 window->SetEventTargeter(std::unique_ptr<ui::EventTargeter>( |
506 new SearchBoxWindowTargeter(search_box_view_))); | 506 new SearchBoxWindowTargeter(search_box_view_))); |
507 #endif | 507 #endif |
508 | 508 |
509 app_list_main_view_->contents_view()->Layout(); | 509 app_list_main_view_->contents_view()->Layout(); |
510 } | 510 } |
511 | 511 |
512 void AppListView::InitAsBubbleInternal(gfx::NativeView parent, | 512 void AppListView::InitAsBubbleInternal(gfx::NativeView parent, |
513 int initial_apps_page, | 513 int initial_apps_page, |
514 views::BubbleBorder::Arrow arrow, | 514 views::BubbleBorder::Arrow arrow, |
515 bool border_accepts_events, | 515 bool border_accepts_events, |
(...skipping 30 matching lines...) Expand all Loading... |
546 | 546 |
547 // We can now create the internal widgets. | 547 // We can now create the internal widgets. |
548 InitChildWidgets(); | 548 InitChildWidgets(); |
549 | 549 |
550 #if defined(USE_AURA) | 550 #if defined(USE_AURA) |
551 aura::Window* window = GetWidget()->GetNativeWindow(); | 551 aura::Window* window = GetWidget()->GetNativeWindow(); |
552 window->layer()->SetMasksToBounds(true); | 552 window->layer()->SetMasksToBounds(true); |
553 GetBubbleFrameView()->set_background(new AppListBackground( | 553 GetBubbleFrameView()->set_background(new AppListBackground( |
554 GetBubbleFrameView()->bubble_border()->GetBorderCornerRadius())); | 554 GetBubbleFrameView()->bubble_border()->GetBorderCornerRadius())); |
555 set_background(NULL); | 555 set_background(NULL); |
556 window->SetEventTargeter(scoped_ptr<ui::EventTargeter>( | 556 window->SetEventTargeter(std::unique_ptr<ui::EventTargeter>( |
557 new views::BubbleWindowTargeter(this))); | 557 new views::BubbleWindowTargeter(this))); |
558 #else | 558 #else |
559 set_background(new AppListBackground( | 559 set_background(new AppListBackground( |
560 GetBubbleFrameView()->bubble_border()->GetBorderCornerRadius())); | 560 GetBubbleFrameView()->bubble_border()->GetBorderCornerRadius())); |
561 | 561 |
562 // On non-aura the bubble has two widgets, and it's possible for the border | 562 // On non-aura the bubble has two widgets, and it's possible for the border |
563 // to be shown independently in odd situations. Explicitly hide the bubble | 563 // to be shown independently in odd situations. Explicitly hide the bubble |
564 // widget to ensure that any WM_WINDOWPOSCHANGED messages triggered by the | 564 // widget to ensure that any WM_WINDOWPOSCHANGED messages triggered by the |
565 // window manager do not have the SWP_SHOWWINDOW flag set which would cause | 565 // window manager do not have the SWP_SHOWWINDOW flag set which would cause |
566 // the border to be shown. See http://crbug.com/231687 . | 566 // the border to be shown. See http://crbug.com/231687 . |
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
789 app_list_main_view_->SetVisible(true); | 789 app_list_main_view_->SetVisible(true); |
790 // Refocus the search box. However, if the app list widget does not have | 790 // Refocus the search box. However, if the app list widget does not have |
791 // focus, it means another window has already taken focus, and we *must not* | 791 // focus, it means another window has already taken focus, and we *must not* |
792 // focus the search box (or we would steal focus back into the app list). | 792 // focus the search box (or we would steal focus back into the app list). |
793 if (GetWidget()->IsActive()) | 793 if (GetWidget()->IsActive()) |
794 search_box_view_->search_box()->RequestFocus(); | 794 search_box_view_->search_box()->RequestFocus(); |
795 } | 795 } |
796 } | 796 } |
797 | 797 |
798 } // namespace app_list | 798 } // namespace app_list |
OLD | NEW |