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

Side by Side Diff: chrome/browser/task_management/providers/web_contents/guest_task.cc

Issue 2148083002: Fix interstitial pages not updating the task manager renderers' titles and favicons (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 5 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
« no previous file with comments | « no previous file | chrome/browser/task_management/providers/web_contents/web_contents_task_provider.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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/task_management/providers/web_contents/guest_task.h" 5 #include "chrome/browser/task_management/providers/web_contents/guest_task.h"
6 6
7 #include "components/guest_view/browser/guest_view_base.h" 7 #include "components/guest_view/browser/guest_view_base.h"
8 #include "content/public/browser/web_contents.h" 8 #include "content/public/browser/web_contents.h"
9 #include "ui/base/l10n/l10n_util.h" 9 #include "ui/base/l10n/l10n_util.h"
10 10
(...skipping 22 matching lines...) Expand all
33 return Task::GUEST; 33 return Task::GUEST;
34 } 34 }
35 35
36 base::string16 GuestTask::GetCurrentTitle( 36 base::string16 GuestTask::GetCurrentTitle(
37 content::WebContents* web_contents) const { 37 content::WebContents* web_contents) const {
38 DCHECK(web_contents); 38 DCHECK(web_contents);
39 39
40 guest_view::GuestViewBase* guest = 40 guest_view::GuestViewBase* guest =
41 guest_view::GuestViewBase::FromWebContents(web_contents); 41 guest_view::GuestViewBase::FromWebContents(web_contents);
42 42
43 DCHECK(guest); 43 if (!guest) {
44 // This can happen when an AppWindowContentsImpl is destroyed. It emits a
45 // DidFinishNavigation() events to the WebContentsObservers which triggers a
46 // title update in WebContentsTaskProvider. This happens before
47 // WebContentsDestroyed() is emitted.
48 return title();
49 }
44 50
45 base::string16 title = 51 base::string16 title =
46 l10n_util::GetStringFUTF16(guest->GetTaskPrefix(), 52 l10n_util::GetStringFUTF16(guest->GetTaskPrefix(),
47 RendererTask::GetTitleFromWebContents( 53 RendererTask::GetTitleFromWebContents(
48 web_contents)); 54 web_contents));
49 55
50 return title; 56 return title;
51 } 57 }
52 58
53 } // namespace task_management 59 } // namespace task_management
54 60
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/task_management/providers/web_contents/web_contents_task_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698