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

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

Issue 145033006: views: Make View::set_border() take a scoped_ptr<>. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase to ToT Created 6 years, 11 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 | Annotate | Revision Log
« no previous file with comments | « ui/app_list/views/search_box_view.cc ('k') | ui/app_list/views/speech_view.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 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 "ui/app_list/views/search_result_actions_view.h" 5 #include "ui/app_list/views/search_result_actions_view.h"
6 6
7 #include "ui/app_list/views/search_result_actions_view_delegate.h" 7 #include "ui/app_list/views/search_result_actions_view_delegate.h"
8 #include "ui/base/resource/resource_bundle.h" 8 #include "ui/base/resource/resource_bundle.h"
9 #include "ui/gfx/canvas.h" 9 #include "ui/gfx/canvas.h"
10 #include "ui/views/border.h" 10 #include "ui/views/border.h"
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 } 55 }
56 } 56 }
57 57
58 bool SearchResultActionsView::IsValidActionIndex(int action_index) const { 58 bool SearchResultActionsView::IsValidActionIndex(int action_index) const {
59 return action_index >= 0 && action_index < child_count(); 59 return action_index >= 0 && action_index < child_count();
60 } 60 }
61 61
62 void SearchResultActionsView::CreateImageButton( 62 void SearchResultActionsView::CreateImageButton(
63 const SearchResult::Action& action) { 63 const SearchResult::Action& action) {
64 views::ImageButton* button = new views::ImageButton(this); 64 views::ImageButton* button = new views::ImageButton(this);
65 button->set_border(views::Border::CreateEmptyBorder(0, 9, 0, 9)); 65 button->SetBorder(views::Border::CreateEmptyBorder(0, 9, 0, 9));
66 button->SetAccessibleName(action.tooltip_text); 66 button->SetAccessibleName(action.tooltip_text);
67 button->SetImageAlignment(views::ImageButton::ALIGN_CENTER, 67 button->SetImageAlignment(views::ImageButton::ALIGN_CENTER,
68 views::ImageButton::ALIGN_MIDDLE); 68 views::ImageButton::ALIGN_MIDDLE);
69 button->SetImage(views::CustomButton::STATE_NORMAL, &action.base_image); 69 button->SetImage(views::CustomButton::STATE_NORMAL, &action.base_image);
70 button->SetImage(views::CustomButton::STATE_HOVERED, &action.hover_image); 70 button->SetImage(views::CustomButton::STATE_HOVERED, &action.hover_image);
71 button->SetImage(views::CustomButton::STATE_PRESSED, &action.pressed_image); 71 button->SetImage(views::CustomButton::STATE_PRESSED, &action.pressed_image);
72 button->SetTooltipText(action.tooltip_text); 72 button->SetTooltipText(action.tooltip_text);
73 AddChildView(button); 73 AddChildView(button);
74 } 74 }
75 75
(...skipping 21 matching lines...) Expand all
97 const ui::Event& event) { 97 const ui::Event& event) {
98 if (!delegate_) 98 if (!delegate_)
99 return; 99 return;
100 100
101 const int index = GetIndexOf(sender); 101 const int index = GetIndexOf(sender);
102 DCHECK_NE(-1, index); 102 DCHECK_NE(-1, index);
103 delegate_->OnSearchResultActionActivated(index, event.flags()); 103 delegate_->OnSearchResultActionActivated(index, event.flags());
104 } 104 }
105 105
106 } // namespace app_list 106 } // namespace app_list
OLDNEW
« no previous file with comments | « ui/app_list/views/search_box_view.cc ('k') | ui/app_list/views/speech_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698