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

Side by Side Diff: ui/app_list/views/speech_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
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/speech_view.h" 5 #include "ui/app_list/views/speech_view.h"
6 6
7 #include "base/strings/utf_string_conversions.h" 7 #include "base/strings/utf_string_conversions.h"
8 #include "grit/ui_resources.h" 8 #include "grit/ui_resources.h"
9 #include "grit/ui_strings.h" 9 #include "grit/ui_strings.h"
10 #include "ui/app_list/app_list_model.h" 10 #include "ui/app_list/app_list_model.h"
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 return (rect.origin() - local_bounds.CenterPoint()).LengthSquared() < 87 return (rect.origin() - local_bounds.CenterPoint()).LengthSquared() <
88 radius * radius; 88 radius * radius;
89 } 89 }
90 90
91 } // namespace 91 } // namespace
92 92
93 // static 93 // static
94 94
95 SpeechView::SpeechView(AppListViewDelegate* delegate) 95 SpeechView::SpeechView(AppListViewDelegate* delegate)
96 : delegate_(delegate) { 96 : delegate_(delegate) {
97 set_border(new views::ShadowBorder( 97 SetBorder(scoped_ptr<views::Border>(
98 kShadowBlur, 98 new views::ShadowBorder(kShadowBlur,
99 kShadowColor, 99 kShadowColor,
100 kShadowOffset, // Vertical offset. 100 kShadowOffset, // Vertical offset.
101 0)); 101 0)));
102 102
103 // To keep the painting order of the border and the background, this class 103 // To keep the painting order of the border and the background, this class
104 // actually has a single child of 'container' which has white background and 104 // actually has a single child of 'container' which has white background and
105 // contains all components. 105 // contains all components.
106 views::View* container = new views::View(); 106 views::View* container = new views::View();
107 container->set_background( 107 container->set_background(
108 views::Background::CreateSolidBackground(SK_ColorWHITE)); 108 views::Background::CreateSolidBackground(SK_ColorWHITE));
109 109
110 // TODO(mukai): add Google logo. 110 // TODO(mukai): add Google logo.
111 indicator_ = new SoundLevelIndicator(); 111 indicator_ = new SoundLevelIndicator();
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
213 resource_id = IDR_APP_LIST_SPEECH_MIC_ON; 213 resource_id = IDR_APP_LIST_SPEECH_MIC_ON;
214 else if (new_state == SPEECH_RECOGNITION_IN_SPEECH) 214 else if (new_state == SPEECH_RECOGNITION_IN_SPEECH)
215 resource_id = IDR_APP_LIST_SPEECH_MIC_RECORDING; 215 resource_id = IDR_APP_LIST_SPEECH_MIC_RECORDING;
216 216
217 ui::ResourceBundle& bundle = ui::ResourceBundle::GetSharedInstance(); 217 ui::ResourceBundle& bundle = ui::ResourceBundle::GetSharedInstance();
218 mic_button_->SetImage(views::Button::STATE_NORMAL, bundle.GetImageSkiaNamed( 218 mic_button_->SetImage(views::Button::STATE_NORMAL, bundle.GetImageSkiaNamed(
219 resource_id)); 219 resource_id));
220 } 220 }
221 221
222 } // namespace app_list 222 } // namespace app_list
OLDNEW
« no previous file with comments | « ui/app_list/views/search_result_actions_view.cc ('k') | ui/message_center/views/message_center_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698