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

Side by Side Diff: ui/app_list/views/app_list_view.cc

Issue 1868363002: Replace scoped_ptr with std::unique_ptr in //ui (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@scopedptrcc
Patch Set: scopedptrui: rebase-make_scoped_ptr Created 4 years, 8 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
« no previous file with comments | « ui/app_list/views/app_list_view.h ('k') | ui/app_list/views/app_list_view_unittest.cc » ('j') | 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) 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
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
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
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
OLDNEW
« no previous file with comments | « ui/app_list/views/app_list_view.h ('k') | ui/app_list/views/app_list_view_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698