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

Issue 8347016: chromeos: Simplify power supply info in PowerLibrary (Closed)

Created:
9 years, 2 months ago by Simon Que
Modified:
9 years, 1 month ago
Reviewers:
stevenjb, satorux1
CC:
chromium-reviews, cbentzel+watch_chromium.org, nkostylev+watch_chromium.org, kkania, robertshield, Paweł Hajdan Jr., darin-cc_chromium.org, stevenjb+watch_chromium.org, davemoore+watch_chromium.org
Base URL:
http://git.chromium.org/chromium/src.git@master
Visibility:
Public.

Description

chromeos: Simplify power supply info in PowerLibrary Factoring out the status_ field of PowerLibrary, along with the numerous accessor functions. Instead, the power status will be used as a local variable, passed along to observers as an argument. Also, created a local version of the power supply status struct. This is the struct that will be used when the libcros version of the struct is removed. See satorux's comments here: http://codereview.chromium.org/8271024/ BUG=chromium-os:16558 TEST=Make sure power button icon behaves properly, on both AC and battery. Signed-off-by: Simon Que <sque@chromium.org>; R=satorux@chromium.org,stevenjb@chromium.org Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=107465

Patch Set 1 #

Patch Set 2 : Fixed copy error #

Total comments: 4

Patch Set 3 : rebased #

Patch Set 4 : support unit testing, added power supply status struct #

Total comments: 14

Patch Set 5 : git format-patch -1 #

Total comments: 6

Patch Set 6 : Use OS_CHROMEOS in testing_automation_provider #

Patch Set 7 : Added another #ifdef #

Patch Set 8 : Fixed compile error #

Patch Set 9 : Removed expectations from cros_mock #

Total comments: 8

Patch Set 10 : Removed mock power getter functions #

Patch Set 11 : responded to stevenjb's comments in #9 #

Total comments: 1

Patch Set 12 : Add observer, added TODO #

Total comments: 8

Patch Set 13 : Various comment fixes #

Unified diffs Side-by-side diffs Delta from patch set Stats (+163 lines, -261 lines) Patch
M chrome/browser/automation/testing_automation_provider.h View 1 2 3 4 5 6 7 8 9 10 11 12 3 chunks +13 lines, -0 lines 0 comments Download
M chrome/browser/automation/testing_automation_provider.cc View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +4 lines, -0 lines 0 comments Download
M chrome/browser/automation/testing_automation_provider_chromeos.cc View 1 2 3 4 5 6 7 8 9 10 11 3 chunks +19 lines, -12 lines 0 comments Download
M chrome/browser/chromeos/cros/cros_mock.cc View 1 2 3 4 5 6 7 8 1 chunk +0 lines, -24 lines 0 comments Download
M chrome/browser/chromeos/cros/mock_power_library.h View 1 2 3 4 5 6 7 8 9 1 chunk +0 lines, -7 lines 0 comments Download
M chrome/browser/chromeos/cros/power_library.h View 1 2 3 4 5 6 7 8 9 10 11 12 4 chunks +16 lines, -19 lines 0 comments Download
M chrome/browser/chromeos/cros/power_library.cc View 1 2 3 4 5 6 7 8 9 10 11 12 8 chunks +34 lines, -71 lines 0 comments Download
M chrome/browser/chromeos/low_battery_observer.h View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/chromeos/low_battery_observer.cc View 1 2 3 4 2 chunks +15 lines, -14 lines 0 comments Download
M chrome/browser/chromeos/net/network_change_notifier_chromeos.h View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/chromeos/net/network_change_notifier_chromeos.cc View 1 2 3 4 1 chunk +2 lines, -1 line 0 comments Download
M chrome/browser/chromeos/status/clock_menu_button.h View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/chromeos/status/power_menu_button.h View 1 2 3 4 2 chunks +3 lines, -1 line 0 comments Download
M chrome/browser/chromeos/status/power_menu_button.cc View 1 2 3 4 2 chunks +12 lines, -13 lines 0 comments Download
M chrome/browser/chromeos/status/power_menu_button_browsertest.cc View 1 2 3 4 2 chunks +42 lines, -96 lines 0 comments Download

Messages

