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

Issue 511393003: No longer register app window placement preference keys on the fly. (Closed)

Created:
6 years, 3 months ago by dgrogan
Modified:
6 years, 3 months ago
CC:
chromium-reviews, vsevik, tfarina, yurys, paulirish+reviews_chromium.org, devtools-reviews_chromium.org, aandrey+blink_chromium.org, pfeldman
Project:
chromium
Visibility:
Public.

Description

No longer register app window placement preference keys on the fly. Instead register a new Dictionary, browser.app_window_placement, at startup and put apps' placement/size info in sub dictionaries. Also migrate values from the old dynamically-registered preferences to their new statically-registered home. BUG=167256 Committed: https://crrev.com/e30f8f0957be8ffa94a70dc9e8e6f61c9b2990c5 Cr-Commit-Position: refs/heads/master@{#295163}

Patch Set 1 #

Patch Set 2 : sync to ToT #

Patch Set 3 : fix mac compile #

Patch Set 4 : WithoutPathExpansion and added DCHECK #

Patch Set 5 : hopefully works everywhere #

Patch Set 6 : fix mac compile #

Patch Set 7 : Migration and test #

Patch Set 8 : remove WithoutPathExpansion #

Patch Set 9 : Ensure kBrowserWindowPlacement didn't disappear #

Patch Set 10 : Expand truncated function names #

Patch Set 11 : make member variables local #

Total comments: 26

Patch Set 12 : address comments #

Total comments: 8

Patch Set 13 : Put migration code in chrome_pref_service_factory.cc #

Patch Set 14 : update to ToT and fix scoped_refptr error #

Total comments: 18

Patch Set 15 : update to ToT #

Patch Set 16 : move to own file and start unit tests #

Total comments: 24

Patch Set 17 : address comments; finish unit test #

Patch Set 18 : punt on DevTools on Android #

Total comments: 1

Patch Set 19 : exclude the whole unit test on android #

Patch Set 20 : ToT #

Total comments: 4

Patch Set 21 : address pkasting comments #

Patch Set 22 : ToT #

Total comments: 6

Patch Set 23 : address gab comments from c26 #

Patch Set 24 : update to ToT #

Unified diffs Side-by-side diffs Delta from patch set Stats (+385 lines, -69 lines) Patch
M chrome/browser/devtools/devtools_window.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +0 lines, -2 lines 0 comments Download
M chrome/browser/devtools/devtools_window.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 3 chunks +11 lines, -21 lines 0 comments Download
A chrome/browser/prefs/browser_ui_prefs_migrator.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +40 lines, -0 lines 0 comments Download
A chrome/browser/prefs/browser_ui_prefs_migrator.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +73 lines, -0 lines 0 comments Download
A chrome/browser/prefs/browser_ui_prefs_migrator_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 chunk +141 lines, -0 lines 0 comments Download
M chrome/browser/prefs/chrome_pref_service_factory.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 2 chunks +10 lines, -5 lines 0 comments Download
M chrome/browser/ui/browser.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 1 chunk +0 lines, -2 lines 0 comments Download
M chrome/browser/ui/browser_ui_prefs.h View 7 8 9 10 11 12 1 chunk +0 lines, -5 lines 0 comments Download
M chrome/browser/ui/browser_ui_prefs.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 3 chunks +4 lines, -20 lines 0 comments Download
M chrome/browser/ui/browser_window_state.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 1 chunk +21 lines, -1 line 0 comments Download
M chrome/browser/ui/browser_window_state.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 2 chunks +57 lines, -3 lines 0 comments Download
M chrome/browser/ui/cocoa/browser_window_controller_private.mm View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 1 chunk +5 lines, -4 lines 0 comments Download
M chrome/browser/ui/views/chrome_views_delegate.cc View 1 2 3 4 5 6 7 8 9 2 chunks +4 lines, -3 lines 0 comments Download
M chrome/browser/ui/views/frame/browser_view.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/ui/window_sizer/window_sizer.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/chrome_browser.gypi View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/chrome_tests_unit.gypi View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 2 chunks +4 lines, -0 lines 0 comments Download
M chrome/common/pref_names.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/common/pref_names.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 1 chunk +8 lines, -0 lines 0 comments Download

Messages

