OLD | NEW |
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 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
164 } | 164 } |
165 | 165 |
166 scoped_ptr<views::LabelButtonBorder> | 166 scoped_ptr<views::LabelButtonBorder> |
167 ToolbarButton::CreateDefaultBorder() const { | 167 ToolbarButton::CreateDefaultBorder() const { |
168 scoped_ptr<views::LabelButtonBorder> border = | 168 scoped_ptr<views::LabelButtonBorder> border = |
169 views::LabelButton::CreateDefaultBorder(); | 169 views::LabelButton::CreateDefaultBorder(); |
170 | 170 |
171 if (ThemeServiceFactory::GetForProfile(profile_)->UsingSystemTheme()) | 171 if (ThemeServiceFactory::GetForProfile(profile_)->UsingSystemTheme()) |
172 border->set_insets(GetLayoutInsets(TOOLBAR_BUTTON)); | 172 border->set_insets(GetLayoutInsets(TOOLBAR_BUTTON)); |
173 | 173 |
174 return border.Pass(); | 174 return border; |
175 } | 175 } |
176 | 176 |
177 void ToolbarButton::ShowContextMenuForView(View* source, | 177 void ToolbarButton::ShowContextMenuForView(View* source, |
178 const gfx::Point& point, | 178 const gfx::Point& point, |
179 ui::MenuSourceType source_type) { | 179 ui::MenuSourceType source_type) { |
180 if (!enabled()) | 180 if (!enabled()) |
181 return; | 181 return; |
182 | 182 |
183 show_menu_factory_.InvalidateWeakPtrs(); | 183 show_menu_factory_.InvalidateWeakPtrs(); |
184 ShowDropDownMenu(source_type); | 184 ShowDropDownMenu(source_type); |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
299 SetState(STATE_NORMAL); | 299 SetState(STATE_NORMAL); |
300 } | 300 } |
301 | 301 |
302 const char* ToolbarButton::GetClassName() const { | 302 const char* ToolbarButton::GetClassName() const { |
303 return "ToolbarButton"; | 303 return "ToolbarButton"; |
304 } | 304 } |
305 | 305 |
306 gfx::Point ToolbarButton::CalculateInkDropCenter() const { | 306 gfx::Point ToolbarButton::CalculateInkDropCenter() const { |
307 return GetLocalBounds().CenterPoint(); | 307 return GetLocalBounds().CenterPoint(); |
308 } | 308 } |
OLD | NEW |