OLD | NEW |
---|---|
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 Loading... | |
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 |
OLD | NEW |