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

Side by Side Diff: ui/views/test/combobox_test_api.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/views/style/platform_style_mac.mm ('k') | ui/views/test/default_platform_test_helper.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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/test/combobox_test_api.h" 5 #include "ui/views/test/combobox_test_api.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "base/memory/ptr_util.h"
10 #include "ui/base/models/menu_model.h" 11 #include "ui/base/models/menu_model.h"
11 #include "ui/views/controls/combobox/combobox.h" 12 #include "ui/views/controls/combobox/combobox.h"
12 #include "ui/views/controls/menu/menu_runner.h" 13 #include "ui/views/controls/menu/menu_runner.h"
13 #include "ui/views/controls/menu/menu_runner_handler.h" 14 #include "ui/views/controls/menu/menu_runner_handler.h"
14 #include "ui/views/test/menu_runner_test_api.h" 15 #include "ui/views/test/menu_runner_test_api.h"
15 16
16 namespace views { 17 namespace views {
17 namespace test { 18 namespace test {
18 namespace { 19 namespace {
19 20
(...skipping 23 matching lines...) Expand all
43 44
44 void ComboboxTestApi::PerformActionAt(int index) { 45 void ComboboxTestApi::PerformActionAt(int index) {
45 menu_model()->ActivatedAt(index); 46 menu_model()->ActivatedAt(index);
46 } 47 }
47 48
48 void ComboboxTestApi::InstallTestMenuRunner(int* menu_show_count) { 49 void ComboboxTestApi::InstallTestMenuRunner(int* menu_show_count) {
49 combobox_->menu_runner_.reset( 50 combobox_->menu_runner_.reset(
50 new MenuRunner(menu_model(), MenuRunner::COMBOBOX)); 51 new MenuRunner(menu_model(), MenuRunner::COMBOBOX));
51 test::MenuRunnerTestAPI test_api(combobox_->menu_runner_.get()); 52 test::MenuRunnerTestAPI test_api(combobox_->menu_runner_.get());
52 test_api.SetMenuRunnerHandler( 53 test_api.SetMenuRunnerHandler(
53 make_scoped_ptr(new TestMenuRunnerHandler(menu_show_count))); 54 base::WrapUnique(new TestMenuRunnerHandler(menu_show_count)));
54 } 55 }
55 56
56 gfx::Size ComboboxTestApi::content_size() { 57 gfx::Size ComboboxTestApi::content_size() {
57 return combobox_->content_size_; 58 return combobox_->content_size_;
58 } 59 }
59 60
60 ui::MenuModel* ComboboxTestApi::menu_model() { 61 ui::MenuModel* ComboboxTestApi::menu_model() {
61 return combobox_->menu_model_adapter_.get(); 62 return combobox_->menu_model_adapter_.get();
62 } 63 }
63 64
64 } // test 65 } // test
65 } // views 66 } // views
OLDNEW
« no previous file with comments | « ui/views/style/platform_style_mac.mm ('k') | ui/views/test/default_platform_test_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698