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

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

Issue 2086423005: Using WebContents::UpdateTitleForEntry() instead of NavigationEntry::SetTitle() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: DidFinishNavigation is received when RenderFrameHostImpl is destroyed!! Created 4 years, 6 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 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 return base::string16();
Charlie Reis 2016/06/24 22:21:17 Just curious, in which case did this fail? Might
afakhry 2016/06/27 14:29:18 This caused crashes in some browsertests when I ch
Charlie Reis 2016/06/28 00:47:09 Ack. For posterity (when the link above expires),
44 45
45 base::string16 title = 46 base::string16 title =
46 l10n_util::GetStringFUTF16(guest->GetTaskPrefix(), 47 l10n_util::GetStringFUTF16(guest->GetTaskPrefix(),
47 RendererTask::GetTitleFromWebContents( 48 RendererTask::GetTitleFromWebContents(
48 web_contents)); 49 web_contents));
49 50
50 return title; 51 return title;
51 } 52 }
52 53
53 } // namespace task_management 54 } // namespace task_management
54 55
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698