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

Issue 2798143004: Fix for URL opening code (Closed)

Created:
3 years, 8 months ago by eugenebng
Modified:
3 years, 5 months ago
Reviewers:
Avi (use Gerrit), gab, sky
CC:
chromium-reviews, asvitkine+watch_chromium.org, mac-reviews_chromium.org
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Fix for tab opening code When URL is opened from other program or local file system and session restored at the same time, opened URL is shown in a window behind restore session and not really visible to user. This fixes opening URL for cases: 1. When Chromium is not started yet. 2. When Chromium is started, has window(s). 3. When chromium app is started, but has no windows. for different startup settings: 1. Default startup. 2. Restore session on startup. 3. Open pre-defined set of URLs on startup. R=sky@chromium.org,gab@chromium.org,avi@chromium.org BUG=708873 Review-Url: https://codereview.chromium.org/2798143004 Cr-Commit-Position: refs/heads/master@{#479684} Committed: https://chromium.googlesource.com/chromium/src/+/7afbc36eeee75f34c8ad3aa2f90cb6fc1f345463

Patch Set 1 #

Total comments: 12

Patch Set 2 : Second variant, without leaky abstraction and complicated logic of WillRestoreSession() #

Patch Set 3 : Fixed opening local file with Chromium on mac while restore session is enabled. File opens in the t… #

Total comments: 1

Patch Set 4 : Opening URLs in session restore now #

Patch Set 5 : Removed vlog, that wasn't needed #

Total comments: 10

Patch Set 6 : Simpligied browser creation code, code style Please enter the commit message for your changes. Lin… #

Patch Set 7 : Added test, fixed opening URL case when browser is already started. #

Total comments: 15

Patch Set 8 : Fixed opening URLs in various cases. #

Patch Set 9 : Code style: disallow copy and assign. #

Total comments: 3

Patch Set 10 : Added tests for opening URL in different cases Chromium state: 1. Not launched. 2. Started, has win… #

Patch Set 11 : Added new files for added tests. #

Total comments: 22

Patch Set 12 : Use proper profile in app_controller_mac, code style fixes. #

Patch Set 13 : Simplified PRE_test checking #

Total comments: 19

Patch Set 14 : Code style fixes. #

Total comments: 4

Patch Set 15 : Fixed statistics for no tabs at startup case. #

Total comments: 6

Patch Set 16 : After startup with emty tab strip no longer reproducable case - removed it's handling #

Patch Set 17 : Added comment #

Patch Set 18 : Fixed class name usage. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+456 lines, -98 lines) Patch
M chrome/browser/app_controller_mac.mm View 1 2 3 4 5 6 7 8 9 10 11 12 3 chunks +43 lines, -12 lines 0 comments Download
M chrome/browser/app_controller_mac_browsertest.mm View 1 2 3 4 5 6 7 8 9 10 11 12 13 6 chunks +205 lines, -7 lines 0 comments Download
M chrome/browser/lifetime/browser_close_manager_browsertest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 45 chunks +44 lines, -78 lines 0 comments Download
M chrome/browser/metrics/chrome_browser_main_extra_parts_metrics.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 2 chunks +14 lines, -1 line 0 comments Download
M chrome/browser/sessions/session_restore.h View 1 2 3 4 5 6 7 1 chunk +5 lines, -0 lines 0 comments Download
M chrome/browser/sessions/session_restore.cc View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +16 lines, -0 lines 0 comments Download
M chrome/browser/sessions/session_restore_browsertest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 3 chunks +49 lines, -0 lines 0 comments Download
A content/public/test/repeated_notification_observer.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +39 lines, -0 lines 0 comments Download
A content/public/test/repeated_notification_observer.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +39 lines, -0 lines 0 comments Download
M content/test/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +2 lines, -0 lines 0 comments Download

Messages

