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

Side by Side Diff: chrome/browser/ui/startup/startup_browser_creator_impl.cc

Issue 232773008: More removal of GTK code. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove base/ so I don't need another stamp. Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/ui/pdf/pdf_tab_helper.cc ('k') | chrome/common/localized_error.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #include "chrome/browser/ui/startup/startup_browser_creator_impl.h" 5 #include "chrome/browser/ui/startup/startup_browser_creator_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <vector> 8 #include <vector>
9 9
10 #include "apps/app_restore_service.h" 10 #include "apps/app_restore_service.h"
(...skipping 761 matching lines...) Expand 10 before | Expand all | Expand 10 after
772 const StartupTabs& tabs, 772 const StartupTabs& tabs,
773 chrome::HostDesktopType desktop_type) { 773 chrome::HostDesktopType desktop_type) {
774 DCHECK(!tabs.empty()); 774 DCHECK(!tabs.empty());
775 775
776 // If we don't yet have a profile, try to use the one we're given from 776 // If we don't yet have a profile, try to use the one we're given from
777 // |browser|. While we may not end up actually using |browser| (since it 777 // |browser|. While we may not end up actually using |browser| (since it
778 // could be a popup window), we can at least use the profile. 778 // could be a popup window), we can at least use the profile.
779 if (!profile_ && browser) 779 if (!profile_ && browser)
780 profile_ = browser->profile(); 780 profile_ = browser->profile();
781 781
782 if (!browser || !browser->is_type_tabbed()) { 782 if (!browser || !browser->is_type_tabbed())
783 browser = new Browser(Browser::CreateParams(profile_, desktop_type)); 783 browser = new Browser(Browser::CreateParams(profile_, desktop_type));
784 } else {
785 #if defined(TOOLKIT_GTK)
786 // Setting the time of the last action on the window here allows us to steal
787 // focus, which is what the user wants when opening a new tab in an existing
788 // browser window.
789 gtk_util::SetWMLastUserActionTime(browser->window()->GetNativeWindow());
790 #endif
791 }
792 784
793 bool first_tab = true; 785 bool first_tab = true;
794 ProtocolHandlerRegistry* registry = profile_ ? 786 ProtocolHandlerRegistry* registry = profile_ ?
795 ProtocolHandlerRegistryFactory::GetForProfile(profile_) : NULL; 787 ProtocolHandlerRegistryFactory::GetForProfile(profile_) : NULL;
796 for (size_t i = 0; i < tabs.size(); ++i) { 788 for (size_t i = 0; i < tabs.size(); ++i) {
797 // We skip URLs that we'd have to launch an external protocol handler for. 789 // We skip URLs that we'd have to launch an external protocol handler for.
798 // This avoids us getting into an infinite loop asking ourselves to open 790 // This avoids us getting into an infinite loop asking ourselves to open
799 // a URL, should the handler be (incorrectly) configured to be us. Anyone 791 // a URL, should the handler be (incorrectly) configured to be us. Anyone
800 // asking us to open such a URL should really ask the handler directly. 792 // asking us to open such a URL should really ask the handler directly.
801 bool handled_by_chrome = ProfileIOData::IsHandledURL(tabs[i].url) || 793 bool handled_by_chrome = ProfileIOData::IsHandledURL(tabs[i].url) ||
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
950 } 942 }
951 943
952 #if !defined(OS_WIN) 944 #if !defined(OS_WIN)
953 // static 945 // static
954 bool StartupBrowserCreatorImpl::OpenStartupURLsInExistingBrowser( 946 bool StartupBrowserCreatorImpl::OpenStartupURLsInExistingBrowser(
955 Profile* profile, 947 Profile* profile,
956 const std::vector<GURL>& startup_urls) { 948 const std::vector<GURL>& startup_urls) {
957 return false; 949 return false;
958 } 950 }
959 #endif 951 #endif
OLDNEW
« no previous file with comments | « chrome/browser/ui/pdf/pdf_tab_helper.cc ('k') | chrome/common/localized_error.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698