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

Issue 6976048: views: Add OnEnabledChanged() method to View class. (Closed)

Created:
9 years, 7 months ago by tfarina
Modified:
9 years, 7 months ago
CC:
chromium-reviews
Visibility:
Public.

Description

views: Add OnEnabledChanged() method to View class. Changes done here: - Override OnEnabledChanged() in the derived classes from View instead of SetEnable(). - Make SetEnable() a member function not a virtual one. - Make |enabled_| a private data member variable not a protected one. - Some other misc cleanups. Note: The third item was a TODO for beng. BUG=72040 TEST=None R=ben@chromium.org Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=87080

Patch Set 1 #

Total comments: 22

Patch Set 2 : call OnEnabledChanged instead of SetEnabled #

Patch Set 3 : remove bool parameter #

Total comments: 2

Patch Set 4 : fix win, move OnEnabledChanged to protected section, add comment #

Total comments: 1

Patch Set 5 : View::IsEnabled #

Patch Set 6 : is_visible_ changes #

Total comments: 6

Patch Set 7 : remove View:: prefix, reverse condition #

Total comments: 4

Patch Set 8 : get rid of extra SchedulePaint call #

Patch Set 9 : fix DisableOnHover test? #

Unified diffs Side-by-side diffs Delta from patch set Stats (+89 lines, -99 lines) Patch
M views/controls/button/checkbox.h View 1 2 1 chunk +1 line, -1 line 0 comments Download
M views/controls/button/checkbox.cc View 1 2 3 4 5 6 1 chunk +3 lines, -3 lines 0 comments Download
M views/controls/button/custom_button.h View 1 2 3 2 chunks +2 lines, -2 lines 0 comments Download
M views/controls/button/custom_button.cc View 1 2 3 4 7 8 2 chunks +4 lines, -4 lines 0 comments Download
M views/controls/button/native_button.h View 1 2 1 chunk +1 line, -1 line 0 comments Download
M views/controls/button/native_button.cc View 1 2 1 chunk +2 lines, -2 lines 0 comments Download
M views/controls/button/text_button.h View 1 2 1 chunk +1 line, -1 line 0 comments Download
M views/controls/button/text_button.cc View 1 2 3 4 5 6 7 1 chunk +2 lines, -5 lines 0 comments Download
M views/controls/combobox/combobox.h View 1 2 1 chunk +1 line, -1 line 0 comments Download
M views/controls/combobox/combobox.cc View 1 2 1 chunk +2 lines, -2 lines 0 comments Download
M views/controls/label.h View 1 2 1 chunk +1 line, -1 line 0 comments Download
M views/controls/label.cc View 1 2 3 4 5 6 1 chunk +3 lines, -5 lines 0 comments Download
M views/controls/link.h View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M views/controls/link.cc View 1 2 3 4 5 6 5 chunks +10 lines, -11 lines 0 comments Download
M views/controls/native_control.h View 1 2 3 2 chunks +2 lines, -2 lines 0 comments Download
M views/controls/native_control.cc View 1 2 3 4 5 6 4 chunks +7 lines, -11 lines 0 comments Download
M views/controls/native_control_gtk.h View 1 2 1 chunk +1 line, -1 line 0 comments Download
M views/controls/native_control_gtk.cc View 1 2 3 4 5 6 1 chunk +4 lines, -6 lines 0 comments Download
M views/controls/native_control_win.h View 1 2 1 chunk +1 line, -1 line 0 comments Download
M views/controls/native_control_win.cc View 1 2 3 4 5 6 2 chunks +5 lines, -7 lines 0 comments Download
M views/controls/progress_bar.h View 1 2 3 2 chunks +2 lines, -2 lines 0 comments Download
M views/controls/progress_bar.cc View 1 2 3 2 chunks +3 lines, -5 lines 0 comments Download
M views/controls/resize_area.cc View 1 2 3 4 5 6 1 chunk +1 line, -1 line 0 comments Download
M views/controls/textfield/textfield.h View 1 2 1 chunk +1 line, -1 line 0 comments Download
M views/controls/textfield/textfield.cc View 1 2 1 chunk +2 lines, -2 lines 0 comments Download
M views/view.h View 1 2 3 4 5 4 chunks +9 lines, -6 lines 0 comments Download
M views/view.cc View 1 2 3 4 5 6 7 4 chunks +17 lines, -14 lines 0 comments Download

Messages