Total messages: 52 (14 generated)
eugenebng
3 years, 8 months ago (2017-04-06 09:44:44 UTC) #1
Avi (use Gerrit)
No major objections to this approach come to mind, though I'm not really an expert ...
3 years, 8 months ago (2017-04-06 15:54:42 UTC) #2
gab
https://codereview.chromium.org/2798143004/diff/1/chrome/browser/ui/startup/startup_browser_creator_impl.cc File chrome/browser/ui/startup/startup_browser_creator_impl.cc (right): https://codereview.chromium.org/2798143004/diff/1/chrome/browser/ui/startup/startup_browser_creator_impl.cc#newcode450 chrome/browser/ui/startup/startup_browser_creator_impl.cc:450: bool StartupBrowserCreatorImpl::WillRestoreSession( On 2017/04/06 15:54:42, Avi (slow and ooo ...
3 years, 8 months ago (2017-04-06 16:02:21 UTC) #3
Avi (use Gerrit)
On 2017/04/06 16:02:21, gab wrote: > https://codereview.chromium.org/2798143004/diff/1/chrome/browser/ui/startup/startup_browser_creator_impl.cc > File chrome/browser/ui/startup/startup_browser_creator_impl.cc (right): > > https://codereview.chromium.org/2798143004/diff/1/chrome/browser/ui/startup/startup_browser_creator_impl.cc#newcode450 > ...
3 years, 8 months ago (2017-04-06 16:30:34 UTC) #4
sky
https://codereview.chromium.org/2798143004/diff/1/chrome/browser/app_controller_mac.mm File chrome/browser/app_controller_mac.mm (right): https://codereview.chromium.org/2798143004/diff/1/chrome/browser/app_controller_mac.mm#newcode1271 chrome/browser/app_controller_mac.mm:1271: - (void)openUrls:(const std::vector<GURL>&)urls { I'm not familiar with the ...
3 years, 8 months ago (2017-04-07 21:52:14 UTC) #5
eugenebng
https://codereview.chromium.org/2798143004/diff/1/chrome/browser/app_controll... File chrome/browser/app_controller_mac.mm (right): https://codereview.chromium.org/2798143004/diff/1/chrome/browser/app_controll... chrome/browser/app_controller_mac.mm:1271: - (void)openUrls:(const std::vector<GURL>&)urls { On 2017/04/07 21:52:14, sky wrote: ...
3 years, 8 months ago (2017-04-10 11:54:09 UTC) #6
eugenebng
https://codereview.chromium.org/2798143004/diff/1/chrome/browser/metrics/chro... File chrome/browser/metrics/chrome_browser_main_extra_parts_metrics.cc (right): https://codereview.chromium.org/2798143004/diff/1/chrome/browser/metrics/chro... chrome/browser/metrics/chrome_browser_main_extra_parts_metrics.cc:430: DCHECK(0); On 2017/04/07 21:52:14, sky wrote: > I'm not ...
3 years, 8 months ago (2017-04-10 12:04:43 UTC) #7
eugenebng
I removed previous complicated logic of WillRestoreSession() For now, I see 2 issues are left: ...
3 years, 8 months ago (2017-04-12 16:36:11 UTC) #8
eugenebng
Please ignore patch set 2. Have to fix that before it's worth reviewing.
3 years, 8 months ago (2017-04-13 15:06:06 UTC) #9
eugenebng
Please take a look at patch set 3. Done it without adding a "copy" of ...
3 years, 8 months ago (2017-04-14 12:32:45 UTC) #10
sky
Instead of using a static vector could you instead detect if we're in session restore ...
3 years, 8 months ago (2017-04-17 17:13:34 UTC) #11
eugenebng
On 2017/04/17 17:13:34, sky wrote: > Instead of using a static vector could you instead ...
3 years, 7 months ago (2017-04-28 10:44:54 UTC) #12
sky
Please add test coverage as well. https://codereview.chromium.org/2798143004/diff/80001/chrome/browser/app_controller_mac.mm File chrome/browser/app_controller_mac.mm (right): https://codereview.chromium.org/2798143004/diff/80001/chrome/browser/app_controller_mac.mm#newcode1286 chrome/browser/app_controller_mac.mm:1286: browser = new ...
3 years, 7 months ago (2017-04-28 17:34:59 UTC) #13
eugenebng
https://codereview.chromium.org/2798143004/diff/80001/chrome/browser/app_controller_mac.mm File chrome/browser/app_controller_mac.mm (right): https://codereview.chromium.org/2798143004/diff/80001/chrome/browser/app_controller_mac.mm#newcode1286 chrome/browser/app_controller_mac.mm:1286: browser = new Browser(Browser::CreateParams([self lastProfile], true)); On 2017/04/28 17:34:58, ...
3 years, 7 months ago (2017-05-03 16:05:30 UTC) #14
sky
Avi should review the app_controller_mac.mm changes https://codereview.chromium.org/2798143004/diff/120001/chrome/browser/metrics/chrome_browser_main_extra_parts_metrics.cc File chrome/browser/metrics/chrome_browser_main_extra_parts_metrics.cc (right): https://codereview.chromium.org/2798143004/diff/120001/chrome/browser/metrics/chrome_browser_main_extra_parts_metrics.cc#newcode361 chrome/browser/metrics/chrome_browser_main_extra_parts_metrics.cc:361: for (auto* browser ...
3 years, 7 months ago (2017-05-04 23:40:46 UTC) #15
Avi (use Gerrit)
https://codereview.chromium.org/2798143004/diff/120001/chrome/browser/app_controller_mac.mm File chrome/browser/app_controller_mac.mm (right): https://codereview.chromium.org/2798143004/diff/120001/chrome/browser/app_controller_mac.mm#newcode1294 chrome/browser/app_controller_mac.mm:1294: // if no browser window exists then create one ...
3 years, 7 months ago (2017-05-04 23:47:43 UTC) #16
eugenebng
Fixed issues that were kindly pointed out here. Opening URLs logic for different cases made ...
3 years, 7 months ago (2017-05-15 06:17:09 UTC) #17
eugenebng
Ping Avi.
3 years, 7 months ago (2017-05-17 09:20:41 UTC) #18
Avi (use Gerrit)
https://codereview.chromium.org/2798143004/diff/160001/chrome/browser/app_controller_mac.mm File chrome/browser/app_controller_mac.mm (right): https://codereview.chromium.org/2798143004/diff/160001/chrome/browser/app_controller_mac.mm#newcode1297 chrome/browser/app_controller_mac.mm:1297: Profile* profile = [self lastProfile]; You've tested this with ...
3 years, 7 months ago (2017-05-17 15:51:09 UTC) #19
Avi (use Gerrit)
BTW I don't mean to be a hard reviewer, but touching this code scares me. ...
3 years, 7 months ago (2017-05-17 16:04:53 UTC) #20
eugenebng
On 2017/05/17 16:04:53, Avi (ping after 24h) wrote: > BTW I don't mean to be ...
3 years, 6 months ago (2017-06-01 10:06:28 UTC) #21
Avi (use Gerrit)
Lots of comment typo nits (sorry), and an interesting fact that I learned in app_controller_mac, ...
3 years, 6 months ago (2017-06-01 19:54:31 UTC) #22
eugenebng
https://codereview.chromium.org/2798143004/diff/200001/chrome/browser/app_controller_mac.mm File chrome/browser/app_controller_mac.mm (right): https://codereview.chromium.org/2798143004/diff/200001/chrome/browser/app_controller_mac.mm#newcode1319 chrome/browser/app_controller_mac.mm:1319: browser = new Browser(Browser::CreateParams([self lastProfile], true)); On 2017/06/01 19:54:31, ...
3 years, 6 months ago (2017-06-07 10:42:12 UTC) #24
eugenebng
Ping sky. I would be really glad to know what do you think about the ...
3 years, 6 months ago (2017-06-08 11:58:55 UTC) #25
sky
This mostly looks good, just minor questions and running new test on all desktop platforms. ...
3 years, 6 months ago (2017-06-08 19:17:50 UTC) #26
eugenebng
https://codereview.chromium.org/2798143004/diff/240001/chrome/browser/app_controller_mac_browsertest.mm File chrome/browser/app_controller_mac_browsertest.mm (right): https://codereview.chromium.org/2798143004/diff/240001/chrome/browser/app_controller_mac_browsertest.mm#newcode407 chrome/browser/app_controller_mac_browsertest.mm:407: class AppControllerOpenShortcutOnStartupBrowserTest On 2017/06/08 19:17:49, sky wrote: > What ...
3 years, 6 months ago (2017-06-09 13:16:22 UTC) #27
sky
LGTM https://codereview.chromium.org/2798143004/diff/240001/chrome/browser/app_controller_mac_browsertest.mm File chrome/browser/app_controller_mac_browsertest.mm (right): https://codereview.chromium.org/2798143004/diff/240001/chrome/browser/app_controller_mac_browsertest.mm#newcode407 chrome/browser/app_controller_mac_browsertest.mm:407: class AppControllerOpenShortcutOnStartupBrowserTest On 2017/06/09 13:16:22, eugenebng wrote: > ...
3 years, 6 months ago (2017-06-09 15:29:52 UTC) #28
eugenebng
Ping gab.
3 years, 6 months ago (2017-06-09 15:41:00 UTC) #29
gab
https://codereview.chromium.org/2798143004/diff/260001/chrome/browser/app_controller_mac.mm File chrome/browser/app_controller_mac.mm (right): https://codereview.chromium.org/2798143004/diff/260001/chrome/browser/app_controller_mac.mm#newcode1310 chrome/browser/app_controller_mac.mm:1310: SessionRestore::AddURLsToOpen(profile, urls); Is this use case specific to Mac? ...
3 years, 6 months ago (2017-06-09 16:59:19 UTC) #31
eugenebng
https://codereview.chromium.org/2798143004/diff/260001/chrome/browser/app_controller_mac.mm File chrome/browser/app_controller_mac.mm (right): https://codereview.chromium.org/2798143004/diff/260001/chrome/browser/app_controller_mac.mm#newcode1310 chrome/browser/app_controller_mac.mm:1310: SessionRestore::AddURLsToOpen(profile, urls); On 2017/06/09 16:59:19, gab wrote: > Is ...
3 years, 6 months ago (2017-06-13 12:10:02 UTC) #32
gab
lgtm w/ nitsq https://codereview.chromium.org/2798143004/diff/280001/chrome/browser/metrics/chrome_browser_main_extra_parts_metrics.cc File chrome/browser/metrics/chrome_browser_main_extra_parts_metrics.cc (right): https://codereview.chromium.org/2798143004/diff/280001/chrome/browser/metrics/chrome_browser_main_extra_parts_metrics.cc#newcode524 chrome/browser/metrics/chrome_browser_main_extra_parts_metrics.cc:524: startup_metric_utils::SetNonBrowserUIDisplayed(); Add a comment about when ...
3 years, 6 months ago (2017-06-13 16:29:34 UTC) #33
eugenebng
https://codereview.chromium.org/2798143004/diff/280001/chrome/browser/metrics/chrome_browser_main_extra_parts_metrics.cc File chrome/browser/metrics/chrome_browser_main_extra_parts_metrics.cc (right): https://codereview.chromium.org/2798143004/diff/280001/chrome/browser/metrics/chrome_browser_main_extra_parts_metrics.cc#newcode524 chrome/browser/metrics/chrome_browser_main_extra_parts_metrics.cc:524: startup_metric_utils::SetNonBrowserUIDisplayed(); On 2017/06/13 16:29:34, gab wrote: > Add a ...
3 years, 6 months ago (2017-06-14 11:17:46 UTC) #34
gab
https://codereview.chromium.org/2798143004/diff/280001/chrome/browser/metrics/chrome_browser_main_extra_parts_metrics.cc File chrome/browser/metrics/chrome_browser_main_extra_parts_metrics.cc (right): https://codereview.chromium.org/2798143004/diff/280001/chrome/browser/metrics/chrome_browser_main_extra_parts_metrics.cc#newcode524 chrome/browser/metrics/chrome_browser_main_extra_parts_metrics.cc:524: startup_metric_utils::SetNonBrowserUIDisplayed(); On 2017/06/14 11:17:46, eugenebng wrote: > On 2017/06/13 ...
3 years, 6 months ago (2017-06-14 17:03:23 UTC) #35
eugenebng
https://codereview.chromium.org/2798143004/diff/280001/chrome/browser/metrics/chrome_browser_main_extra_parts_metrics.cc File chrome/browser/metrics/chrome_browser_main_extra_parts_metrics.cc (right): https://codereview.chromium.org/2798143004/diff/280001/chrome/browser/metrics/chrome_browser_main_extra_parts_metrics.cc#newcode524 chrome/browser/metrics/chrome_browser_main_extra_parts_metrics.cc:524: startup_metric_utils::SetNonBrowserUIDisplayed(); On 2017/06/14 17:03:23, gab wrote: > On 2017/06/14 ...
3 years, 6 months ago (2017-06-15 00:31:50 UTC) #36
commit-bot: I haz the power
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2798143004/340001
3 years, 6 months ago (2017-06-15 13:34:26 UTC) #47
commit-bot: I haz the power
Committed patchset #18 (id:340001) as https://chromium.googlesource.com/chromium/src/+/7afbc36eeee75f34c8ad3aa2f90cb6fc1f345463
3 years, 6 months ago (2017-06-15 13:38:59 UTC) #50
dominicc (has gone to gerrit)
A revert of this CL (patchset #18 id:340001) has been created in https://codereview.chromium.org/2964163002/ by dominicc@chromium.org. ...
3 years, 5 months ago (2017-06-30 00:56:43 UTC) #51
sky
3 years, 5 months ago (2017-07-12 15:56:16 UTC) #52
Message was sent while issue was closed.
On 2017/06/30 00:56:43, dominicc (has gone to gerrit) wrote:
> A revert of this CL (patchset #18 id:340001) has been created in
> https://codereview.chromium.org/2964163002/ by mailto:dominicc@chromium.org.
> 
> The reason for reverting is: Reverting this per the comments on
> crbug.com/735958.

This was really reverted here:
https://chromium-review.googlesource.com/c/567562/ .

Powered by Google App Engine
This is Rietveld 408576698