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

Side by Side Diff: chrome/browser/chromeos/views/copy_background.cc

Issue 8771006: views: Move the remaining file from views/ to ui/views/. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years 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
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "chrome/browser/chromeos/views/copy_background.h" 5 #include "chrome/browser/chromeos/views/copy_background.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "ui/gfx/canvas.h" 8 #include "ui/gfx/canvas.h"
9 #include "ui/views/background.h"
9 #include "ui/views/view.h" 10 #include "ui/views/view.h"
10 #include "views/background.h"
11 11
12 namespace chromeos { 12 namespace chromeos {
13 13
14 CopyBackground::CopyBackground(views::View* copy_from) 14 CopyBackground::CopyBackground(views::View* copy_from)
15 : background_owner_(copy_from) { 15 : background_owner_(copy_from) {
16 DCHECK(background_owner_); 16 DCHECK(background_owner_);
17 DCHECK(background_owner_->background()); 17 DCHECK(background_owner_->background());
18 } 18 }
19 19
20 void CopyBackground::Paint(gfx::Canvas* canvas, views::View* view) const { 20 void CopyBackground::Paint(gfx::Canvas* canvas, views::View* view) const {
21 const Background* background = background_owner_->background(); 21 const Background* background = background_owner_->background();
22 DCHECK(background); 22 DCHECK(background);
23 gfx::Point origin(0, 0); 23 gfx::Point origin(0, 0);
24 views::View::ConvertPointToView(view, background_owner_, &origin); 24 views::View::ConvertPointToView(view, background_owner_, &origin);
25 canvas->Save(); 25 canvas->Save();
26 // Move the origin and paint as if it's paint onto the owner. 26 // Move the origin and paint as if it's paint onto the owner.
27 canvas->Translate(gfx::Point().Subtract(origin)); 27 canvas->Translate(gfx::Point().Subtract(origin));
28 background->Paint(canvas, background_owner_); 28 background->Paint(canvas, background_owner_);
29 canvas->Restore(); 29 canvas->Restore();
30 } 30 }
31 31
32 } // namespace chromeos 32 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/views/copy_background.h ('k') | chrome/browser/extensions/extension_input_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698