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

Side by Side Diff: chrome/browser/ui/views/dropdown_bar_host.cc

Issue 1865213004: Convert //chrome/browser/ui from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase 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
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 "chrome/browser/ui/views/dropdown_bar_host.h" 5 #include "chrome/browser/ui/views/dropdown_bar_host.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "chrome/browser/ui/view_ids.h" 9 #include "chrome/browser/ui/view_ids.h"
10 #include "chrome/browser/ui/views/dropdown_bar_host_delegate.h" 10 #include "chrome/browser/ui/views/dropdown_bar_host_delegate.h"
(...skipping 25 matching lines...) Expand all
36 views::View* view, 36 views::View* view,
37 DropdownBarHostDelegate* delegate) { 37 DropdownBarHostDelegate* delegate) {
38 DCHECK(view); 38 DCHECK(view);
39 DCHECK(delegate); 39 DCHECK(delegate);
40 40
41 view_ = view; 41 view_ = view;
42 delegate_ = delegate; 42 delegate_ = delegate;
43 43
44 // The |clip_view| exists to paint to a layer so that it can clip descendent 44 // The |clip_view| exists to paint to a layer so that it can clip descendent
45 // Views which also paint to a Layer. See http://crbug.com/589497 45 // Views which also paint to a Layer. See http://crbug.com/589497
46 scoped_ptr<views::View> clip_view(new views::View()); 46 std::unique_ptr<views::View> clip_view(new views::View());
47 clip_view->SetPaintToLayer(true); 47 clip_view->SetPaintToLayer(true);
48 clip_view->layer()->SetFillsBoundsOpaquely(false); 48 clip_view->layer()->SetFillsBoundsOpaquely(false);
49 clip_view->layer()->SetMasksToBounds(true); 49 clip_view->layer()->SetMasksToBounds(true);
50 clip_view->AddChildView(view_); 50 clip_view->AddChildView(view_);
51 51
52 // Initialize the host. 52 // Initialize the host.
53 host_.reset(new ThemeCopyingWidget(browser_view_->GetWidget())); 53 host_.reset(new ThemeCopyingWidget(browser_view_->GetWidget()));
54 views::Widget::InitParams params(views::Widget::InitParams::TYPE_CONTROL); 54 views::Widget::InitParams params(views::Widget::InitParams::TYPE_CONTROL);
55 params.ownership = views::Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET; 55 params.ownership = views::Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET;
56 params.parent = browser_view_->GetWidget()->GetNativeView(); 56 params.parent = browser_view_->GetWidget()->GetNativeView();
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after
229 escape, ui::AcceleratorManager::kNormalPriority, this); 229 escape, ui::AcceleratorManager::kNormalPriority, this);
230 esc_accel_target_registered_ = true; 230 esc_accel_target_registered_ = true;
231 } 231 }
232 232
233 void DropdownBarHost::UnregisterAccelerators() { 233 void DropdownBarHost::UnregisterAccelerators() {
234 DCHECK(esc_accel_target_registered_); 234 DCHECK(esc_accel_target_registered_);
235 ui::Accelerator escape(ui::VKEY_ESCAPE, ui::EF_NONE); 235 ui::Accelerator escape(ui::VKEY_ESCAPE, ui::EF_NONE);
236 focus_manager_->UnregisterAccelerator(escape, this); 236 focus_manager_->UnregisterAccelerator(escape, this);
237 esc_accel_target_registered_ = false; 237 esc_accel_target_registered_ = false;
238 } 238 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/dropdown_bar_host.h ('k') | chrome/browser/ui/views/edit_search_engine_dialog.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698