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

Side by Side Diff: chrome/views/throbber.cc

Issue 7344: Convert GetPreferredSize from:... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 12 years, 2 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
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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/views/throbber.h" 5 #include "chrome/views/throbber.h"
6 6
7 #include "chrome/app/theme/theme_resources.h" 7 #include "chrome/app/theme/theme_resources.h"
8 #include "chrome/common/gfx/chrome_canvas.h" 8 #include "chrome/common/gfx/chrome_canvas.h"
9 #include "chrome/common/logging_chrome.h" 9 #include "chrome/common/logging_chrome.h"
10 #include "chrome/common/resource_bundle.h" 10 #include "chrome/common/resource_bundle.h"
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 running_ = false; 55 running_ = false;
56 SchedulePaint(); // Important if we're not painting while stopped 56 SchedulePaint(); // Important if we're not painting while stopped
57 } 57 }
58 58
59 void Throbber::Run() { 59 void Throbber::Run() {
60 DCHECK(running_); 60 DCHECK(running_);
61 61
62 SchedulePaint(); 62 SchedulePaint();
63 } 63 }
64 64
65 void Throbber::GetPreferredSize(CSize *out) { 65 gfx::Size Throbber::GetPreferredSize() {
66 DCHECK(out); 66 return gfx::Size(frames_->height(), frames_->height());
67
68 out->SetSize(frames_->height(), frames_->height());
69 } 67 }
70 68
71 void Throbber::Paint(ChromeCanvas* canvas) { 69 void Throbber::Paint(ChromeCanvas* canvas) {
72 if (!running_ && !paint_while_stopped_) 70 if (!running_ && !paint_while_stopped_)
73 return; 71 return;
74 72
75 DWORD current_time = GetTickCount(); 73 DWORD current_time = GetTickCount();
76 int current_frame = 0; 74 int current_frame = 0;
77 75
78 // deal with timer wraparound 76 // deal with timer wraparound
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 checkmark_ = rb.GetBitmapNamed(IDR_INPUT_GOOD); 173 checkmark_ = rb.GetBitmapNamed(IDR_INPUT_GOOD);
176 initialized = true; 174 initialized = true;
177 } 175 }
178 } 176 }
179 177
180 // static 178 // static
181 SkBitmap* CheckmarkThrobber::checkmark_ = NULL; 179 SkBitmap* CheckmarkThrobber::checkmark_ = NULL;
182 180
183 } // namespace ChromeViews 181 } // namespace ChromeViews
184 182
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698