OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/views/tab_dialogs_views.h" | 5 #include "chrome/browser/ui/views/tab_dialogs_views.h" |
6 | 6 |
7 #include "base/memory/ptr_util.h" | 7 #include "base/memory/ptr_util.h" |
8 #include "chrome/browser/ui/passwords/manage_passwords_bubble_model.h" | 8 #include "chrome/browser/ui/passwords/manage_passwords_bubble_model.h" |
9 #include "chrome/browser/ui/views/collected_cookies_views.h" | 9 #include "chrome/browser/ui/views/collected_cookies_views.h" |
10 #include "chrome/browser/ui/views/hung_renderer_view.h" | 10 #include "chrome/browser/ui/views/hung_renderer_view.h" |
11 #include "chrome/browser/ui/views/passwords/manage_passwords_bubble_view.h" | 11 #include "chrome/browser/ui/views/passwords/manage_passwords_bubble_view.h" |
12 #include "chrome/browser/ui/views/validation_message_bubble_view.h" | 12 #include "chrome/browser/ui/views/validation_message_bubble_view.h" |
13 #include "content/public/browser/web_contents.h" | 13 #include "content/public/browser/web_contents.h" |
14 | 14 |
15 #if !defined(OS_CHROMEOS) | 15 #if !defined(OS_CHROMEOS) |
16 #include "chrome/browser/ui/views/sync/profile_signin_confirmation_dialog_views.
h" | 16 #include "chrome/browser/ui/views/sync/profile_signin_confirmation_dialog_views.
h" |
17 #endif | 17 #endif |
18 | 18 |
19 // static | 19 // static |
20 void TabDialogs::CreateForWebContents(content::WebContents* contents) { | 20 void TabDialogs::CreateForWebContents(content::WebContents* contents) { |
21 DCHECK(contents); | 21 DCHECK(contents); |
22 if (!FromWebContents(contents)) | 22 if (!FromWebContents(contents)) { |
23 contents->SetUserData(UserDataKey(), new TabDialogsViews(contents)); | 23 contents->SetUserData(UserDataKey(), |
| 24 base::MakeUnique<TabDialogsViews>(contents)); |
| 25 } |
24 } | 26 } |
25 | 27 |
26 TabDialogsViews::TabDialogsViews(content::WebContents* contents) | 28 TabDialogsViews::TabDialogsViews(content::WebContents* contents) |
27 : web_contents_(contents) { | 29 : web_contents_(contents) { |
28 DCHECK(contents); | 30 DCHECK(contents); |
29 } | 31 } |
30 | 32 |
31 TabDialogsViews::~TabDialogsViews() { | 33 TabDialogsViews::~TabDialogsViews() { |
32 } | 34 } |
33 | 35 |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 ManagePasswordsBubbleView::CloseCurrentBubble(); | 84 ManagePasswordsBubbleView::CloseCurrentBubble(); |
83 } | 85 } |
84 | 86 |
85 base::WeakPtr<ValidationMessageBubble> TabDialogsViews::ShowValidationMessage( | 87 base::WeakPtr<ValidationMessageBubble> TabDialogsViews::ShowValidationMessage( |
86 const gfx::Rect& anchor_in_root_view, | 88 const gfx::Rect& anchor_in_root_view, |
87 const base::string16& main_text, | 89 const base::string16& main_text, |
88 const base::string16& sub_text) { | 90 const base::string16& sub_text) { |
89 return (new ValidationMessageBubbleView( | 91 return (new ValidationMessageBubbleView( |
90 web_contents_, anchor_in_root_view, main_text, sub_text))->AsWeakPtr(); | 92 web_contents_, anchor_in_root_view, main_text, sub_text))->AsWeakPtr(); |
91 } | 93 } |
OLD | NEW |