Total messages: 40 (9 generated)
dgrogan
Hi Bernhard, could you review this? Details of a few points of ugliness forthcoming.
6 years, 3 months ago (2014-09-04 00:19:23 UTC) #2
dgrogan
https://codereview.chromium.org/511393003/diff/200001/base/prefs/pref_service.cc File base/prefs/pref_service.cc (right): https://codereview.chromium.org/511393003/diff/200001/base/prefs/pref_service.cc#newcode559 base/prefs/pref_service.cc:559: const base::Value* browser_value = NULL; The other accessor methods ...
6 years, 3 months ago (2014-09-04 00:50:51 UTC) #3
Bernhard Bauer
+gab There might be another way to do the migration, which wouldn't involve opening up ...
6 years, 3 months ago (2014-09-04 11:06:03 UTC) #5
dgrogan
As I mention in the inline comments, I am going to look into (ab)using PrefFilter ...
6 years, 3 months ago (2014-09-04 20:26:33 UTC) #6
dgrogan
Adding a new BrowserUIPrefsMigrationFilter will be more intrusive than I was hoping. Looks like I ...
6 years, 3 months ago (2014-09-04 21:57:56 UTC) #7
gab
Took a look at the entire CL. I agree that this minor encapsulation hurdle for ...
6 years, 3 months ago (2014-09-05 00:53:10 UTC) #8
dgrogan
https://codereview.chromium.org/511393003/diff/220001/chrome/browser/devtools/devtools_window.cc File chrome/browser/devtools/devtools_window.cc (right): https://codereview.chromium.org/511393003/diff/220001/chrome/browser/devtools/devtools_window.cc#newcode1130 chrome/browser/devtools/devtools_window.cc:1130: const char* wp_key = prefs::kAppWindowPlacement; On 2014/09/05 00:53:10, gab ...
6 years, 3 months ago (2014-09-06 00:47:06 UTC) #9
dgrogan
This is ready for another look. I moved the migration code to chrome/browser/prefs/chrome_pref_service_factory.cc and got ...
6 years, 3 months ago (2014-09-06 02:32:58 UTC) #10
gab
lg, comments below. @Bernhard how do you like the observer approach? I proposed it in ...
6 years, 3 months ago (2014-09-08 21:29:26 UTC) #11
dgrogan
Patchset #15 is WIP and has a sync to ToT in there. So it's a ...
6 years, 3 months ago (2014-09-09 03:15:44 UTC) #12
Bernhard Bauer
This looks very nice, thank you! https://codereview.chromium.org/511393003/diff/280001/chrome/browser/ui/prefs_migrator.cc File chrome/browser/ui/prefs_migrator.cc (right): https://codereview.chromium.org/511393003/diff/280001/chrome/browser/ui/prefs_migrator.cc#newcode30 chrome/browser/ui/prefs_migrator.cc:30: if (!pref_store_->GetMutableValue("browser", &browser_value)) ...
6 years, 3 months ago (2014-09-09 09:12:53 UTC) #13
dgrogan
https://codereview.chromium.org/511393003/diff/280001/chrome/browser/ui/prefs_migrator.cc File chrome/browser/ui/prefs_migrator.cc (right): https://codereview.chromium.org/511393003/diff/280001/chrome/browser/ui/prefs_migrator.cc#newcode30 chrome/browser/ui/prefs_migrator.cc:30: if (!pref_store_->GetMutableValue("browser", &browser_value)) { On 2014/09/09 09:12:53, Bernhard Bauer ...
6 years, 3 months ago (2014-09-09 23:34:51 UTC) #14
Bernhard Bauer
https://codereview.chromium.org/511393003/diff/320001/chrome/browser/ui/prefs_migrator.h File chrome/browser/ui/prefs_migrator.h (right): https://codereview.chromium.org/511393003/diff/320001/chrome/browser/ui/prefs_migrator.h#newcode22 chrome/browser/ui/prefs_migrator.h:22: class BrowserUIPrefsMigrationObserver : public PrefStore::Observer { Class name and ...
6 years, 3 months ago (2014-09-10 09:15:48 UTC) #16
gab
https://codereview.chromium.org/511393003/diff/320001/chrome/browser/ui/prefs_migrator.h File chrome/browser/ui/prefs_migrator.h (right): https://codereview.chromium.org/511393003/diff/320001/chrome/browser/ui/prefs_migrator.h#newcode22 chrome/browser/ui/prefs_migrator.h:22: class BrowserUIPrefsMigrationObserver : public PrefStore::Observer { On 2014/09/10 09:15:47, ...
6 years, 3 months ago (2014-09-10 14:40:05 UTC) #17
dgrogan
https://codereview.chromium.org/511393003/diff/320001/chrome/browser/ui/prefs_migrator.h File chrome/browser/ui/prefs_migrator.h (right): https://codereview.chromium.org/511393003/diff/320001/chrome/browser/ui/prefs_migrator.h#newcode22 chrome/browser/ui/prefs_migrator.h:22: class BrowserUIPrefsMigrationObserver : public PrefStore::Observer { On 2014/09/10 09:15:47, ...
6 years, 3 months ago (2014-09-10 23:10:00 UTC) #18
dgrogan
This is ready for another look. Suggestions welcome for how to better handle the linker ...
6 years, 3 months ago (2014-09-11 00:54:44 UTC) #19
dgrogan
For ease of reference, the linker error on android is ../../chrome/browser/prefs/browser_ui_prefs_migrator_unittest.cc:126:error: undefined reference to 'DevToolsWindow::kDevToolsApp'
6 years, 3 months ago (2014-09-11 00:57:09 UTC) #20
Bernhard Bauer
LGTM! https://codereview.chromium.org/511393003/diff/360001/chrome/browser/prefs/browser_ui_prefs_migrator_unittest.cc File chrome/browser/prefs/browser_ui_prefs_migrator_unittest.cc (right): https://codereview.chromium.org/511393003/diff/360001/chrome/browser/prefs/browser_ui_prefs_migrator_unittest.cc#newcode89 chrome/browser/prefs/browser_ui_prefs_migrator_unittest.cc:89: #if !defined(OS_ANDROID) I would be okay with excluding ...
6 years, 3 months ago (2014-09-11 09:48:28 UTC) #21
dgrogan
pkasting, can you review as OWNER of chrome/browser/ui ? vsevik, can you review as OWNER ...
6 years, 3 months ago (2014-09-11 18:19:41 UTC) #23
Peter Kasting
LGTM https://codereview.chromium.org/511393003/diff/400001/chrome/browser/ui/browser_window_state.cc File chrome/browser/ui/browser_window_state.cc (right): https://codereview.chromium.org/511393003/diff/400001/chrome/browser/ui/browser_window_state.cc#newcode89 chrome/browser/ui/browser_window_state.cc:89: .PassAs<DictionaryPrefUpdate>(); Nit: Just do return scoped_ptr<DictionaryPrefUpdate>( new WindowPlacementPrefUpdate(prefs, ...
6 years, 3 months ago (2014-09-11 20:31:50 UTC) #24
dgrogan
https://codereview.chromium.org/511393003/diff/400001/chrome/browser/ui/browser_window_state.cc File chrome/browser/ui/browser_window_state.cc (right): https://codereview.chromium.org/511393003/diff/400001/chrome/browser/ui/browser_window_state.cc#newcode89 chrome/browser/ui/browser_window_state.cc:89: .PassAs<DictionaryPrefUpdate>(); On 2014/09/11 20:31:50, Peter Kasting wrote: > Nit: ...
6 years, 3 months ago (2014-09-12 01:23:03 UTC) #25
gab
lgtm w/ test nits/recommendations Woot! Gab https://codereview.chromium.org/511393003/diff/440001/chrome/browser/prefs/browser_ui_prefs_migrator_unittest.cc File chrome/browser/prefs/browser_ui_prefs_migrator_unittest.cc (right): https://codereview.chromium.org/511393003/diff/440001/chrome/browser/prefs/browser_ui_prefs_migrator_unittest.cc#newcode84 chrome/browser/prefs/browser_ui_prefs_migrator_unittest.cc:84: const char* kAppName("localhost_/chrome/6/src/chrome/test/data/title1.html"); ...
6 years, 3 months ago (2014-09-12 13:47:57 UTC) #26
dgrogan
https://codereview.chromium.org/511393003/diff/440001/chrome/browser/prefs/browser_ui_prefs_migrator_unittest.cc File chrome/browser/prefs/browser_ui_prefs_migrator_unittest.cc (right): https://codereview.chromium.org/511393003/diff/440001/chrome/browser/prefs/browser_ui_prefs_migrator_unittest.cc#newcode84 chrome/browser/prefs/browser_ui_prefs_migrator_unittest.cc:84: const char* kAppName("localhost_/chrome/6/src/chrome/test/data/title1.html"); On 2014/09/12 13:47:56, gab wrote: > ...
6 years, 3 months ago (2014-09-12 19:05:40 UTC) #27
dgrogan
Yury, can you review as OWNER of chrome/browser/devtools if vsevik@ can't get to it?
6 years, 3 months ago (2014-09-12 19:13:43 UTC) #29
dgrogan
dgozman, you're next up in the search for an OWNER of chrome/browser/devtools
6 years, 3 months ago (2014-09-16 04:12:29 UTC) #31
dgozman
chrome/browser/devtools lgtm
6 years, 3 months ago (2014-09-16 04:28:02 UTC) #32
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patchset/511393003/460001
6 years, 3 months ago (2014-09-16 05:34:59 UTC) #34
commit-bot: I haz the power
Try jobs failed on following builders: ios_rel_device_ninja on tryserver.chromium.mac (http://build.chromium.org/p/tryserver.chromium.mac/builders/ios_rel_device_ninja/builds/10409) win8_chromium_rel on tryserver.chromium.win (http://build.chromium.org/p/tryserver.chromium.win/builders/win8_chromium_rel/builds/10695)
6 years, 3 months ago (2014-09-16 05:37:58 UTC) #36
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patchset/511393003/480001
6 years, 3 months ago (2014-09-16 21:15:35 UTC) #38
commit-bot: I haz the power
Committed patchset #24 (id:480001) as 20789e1e6fd130b27ac991b13a52c2d6b23552aa
6 years, 3 months ago (2014-09-16 22:41:19 UTC) #39
commit-bot: I haz the power
6 years, 3 months ago (2014-09-16 22:41:58 UTC) #40
Message was sent while issue was closed.
Patchset 24 (id:??) landed as
https://crrev.com/e30f8f0957be8ffa94a70dc9e8e6f61c9b2990c5
Cr-Commit-Position: refs/heads/master@{#295163}

Powered by Google App Engine
This is Rietveld 408576698