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

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

Issue 9021046: Pass const gfx::Rect& as the first parameter to FillRect. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: one more fix Created 8 years, 10 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 | « no previous file | ash/shell/toplevel_window.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) 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 "ash/shell.h" 5 #include "ash/shell.h"
6 #include "ash/shell_window_ids.h" 6 #include "ash/shell_window_ids.h"
7 #include "ash/shell/example_factory.h" 7 #include "ash/shell/example_factory.h"
8 #include "base/utf_string_conversions.h" 8 #include "base/utf_string_conversions.h"
9 #include "ui/aura/root_window.h" 9 #include "ui/aura/root_window.h"
10 #include "ui/aura/window.h" 10 #include "ui/aura/window.h"
(...skipping 13 matching lines...) Expand all
24 virtual ~LockView() {} 24 virtual ~LockView() {}
25 25
26 // Overridden from View: 26 // Overridden from View:
27 virtual gfx::Size GetPreferredSize() OVERRIDE { 27 virtual gfx::Size GetPreferredSize() OVERRIDE {
28 return gfx::Size(500, 400); 28 return gfx::Size(500, 400);
29 } 29 }
30 30
31 private: 31 private:
32 // Overridden from View: 32 // Overridden from View:
33 virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE { 33 virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE {
34 canvas->FillRect(SK_ColorYELLOW, GetLocalBounds()); 34 canvas->FillRect(GetLocalBounds(), SK_ColorYELLOW);
35 string16 text = ASCIIToUTF16("LOCKED!"); 35 string16 text = ASCIIToUTF16("LOCKED!");
36 int string_width = font_.GetStringWidth(text); 36 int string_width = font_.GetStringWidth(text);
37 canvas->DrawStringInt(text, font_, SK_ColorRED, (width() - string_width)/ 2, 37 canvas->DrawStringInt(text, font_, SK_ColorRED, (width() - string_width)/ 2,
38 (height() - font_.GetHeight()) / 2, 38 (height() - font_.GetHeight()) / 2,
39 string_width, font_.GetHeight()); 39 string_width, font_.GetHeight());
40 } 40 }
41 virtual bool OnMousePressed(const views::MouseEvent& event) OVERRIDE { 41 virtual bool OnMousePressed(const views::MouseEvent& event) OVERRIDE {
42 return true; 42 return true;
43 } 43 }
44 virtual void OnMouseReleased(const views::MouseEvent& event) OVERRIDE { 44 virtual void OnMouseReleased(const views::MouseEvent& event) OVERRIDE {
(...skipping 20 matching lines...) Expand all
65 Shell::GetInstance()->GetContainer( 65 Shell::GetInstance()->GetContainer(
66 ash::internal::kShellWindowId_LockScreenContainer)-> 66 ash::internal::kShellWindowId_LockScreenContainer)->
67 AddChild(widget->GetNativeView()); 67 AddChild(widget->GetNativeView());
68 widget->SetContentsView(lock_view); 68 widget->SetContentsView(lock_view);
69 widget->Show(); 69 widget->Show();
70 widget->GetNativeView()->SetName("LockView"); 70 widget->GetNativeView()->SetName("LockView");
71 } 71 }
72 72
73 } // namespace shell 73 } // namespace shell
74 } // namespace ash 74 } // namespace ash
OLDNEW
« no previous file with comments | « no previous file | ash/shell/toplevel_window.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698