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

Side by Side Diff: ash/shell/app_list.cc

Issue 363933002: setConfig is deprecated, use setInfo or allocPixels instead. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 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 | « ash/desktop_background/wallpaper_resizer_unittest.cc ('k') | ash/shell/window_watcher.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 (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
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
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
OLDNEW
« no previous file with comments | « ash/desktop_background/wallpaper_resizer_unittest.cc ('k') | ash/shell/window_watcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698