Total messages: 21 (0 generated)
Simon Que
9 years, 2 months ago (2011-10-18 22:32:04 UTC) #1
stevenjb
http://codereview.chromium.org/8347016/diff/1001/chrome/browser/chromeos/cros/power_library.cc File chrome/browser/chromeos/cros/power_library.cc (right): http://codereview.chromium.org/8347016/diff/1001/chrome/browser/chromeos/cros/power_library.cc#newcode233 chrome/browser/chromeos/cros/power_library.cc:233: 180 - status.battery_time_to_empty); It seems like PowerStatus should just ...
9 years, 2 months ago (2011-10-18 23:08:23 UTC) #2
Simon Que
http://codereview.chromium.org/8347016/diff/1001/chrome/browser/chromeos/status/power_menu_button.h File chrome/browser/chromeos/status/power_menu_button.h (right): http://codereview.chromium.org/8347016/diff/1001/chrome/browser/chromeos/status/power_menu_button.h#newcode11 chrome/browser/chromeos/status/power_menu_button.h:11: #include "third_party/cros/chromeos_power.h" On 2011/10/18 23:08:23, Steven Bennetts wrote: > ...
9 years, 2 months ago (2011-10-18 23:17:28 UTC) #3
satorux1
LGTM. Simon, thank you for the refactoring. It's great to see many getters to be ...
9 years, 2 months ago (2011-10-19 21:16:55 UTC) #4
satorux1
Started try jobs. The results probably won't appear here as I'm not the owner of ...
9 years, 2 months ago (2011-10-19 21:35:05 UTC) #5
satorux1
http://codereview.chromium.org/8347016/diff/8001/chrome/browser/automation/testing_automation_provider.h File chrome/browser/automation/testing_automation_provider.h (right): http://codereview.chromium.org/8347016/diff/8001/chrome/browser/automation/testing_automation_provider.h#newcode16 chrome/browser/automation/testing_automation_provider.h:16: #include "chrome/browser/chromeos/cros/power_library.h" Hmm, testing_automation_provider.h seems to be shared by ...
9 years, 2 months ago (2011-10-20 04:32:39 UTC) #6
Simon Que
http://codereview.chromium.org/8347016/diff/8001/chrome/browser/automation/testing_automation_provider.h File chrome/browser/automation/testing_automation_provider.h (right): http://codereview.chromium.org/8347016/diff/8001/chrome/browser/automation/testing_automation_provider.h#newcode16 chrome/browser/automation/testing_automation_provider.h:16: #include "chrome/browser/chromeos/cros/power_library.h" On 2011/10/20 04:32:40, satorux1 wrote: > Hmm, ...
9 years, 2 months ago (2011-10-20 21:18:53 UTC) #7
satorux1
http://codereview.chromium.org/8347016/diff/12001/chrome/browser/automation/testing_automation_provider.h File chrome/browser/automation/testing_automation_provider.h (right): http://codereview.chromium.org/8347016/diff/12001/chrome/browser/automation/testing_automation_provider.h#newcode45 chrome/browser/automation/testing_automation_provider.h:45: public chromeos::PowerLibrary::Observer { This needs to be #if defined(OS_CHROMEOS). ...
9 years, 2 months ago (2011-10-21 19:36:49 UTC) #8
Simon Que
http://codereview.chromium.org/8347016/diff/12001/chrome/browser/automation/testing_automation_provider.h File chrome/browser/automation/testing_automation_provider.h (right): http://codereview.chromium.org/8347016/diff/12001/chrome/browser/automation/testing_automation_provider.h#newcode45 chrome/browser/automation/testing_automation_provider.h:45: public chromeos::PowerLibrary::Observer { On 2011/10/21 19:36:50, satorux1 wrote: > ...
9 years, 2 months ago (2011-10-21 20:55:31 UTC) #9
stevenjb
http://codereview.chromium.org/8347016/diff/18003/chrome/browser/automation/testing_automation_provider.h File chrome/browser/automation/testing_automation_provider.h (right): http://codereview.chromium.org/8347016/diff/18003/chrome/browser/automation/testing_automation_provider.h#newcode45 chrome/browser/automation/testing_automation_provider.h:45: public chromeos::PowerLibrary::Observer, We should really have a TestingAutomationProviderChromeos class ...
9 years, 2 months ago (2011-10-24 20:36:21 UTC) #10
Simon Que
PTAL http://codereview.chromium.org/8347016/diff/18003/chrome/browser/automation/testing_automation_provider.h File chrome/browser/automation/testing_automation_provider.h (right): http://codereview.chromium.org/8347016/diff/18003/chrome/browser/automation/testing_automation_provider.h#newcode45 chrome/browser/automation/testing_automation_provider.h:45: public chromeos::PowerLibrary::Observer, On 2011/10/24 20:36:21, Steven Bennetts wrote: ...
9 years, 2 months ago (2011-10-24 22:49:48 UTC) #11
stevenjb
http://codereview.chromium.org/8347016/diff/18003/chrome/browser/automation/testing_automation_provider.h File chrome/browser/automation/testing_automation_provider.h (right): http://codereview.chromium.org/8347016/diff/18003/chrome/browser/automation/testing_automation_provider.h#newcode45 chrome/browser/automation/testing_automation_provider.h:45: public chromeos::PowerLibrary::Observer, On 2011/10/24 22:49:48, Simon Que wrote: > ...
9 years, 2 months ago (2011-10-25 02:33:19 UTC) #12
Simon Que
http://codereview.chromium.org/8347016/diff/18003/chrome/browser/automation/testing_automation_provider.h File chrome/browser/automation/testing_automation_provider.h (right): http://codereview.chromium.org/8347016/diff/18003/chrome/browser/automation/testing_automation_provider.h#newcode45 chrome/browser/automation/testing_automation_provider.h:45: public chromeos::PowerLibrary::Observer, On 2011/10/25 02:33:19, Steven Bennetts wrote: > ...
9 years, 2 months ago (2011-10-25 19:30:47 UTC) #13
Simon Que
9 years, 2 months ago (2011-10-25 21:28:09 UTC) #14
stevenjb
lgtm with nits http://codereview.chromium.org/8347016/diff/28001/chrome/browser/automation/testing_automation_provider.h File chrome/browser/automation/testing_automation_provider.h (right): http://codereview.chromium.org/8347016/diff/28001/chrome/browser/automation/testing_automation_provider.h#newcode47 chrome/browser/automation/testing_automation_provider.h:47: // source file. nit: I created ...
9 years, 2 months ago (2011-10-25 21:41:49 UTC) #15
satorux1
LGTM. running try jobs... http://codereview.chromium.org/8347016/diff/28001/chrome/browser/chromeos/cros/power_library.cc File chrome/browser/chromeos/cros/power_library.cc (right): http://codereview.chromium.org/8347016/diff/28001/chrome/browser/chromeos/cros/power_library.cc#newcode230 chrome/browser/chromeos/cros/power_library.cc:230: PowerSupplyStatus status = {}; On ...
9 years, 2 months ago (2011-10-25 21:43:28 UTC) #16
stevenjb
http://codereview.chromium.org/8347016/diff/28001/chrome/browser/chromeos/cros/power_library.cc File chrome/browser/chromeos/cros/power_library.cc (right): http://codereview.chromium.org/8347016/diff/28001/chrome/browser/chromeos/cros/power_library.cc#newcode230 chrome/browser/chromeos/cros/power_library.cc:230: PowerSupplyStatus status = {}; On 2011/10/25 21:43:28, satorux1 wrote: ...
9 years, 2 months ago (2011-10-25 21:54:20 UTC) #17
Simon Que
http://codereview.chromium.org/8347016/diff/28001/chrome/browser/automation/testing_automation_provider.h File chrome/browser/automation/testing_automation_provider.h (right): http://codereview.chromium.org/8347016/diff/28001/chrome/browser/automation/testing_automation_provider.h#newcode47 chrome/browser/automation/testing_automation_provider.h:47: // source file. On 2011/10/25 21:41:49, Steven Bennetts wrote: ...
9 years, 2 months ago (2011-10-25 22:59:16 UTC) #18
satorux1
LGTM. try results were positive. Should be ready to commit. try success for sque#f3fa7 on ...
9 years, 1 month ago (2011-10-26 07:03:13 UTC) #19
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/sque@chromium.org/8347016/27003
9 years, 1 month ago (2011-10-26 22:15:18 UTC) #20
commit-bot: I haz the power
9 years, 1 month ago (2011-10-26 23:27:14 UTC) #21
Change committed as 107465

Powered by Google App Engine
This is Rietveld 408576698