| 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" |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 | 67 |
| 68 void TabDialogsViews::HideManagePasswordsBubble() { | 68 void TabDialogsViews::HideManagePasswordsBubble() { |
| 69 if (!ManagePasswordsBubbleView::manage_password_bubble()) | 69 if (!ManagePasswordsBubbleView::manage_password_bubble()) |
| 70 return; | 70 return; |
| 71 content::WebContents* bubble_web_contents = | 71 content::WebContents* bubble_web_contents = |
| 72 ManagePasswordsBubbleView::manage_password_bubble()->web_contents(); | 72 ManagePasswordsBubbleView::manage_password_bubble()->web_contents(); |
| 73 if (web_contents_ == bubble_web_contents) | 73 if (web_contents_ == bubble_web_contents) |
| 74 ManagePasswordsBubbleView::CloseCurrentBubble(); | 74 ManagePasswordsBubbleView::CloseCurrentBubble(); |
| 75 } | 75 } |
| 76 | 76 |
| 77 std::unique_ptr<ValidationMessageBubble> TabDialogsViews::ShowValidationMessage( | 77 base::WeakPtr<ValidationMessageBubble> TabDialogsViews::ShowValidationMessage( |
| 78 const gfx::Rect& anchor_in_root_view, | 78 const gfx::Rect& anchor_in_root_view, |
| 79 const base::string16& main_text, | 79 const base::string16& main_text, |
| 80 const base::string16& sub_text) { | 80 const base::string16& sub_text) { |
| 81 return base::WrapUnique(new ValidationMessageBubbleView( | 81 return (new ValidationMessageBubbleView( |
| 82 web_contents_, anchor_in_root_view, main_text, sub_text)); | 82 web_contents_, anchor_in_root_view, main_text, sub_text))->AsWeakPtr(); |
| 83 } | 83 } |
| OLD | NEW |