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, false /* is_opaque */); | 206 gfx::Canvas canvas( |
207 icon_size, ui::SCALE_FACTOR_100P, false /* is_opaque */); | |
sky
2012/07/16 14:26:51
How come we don't want this at the current scale?
pkotwicz
2012/07/17 17:19:52
This is part of the ash shell demo code, so I don'
| |
207 canvas.DrawStringInt(icon_text, | 208 canvas.DrawStringInt(icon_text, |
208 gfx::Font(), | 209 gfx::Font(), |
209 SK_ColorBLACK, | 210 SK_ColorBLACK, |
210 0, 0, icon_size.width(), icon_size.height(), | 211 0, 0, icon_size.width(), icon_size.height(), |
211 gfx::Canvas::TEXT_ALIGN_CENTER | | 212 gfx::Canvas::TEXT_ALIGN_CENTER | |
212 gfx::Canvas::TEXT_VALIGN_MIDDLE | | 213 gfx::Canvas::TEXT_VALIGN_MIDDLE | |
213 gfx::Canvas::NO_SUBPIXEL_RENDERING); | 214 gfx::Canvas::NO_SUBPIXEL_RENDERING); |
214 | 215 |
215 return gfx::ImageSkia(canvas.ExtractImageSkiaRep()); | 216 return gfx::ImageSkia(canvas.ExtractImageRep()); |
216 } | 217 } |
217 | 218 |
218 void DecorateSearchBox(app_list::SearchBoxModel* search_box_model) { | 219 void DecorateSearchBox(app_list::SearchBoxModel* search_box_model) { |
219 search_box_model->SetIcon(CreateSearchBoxIcon()); | 220 search_box_model->SetIcon(CreateSearchBoxIcon()); |
220 search_box_model->SetHintText(ASCIIToUTF16("Type to search...")); | 221 search_box_model->SetHintText(ASCIIToUTF16("Type to search...")); |
221 } | 222 } |
222 | 223 |
223 // Overridden from ash::AppListViewDelegate: | 224 // Overridden from ash::AppListViewDelegate: |
224 virtual void SetModel(app_list::AppListModel* model) OVERRIDE { | 225 virtual void SetModel(app_list::AppListModel* model) OVERRIDE { |
225 model_ = model; | 226 model_ = model; |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
276 }; | 277 }; |
277 | 278 |
278 } // namespace | 279 } // namespace |
279 | 280 |
280 app_list::AppListViewDelegate* CreateAppListViewDelegate() { | 281 app_list::AppListViewDelegate* CreateAppListViewDelegate() { |
281 return new ExampleAppListViewDelegate; | 282 return new ExampleAppListViewDelegate; |
282 } | 283 } |
283 | 284 |
284 } // namespace shell | 285 } // namespace shell |
285 } // namespace ash | 286 } // namespace ash |
OLD | NEW |