OLD | NEW |
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/browser/views/star_toggle.h" | 5 #include "chrome/browser/views/star_toggle.h" |
6 | 6 |
7 #include "chrome/app/chrome_dll_resource.h" | 7 #include "chrome/app/chrome_dll_resource.h" |
8 #include "chrome/app/theme/theme_resources.h" | 8 #include "grit/theme_resources.h" |
9 #include "chrome/common/gfx/chrome_canvas.h" | 9 #include "chrome/common/gfx/chrome_canvas.h" |
10 #include "chrome/common/resource_bundle.h" | 10 #include "chrome/common/resource_bundle.h" |
11 | 11 |
12 StarToggle::StarToggle(Delegate* delegate) | 12 StarToggle::StarToggle(Delegate* delegate) |
13 : delegate_(delegate), | 13 : delegate_(delegate), |
14 state_(false), | 14 state_(false), |
15 change_state_immediately_(false) { | 15 change_state_immediately_(false) { |
16 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); | 16 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); |
17 state_off_ = rb.GetBitmapNamed(IDR_CONTENT_STAR_OFF); | 17 state_off_ = rb.GetBitmapNamed(IDR_CONTENT_STAR_OFF); |
18 state_on_ = rb.GetBitmapNamed(IDR_CONTENT_STAR_ON); | 18 state_on_ = rb.GetBitmapNamed(IDR_CONTENT_STAR_ON); |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 return false; | 70 return false; |
71 } | 71 } |
72 | 72 |
73 void StarToggle::SwitchState() { | 73 void StarToggle::SwitchState() { |
74 const bool new_state = !state_; | 74 const bool new_state = !state_; |
75 if (change_state_immediately_) | 75 if (change_state_immediately_) |
76 state_ = new_state; | 76 state_ = new_state; |
77 SchedulePaint(); | 77 SchedulePaint(); |
78 delegate_->StarStateChanged(new_state); | 78 delegate_->StarStateChanged(new_state); |
79 } | 79 } |
OLD | NEW |