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

Side by Side Diff: chrome/browser/ui/browser_navigator.cc

Issue 2388803003: Fix FirstWebContentsProfiler not getting created when using session restore. (Closed)
Patch Set: Created 4 years, 2 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
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/browser_navigator.h" 5 #include "chrome/browser/ui/browser_navigator.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after
370 // New tabs can have WebUI URLs that will make calls back to arbitrary 370 // New tabs can have WebUI URLs that will make calls back to arbitrary
371 // tab helpers, so the entire set of tab helpers needs to be set up 371 // tab helpers, so the entire set of tab helpers needs to be set up
372 // immediately. 372 // immediately.
373 BrowserNavigatorWebContentsAdoption::AttachTabHelpers(target_contents); 373 BrowserNavigatorWebContentsAdoption::AttachTabHelpers(target_contents);
374 #if defined(ENABLE_EXTENSIONS) 374 #if defined(ENABLE_EXTENSIONS)
375 extensions::TabHelper::FromWebContents(target_contents)-> 375 extensions::TabHelper::FromWebContents(target_contents)->
376 SetExtensionAppById(params.extension_app_id); 376 SetExtensionAppById(params.extension_app_id);
377 #endif 377 #endif
378 378
379 #if !defined(OS_ANDROID) 379 #if !defined(OS_ANDROID)
380 static bool first_web_contents_profiled = false; 380 FirstWebContentsProfiler::WebContentsStarted(target_contents);
381 if (!first_web_contents_profiled) {
382 first_web_contents_profiled = true;
383 new FirstWebContentsProfiler(target_contents);
384 }
385 #endif // !defined(OS_ANDROID) 381 #endif // !defined(OS_ANDROID)
386 return target_contents; 382 return target_contents;
387 } 383 }
388 384
389 // If a prerendered page exists for |url|, replace the page at 385 // If a prerendered page exists for |url|, replace the page at
390 // |params->target_contents| with it and update to point to the swapped-in 386 // |params->target_contents| with it and update to point to the swapped-in
391 // WebContents. 387 // WebContents.
392 bool SwapInPrerender(const GURL& url, chrome::NavigateParams* params) { 388 bool SwapInPrerender(const GURL& url, chrome::NavigateParams* params) {
393 Profile* profile = 389 Profile* profile =
394 Profile::FromBrowserContext(params->target_contents->GetBrowserContext()); 390 Profile::FromBrowserContext(params->target_contents->GetBrowserContext());
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after
668 bool reverse_on_redirect = false; 664 bool reverse_on_redirect = false;
669 content::BrowserURLHandler::GetInstance()->RewriteURLIfNecessary( 665 content::BrowserURLHandler::GetInstance()->RewriteURLIfNecessary(
670 &rewritten_url, browser_context, &reverse_on_redirect); 666 &rewritten_url, browser_context, &reverse_on_redirect);
671 667
672 // Some URLs are mapped to uber subpages. Do not allow them in incognito. 668 // Some URLs are mapped to uber subpages. Do not allow them in incognito.
673 return !(rewritten_url.scheme() == content::kChromeUIScheme && 669 return !(rewritten_url.scheme() == content::kChromeUIScheme &&
674 rewritten_url.host() == chrome::kChromeUIUberHost); 670 rewritten_url.host() == chrome::kChromeUIUberHost);
675 } 671 }
676 672
677 } // namespace chrome 673 } // namespace chrome
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698