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 "chrome/browser/ui/passwords/manage_passwords_bubble_model.h" | 7 #include "chrome/browser/ui/passwords/manage_passwords_bubble_model.h" |
8 #include "chrome/browser/ui/views/collected_cookies_views.h" | 8 #include "chrome/browser/ui/views/collected_cookies_views.h" |
9 #include "chrome/browser/ui/views/hung_renderer_view.h" | 9 #include "chrome/browser/ui/views/hung_renderer_view.h" |
10 #include "chrome/browser/ui/views/passwords/manage_passwords_bubble_view.h" | 10 #include "chrome/browser/ui/views/passwords/manage_passwords_bubble_view.h" |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 browser, profile, username, delegate); | 53 browser, profile, username, delegate); |
54 } | 54 } |
55 | 55 |
56 void TabDialogsViews::ShowManagePasswordsBubble(bool user_action) { | 56 void TabDialogsViews::ShowManagePasswordsBubble(bool user_action) { |
57 if (ManagePasswordsBubbleView::manage_password_bubble()) { | 57 if (ManagePasswordsBubbleView::manage_password_bubble()) { |
58 // The bubble is currently shown for some other tab. We should close it now | 58 // The bubble is currently shown for some other tab. We should close it now |
59 // and open for |web_contents_|. | 59 // and open for |web_contents_|. |
60 ManagePasswordsBubbleView::CloseBubble(); | 60 ManagePasswordsBubbleView::CloseBubble(); |
61 } | 61 } |
62 ManagePasswordsBubbleView::ShowBubble( | 62 ManagePasswordsBubbleView::ShowBubble( |
63 web_contents_, user_action ? ManagePasswordsBubbleModel::USER_ACTION | 63 web_contents_, user_action ? ManagePasswordsBubbleView::USER_GESTURE |
64 : ManagePasswordsBubbleModel::AUTOMATIC); | 64 : ManagePasswordsBubbleView::AUTOMATIC); |
65 } | 65 } |
66 | 66 |
67 void TabDialogsViews::HideManagePasswordsBubble() { | 67 void TabDialogsViews::HideManagePasswordsBubble() { |
68 if (!ManagePasswordsBubbleView::manage_password_bubble()) | 68 if (!ManagePasswordsBubbleView::manage_password_bubble()) |
69 return; | 69 return; |
70 content::WebContents* bubble_web_contents = | 70 content::WebContents* bubble_web_contents = |
71 ManagePasswordsBubbleView::manage_password_bubble()->web_contents(); | 71 ManagePasswordsBubbleView::manage_password_bubble()->web_contents(); |
72 if (web_contents_ == bubble_web_contents) | 72 if (web_contents_ == bubble_web_contents) |
73 ManagePasswordsBubbleView::CloseBubble(); | 73 ManagePasswordsBubbleView::CloseBubble(); |
74 } | 74 } |
75 | 75 |
76 scoped_ptr<ValidationMessageBubble> TabDialogsViews::ShowValidationMessage( | 76 scoped_ptr<ValidationMessageBubble> TabDialogsViews::ShowValidationMessage( |
77 const gfx::Rect& anchor_in_root_view, | 77 const gfx::Rect& anchor_in_root_view, |
78 const base::string16& main_text, | 78 const base::string16& main_text, |
79 const base::string16& sub_text) { | 79 const base::string16& sub_text) { |
80 return make_scoped_ptr(new ValidationMessageBubbleView( | 80 return make_scoped_ptr(new ValidationMessageBubbleView( |
81 web_contents_, anchor_in_root_view, main_text, sub_text)); | 81 web_contents_, anchor_in_root_view, main_text, sub_text)); |
82 } | 82 } |
OLD | NEW |