Total messages: 12 (0 generated)
Ben Goodger (Google)
All the places you rename to OnEnabledChanged you need to have them call View::OnEnabledChanged not ...
9 years, 7 months ago (2011-05-27 16:01:21 UTC) #1
tfarina
http://codereview.chromium.org/6976048/diff/1/views/controls/button/checkbox.cc File views/controls/button/checkbox.cc (right): http://codereview.chromium.org/6976048/diff/1/views/controls/button/checkbox.cc#newcode94 views/controls/button/checkbox.cc:94: NativeButtonBase::SetEnabled(enabled); On 2011/05/27 16:01:21, Ben Goodger wrote: > This ...
9 years, 7 months ago (2011-05-27 16:25:03 UTC) #2
Ben Goodger (Google)
What is the "protected" issue you mentioned in the other CL that you say isn't ...
9 years, 7 months ago (2011-05-27 16:30:15 UTC) #3
tfarina
On 2011/05/27 16:30:15, Ben Goodger wrote: > What is the "protected" issue you mentioned in ...
9 years, 7 months ago (2011-05-27 16:47:54 UTC) #4
Ben Goodger (Google)
Can you just pull those changes over to this one? On Fri, May 27, 2011 ...
9 years, 7 months ago (2011-05-27 16:49:20 UTC) #5
tfarina
On 2011/05/27 16:49:20, Ben Goodger wrote: > Can you just pull those changes over to ...
9 years, 7 months ago (2011-05-27 17:10:40 UTC) #6
tfarina
http://codereview.chromium.org/6976048/diff/4002/views/controls/native_control.cc File views/controls/native_control.cc (right): http://codereview.chromium.org/6976048/diff/4002/views/controls/native_control.cc#newcode181 views/controls/native_control.cc:181: enabled_ = true; I've removed this. View already initialize ...
9 years, 7 months ago (2011-05-27 17:10:48 UTC) #7
Ben Goodger (Google)
http://codereview.chromium.org/6976048/diff/2057/views/controls/button/checkbox.cc File views/controls/button/checkbox.cc (right): http://codereview.chromium.org/6976048/diff/2057/views/controls/button/checkbox.cc#newcode96 views/controls/button/checkbox.cc:96: label_->SetEnabled(View::IsEnabled()); In these cases you should be able to ...
9 years, 7 months ago (2011-05-27 17:43:02 UTC) #8
tfarina
http://codereview.chromium.org/6976048/diff/2057/views/controls/button/checkbox.cc File views/controls/button/checkbox.cc (right): http://codereview.chromium.org/6976048/diff/2057/views/controls/button/checkbox.cc#newcode96 views/controls/button/checkbox.cc:96: label_->SetEnabled(View::IsEnabled()); On 2011/05/27 17:43:02, Ben Goodger wrote: > In ...
9 years, 7 months ago (2011-05-27 18:05:07 UTC) #9
tfarina
http://codereview.chromium.org/6976048/diff/3006/views/controls/button/text_button.cc File views/controls/button/text_button.cc (right): http://codereview.chromium.org/6976048/diff/3006/views/controls/button/text_button.cc#newcode564 views/controls/button/text_button.cc:564: CustomButton::OnEnabledChanged(); It seems this call can be moved in ...
9 years, 7 months ago (2011-05-27 18:14:43 UTC) #10
Ben Goodger (Google)
LGTM http://codereview.chromium.org/6976048/diff/3006/views/controls/button/text_button.cc File views/controls/button/text_button.cc (right): http://codereview.chromium.org/6976048/diff/3006/views/controls/button/text_button.cc#newcode564 views/controls/button/text_button.cc:564: CustomButton::OnEnabledChanged(); On 2011/05/27 18:14:44, tfarina wrote: > It ...
9 years, 7 months ago (2011-05-27 18:19:06 UTC) #11
tfarina
9 years, 7 months ago (2011-05-27 18:22:26 UTC) #12
http://codereview.chromium.org/6976048/diff/3006/views/controls/button/text_b...
File views/controls/button/text_button.cc (right):

http://codereview.chromium.org/6976048/diff/3006/views/controls/button/text_b...
views/controls/button/text_button.cc:564: CustomButton::OnEnabledChanged();
On 2011/05/27 18:19:06, Ben Goodger wrote:
> On 2011/05/27 18:14:44, tfarina wrote:
> > It seems this call can be moved in the place of the SchedulePaint() call
> below.
> 
> Yes you can just get rid of the SchedulePaint().

Done.

Powered by Google App Engine
This is Rietveld 408576698