| OLD | NEW |
| (Empty) |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_IMAGE_BACKGROUND_H_ | |
| 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_IMAGE_BACKGROUND_H_ | |
| 7 | |
| 8 #include "base/basictypes.h" | |
| 9 #include "views/background.h" | |
| 10 #include "app/gfx/canvas.h" | |
| 11 | |
| 12 namespace gfx { | |
| 13 class Canvas; | |
| 14 } | |
| 15 | |
| 16 namespace views { | |
| 17 | |
| 18 class ImageBackground : public Background { | |
| 19 public: | |
| 20 explicit ImageBackground(GdkPixbuf* background_image) | |
| 21 : background_image_(background_image) { | |
| 22 } | |
| 23 | |
| 24 virtual ~ImageBackground() {} | |
| 25 | |
| 26 void Paint(gfx::Canvas* canvas, View* view) const { | |
| 27 canvas->DrawGdkPixbuf(background_image_, 0, 0); | |
| 28 } | |
| 29 private: | |
| 30 // Background image that is drawn by this background. | |
| 31 // This class does _not_ take ownership of the image. | |
| 32 GdkPixbuf* background_image_; | |
| 33 DISALLOW_COPY_AND_ASSIGN(ImageBackground); | |
| 34 }; | |
| 35 | |
| 36 } // namespace views | |
| 37 | |
| 38 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_IMAGE_BACKGROUND_H_ | |
| 39 | |
| OLD | NEW |