OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <string> | 5 #include <string> |
6 | 6 |
7 #include "ash/shell.h" | 7 #include "ash/shell.h" |
8 #include "ash/shell/example_factory.h" | 8 #include "ash/shell/example_factory.h" |
9 #include "ash/shell/toplevel_window.h" | 9 #include "ash/shell/toplevel_window.h" |
10 #include "ash/shell_delegate.h" | 10 #include "ash/shell_delegate.h" |
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
196 | 196 |
197 std::string title = WindowTypeLauncherItem::GetTitle(type); | 197 std::string title = WindowTypeLauncherItem::GetTitle(type); |
198 apps->Add(new WindowTypeLauncherItem(type)); | 198 apps->Add(new WindowTypeLauncherItem(type)); |
199 } | 199 } |
200 } | 200 } |
201 | 201 |
202 gfx::ImageSkia CreateSearchBoxIcon() { | 202 gfx::ImageSkia CreateSearchBoxIcon() { |
203 const string16 icon_text = ASCIIToUTF16("ash"); | 203 const string16 icon_text = ASCIIToUTF16("ash"); |
204 const gfx::Size icon_size(32, 32); | 204 const gfx::Size icon_size(32, 32); |
205 | 205 |
206 gfx::Canvas canvas(icon_size, ui::SCALE_FACTOR_100P, | 206 gfx::Canvas canvas(icon_size, false /* is_opaque */); |
207 false /* is_opaque */); | |
208 canvas.DrawStringInt(icon_text, | 207 canvas.DrawStringInt(icon_text, |
209 gfx::Font(), | 208 gfx::Font(), |
210 SK_ColorBLACK, | 209 SK_ColorBLACK, |
211 0, 0, icon_size.width(), icon_size.height(), | 210 0, 0, icon_size.width(), icon_size.height(), |
212 gfx::Canvas::TEXT_ALIGN_CENTER | | 211 gfx::Canvas::TEXT_ALIGN_CENTER | |
213 gfx::Canvas::TEXT_VALIGN_MIDDLE | | 212 gfx::Canvas::TEXT_VALIGN_MIDDLE | |
214 gfx::Canvas::NO_SUBPIXEL_RENDERING); | 213 gfx::Canvas::NO_SUBPIXEL_RENDERING); |
215 | 214 |
216 return gfx::ImageSkia(canvas.ExtractImageRep()); | 215 return gfx::ImageSkia(canvas.ExtractImageSkiaRep()); |
217 } | 216 } |
218 | 217 |
219 void DecorateSearchBox(app_list::SearchBoxModel* search_box_model) { | 218 void DecorateSearchBox(app_list::SearchBoxModel* search_box_model) { |
220 search_box_model->SetIcon(CreateSearchBoxIcon()); | 219 search_box_model->SetIcon(CreateSearchBoxIcon()); |
221 search_box_model->SetHintText(ASCIIToUTF16("Type to search...")); | 220 search_box_model->SetHintText(ASCIIToUTF16("Type to search...")); |
222 } | 221 } |
223 | 222 |
224 // Overridden from ash::AppListViewDelegate: | 223 // Overridden from ash::AppListViewDelegate: |
225 virtual void SetModel(app_list::AppListModel* model) OVERRIDE { | 224 virtual void SetModel(app_list::AppListModel* model) OVERRIDE { |
226 model_ = model; | 225 model_ = model; |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
277 }; | 276 }; |
278 | 277 |
279 } // namespace | 278 } // namespace |
280 | 279 |
281 app_list::AppListViewDelegate* CreateAppListViewDelegate() { | 280 app_list::AppListViewDelegate* CreateAppListViewDelegate() { |
282 return new ExampleAppListViewDelegate; | 281 return new ExampleAppListViewDelegate; |
283 } | 282 } |
284 | 283 |
285 } // namespace shell | 284 } // namespace shell |
286 } // namespace ash | 285 } // namespace ash |
OLD | NEW |