Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #import "chrome/browser/app_controller_mac.h" | 5 #import "chrome/browser/app_controller_mac.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "base/auto_reset.h" | 9 #include "base/auto_reset.h" |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 698 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 709 content::WebContents* startupContent = NULL; | 709 content::WebContents* startupContent = NULL; |
| 710 | 710 |
| 711 if (browser && browser->tab_strip_model()->count() == 1) { | 711 if (browser && browser->tab_strip_model()->count() == 1) { |
| 712 startupIndex = browser->tab_strip_model()->active_index(); | 712 startupIndex = browser->tab_strip_model()->active_index(); |
| 713 startupContent = browser->tab_strip_model()->GetActiveWebContents(); | 713 startupContent = browser->tab_strip_model()->GetActiveWebContents(); |
| 714 } | 714 } |
| 715 | 715 |
| 716 [self openUrls:urls]; | 716 [self openUrls:urls]; |
| 717 | 717 |
| 718 if (startupIndex != TabStripModel::kNoTab && | 718 if (startupIndex != TabStripModel::kNoTab && |
| 719 startupContent->GetVisibleURL() == GURL(chrome::kChromeUINewTabURL)) { | 719 startupContent->GetVisibleURL().spec() == chrome::kChromeUINewTabURL) { |
|
brettw
2016/10/14 18:01:24
Is the visible URL always guaranteed to be valid?
Charlie Harrison
2016/10/14 18:13:55
You're right, it can be invalid (in a whole bunch
| |
| 720 browser->tab_strip_model()->CloseWebContentsAt(startupIndex, | 720 browser->tab_strip_model()->CloseWebContentsAt(startupIndex, |
| 721 TabStripModel::CLOSE_NONE); | 721 TabStripModel::CLOSE_NONE); |
| 722 } | 722 } |
| 723 } | 723 } |
| 724 | 724 |
| 725 // This is called after profiles have been loaded and preferences registered. | 725 // This is called after profiles have been loaded and preferences registered. |
| 726 // It is safe to access the default profile here. | 726 // It is safe to access the default profile here. |
| 727 - (void)applicationDidFinishLaunching:(NSNotification*)notify { | 727 - (void)applicationDidFinishLaunching:(NSNotification*)notify { |
| 728 MacStartupProfiler::GetInstance()->Profile( | 728 MacStartupProfiler::GetInstance()->Profile( |
| 729 MacStartupProfiler::DID_FINISH_LAUNCHING); | 729 MacStartupProfiler::DID_FINISH_LAUNCHING); |
| (...skipping 948 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1678 | 1678 |
| 1679 //--------------------------------------------------------------------------- | 1679 //--------------------------------------------------------------------------- |
| 1680 | 1680 |
| 1681 namespace app_controller_mac { | 1681 namespace app_controller_mac { |
| 1682 | 1682 |
| 1683 bool IsOpeningNewWindow() { | 1683 bool IsOpeningNewWindow() { |
| 1684 return g_is_opening_new_window; | 1684 return g_is_opening_new_window; |
| 1685 } | 1685 } |
| 1686 | 1686 |
| 1687 } // namespace app_controller_mac | 1687 } // namespace app_controller_mac |
| OLD | NEW |