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

Side by Side Diff: chrome/browser/ui/views/toolbar/toolbar_button.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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/toolbar/toolbar_button.h" 5 #include "chrome/browser/ui/views/toolbar/toolbar_button.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/location.h" 8 #include "base/location.h"
9 #include "base/single_thread_task_runner.h" 9 #include "base/single_thread_task_runner.h"
10 #include "base/thread_task_runner_handle.h" 10 #include "base/thread_task_runner_handle.h"
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 LabelButton::OnGestureEvent(event); 148 LabelButton::OnGestureEvent(event);
149 } 149 }
150 150
151 void ToolbarButton::GetAccessibleState(ui::AXViewState* state) { 151 void ToolbarButton::GetAccessibleState(ui::AXViewState* state) {
152 CustomButton::GetAccessibleState(state); 152 CustomButton::GetAccessibleState(state);
153 state->role = ui::AX_ROLE_BUTTON_DROP_DOWN; 153 state->role = ui::AX_ROLE_BUTTON_DROP_DOWN;
154 state->default_action = l10n_util::GetStringUTF16(IDS_APP_ACCACTION_PRESS); 154 state->default_action = l10n_util::GetStringUTF16(IDS_APP_ACCACTION_PRESS);
155 state->AddStateFlag(ui::AX_STATE_HASPOPUP); 155 state->AddStateFlag(ui::AX_STATE_HASPOPUP);
156 } 156 }
157 157
158 scoped_ptr<views::LabelButtonBorder> 158 std::unique_ptr<views::LabelButtonBorder> ToolbarButton::CreateDefaultBorder()
159 ToolbarButton::CreateDefaultBorder() const { 159 const {
160 scoped_ptr<views::LabelButtonBorder> border = 160 std::unique_ptr<views::LabelButtonBorder> border =
161 views::LabelButton::CreateDefaultBorder(); 161 views::LabelButton::CreateDefaultBorder();
162 162
163 if (ThemeServiceFactory::GetForProfile(profile_)->UsingSystemTheme()) 163 if (ThemeServiceFactory::GetForProfile(profile_)->UsingSystemTheme())
164 border->set_insets(GetLayoutInsets(TOOLBAR_BUTTON)); 164 border->set_insets(GetLayoutInsets(TOOLBAR_BUTTON));
165 165
166 return border; 166 return border;
167 } 167 }
168 168
169 void ToolbarButton::ShowContextMenuForView(View* source, 169 void ToolbarButton::ShowContextMenuForView(View* source,
170 const gfx::Point& point, 170 const gfx::Point& point,
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
253 // Set the state back to normal after the drop down menu is closed. 253 // Set the state back to normal after the drop down menu is closed.
254 if (state() != STATE_DISABLED) 254 if (state() != STATE_DISABLED)
255 SetState(STATE_NORMAL); 255 SetState(STATE_NORMAL);
256 256
257 menu_model_adapter_.reset(); 257 menu_model_adapter_.reset();
258 } 258 }
259 259
260 const char* ToolbarButton::GetClassName() const { 260 const char* ToolbarButton::GetClassName() const {
261 return "ToolbarButton"; 261 return "ToolbarButton";
262 } 262 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/toolbar/toolbar_button.h ('k') | chrome/browser/ui/views/toolbar/toolbar_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698