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/session/session_state_delegate.h" | 7 #include "ash/session/session_state_delegate.h" |
8 #include "ash/shell.h" | 8 #include "ash/shell.h" |
9 #include "ash/shell/example_factory.h" | 9 #include "ash/shell/example_factory.h" |
10 #include "ash/shell/toplevel_window.h" | 10 #include "ash/shell/toplevel_window.h" |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 static const SkColor kColors[] = { | 60 static const SkColor kColors[] = { |
61 SK_ColorRED, | 61 SK_ColorRED, |
62 SK_ColorGREEN, | 62 SK_ColorGREEN, |
63 SK_ColorBLUE, | 63 SK_ColorBLUE, |
64 SK_ColorYELLOW, | 64 SK_ColorYELLOW, |
65 SK_ColorCYAN, | 65 SK_ColorCYAN, |
66 }; | 66 }; |
67 | 67 |
68 const int kIconSize = 128; | 68 const int kIconSize = 128; |
69 SkBitmap icon; | 69 SkBitmap icon; |
70 icon.setConfig(SkBitmap::kARGB_8888_Config, kIconSize, kIconSize); | 70 icon.allocN32Pixels(kIconSize, kIconSize); |
71 icon.allocPixels(); | |
72 icon.eraseColor(kColors[static_cast<int>(type) % arraysize(kColors)]); | 71 icon.eraseColor(kColors[static_cast<int>(type) % arraysize(kColors)]); |
73 return gfx::ImageSkia::CreateFrom1xBitmap(icon); | 72 return gfx::ImageSkia::CreateFrom1xBitmap(icon); |
74 } | 73 } |
75 | 74 |
76 // The text below is not localized as this is an example code. | 75 // The text below is not localized as this is an example code. |
77 static std::string GetTitle(Type type) { | 76 static std::string GetTitle(Type type) { |
78 switch (type) { | 77 switch (type) { |
79 case TOPLEVEL_WINDOW: | 78 case TOPLEVEL_WINDOW: |
80 return "Create Window"; | 79 return "Create Window"; |
81 case NON_RESIZABLE_WINDOW: | 80 case NON_RESIZABLE_WINDOW: |
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
370 }; | 369 }; |
371 | 370 |
372 } // namespace | 371 } // namespace |
373 | 372 |
374 app_list::AppListViewDelegate* CreateAppListViewDelegate() { | 373 app_list::AppListViewDelegate* CreateAppListViewDelegate() { |
375 return new ExampleAppListViewDelegate; | 374 return new ExampleAppListViewDelegate; |
376 } | 375 } |
377 | 376 |
378 } // namespace shell | 377 } // namespace shell |
379 } // namespace ash | 378 } // namespace ash |
OLD | NEW |