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

Side by Side Diff: chrome/browser/views/star_toggle.cc

Issue 24011: chrome_resources take 2 (Closed)
Patch Set: rebase Created 11 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
« no previous file with comments | « chrome/browser/views/shelf_item_dialog.cc ('k') | chrome/browser/views/status_bubble_views.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) 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
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 }
OLDNEW
« no previous file with comments | « chrome/browser/views/shelf_item_dialog.cc ('k') | chrome/browser/views/status_bubble_views.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698