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/views/collected_cookies_views.h" | 7 #include "chrome/browser/ui/views/collected_cookies_views.h" |
8 #include "chrome/browser/ui/views/hung_renderer_view.h" | 8 #include "chrome/browser/ui/views/hung_renderer_view.h" |
9 #include "chrome/browser/ui/views/passwords/manage_passwords_bubble_view.h" | 9 #include "chrome/browser/ui/views/passwords/manage_passwords_bubble_view.h" |
10 #include "chrome/browser/ui/views/sync/profile_signin_confirmation_dialog_views.
h" | 10 #include "chrome/browser/ui/views/sync/profile_signin_confirmation_dialog_views.
h" |
11 #include "chrome/browser/ui/views/validation_message_bubble_view.h" | 11 #include "chrome/browser/ui/views/validation_message_bubble_view.h" |
12 #include "content/public/browser/web_contents.h" | 12 #include "content/public/browser/web_contents.h" |
13 | 13 |
14 // static | 14 // static |
15 void TabDialogs::CreateForWebContents(content::WebContents* contents) { | 15 void TabDialogs::CreateForWebContents(content::WebContents* contents) { |
16 DCHECK(contents); | 16 DCHECK(contents); |
17 if (!FromWebContents(contents)) | 17 if (!FromWebContents(contents)) |
18 contents->SetUserData(UserDataKey(), new TabDialogsViews(contents)); | 18 contents->SetUserData(UserDataKey(), new TabDialogsViews(contents)); |
19 } | 19 } |
20 | 20 |
21 TabDialogsViews::TabDialogsViews(content::WebContents* contents) | 21 TabDialogsViews::TabDialogsViews(content::WebContents* contents) |
22 : web_contents_(contents) { | 22 : web_contents_(contents) { |
23 DCHECK(contents); | 23 DCHECK(contents); |
24 } | 24 } |
25 | 25 |
26 TabDialogsViews::~TabDialogsViews() { | 26 TabDialogsViews::~TabDialogsViews() { |
27 } | 27 } |
28 | 28 |
| 29 gfx::NativeView TabDialogsViews::GetDialogParentView() const { |
| 30 return web_contents_->GetNativeView(); |
| 31 } |
| 32 |
29 void TabDialogsViews::ShowCollectedCookies() { | 33 void TabDialogsViews::ShowCollectedCookies() { |
30 // Deletes itself on close. | 34 // Deletes itself on close. |
31 new CollectedCookiesViews(web_contents_); | 35 new CollectedCookiesViews(web_contents_); |
32 } | 36 } |
33 | 37 |
34 void TabDialogsViews::ShowHungRendererDialog() { | 38 void TabDialogsViews::ShowHungRendererDialog() { |
35 HungRendererDialogView::Show(web_contents_); | 39 HungRendererDialogView::Show(web_contents_); |
36 } | 40 } |
37 | 41 |
38 void TabDialogsViews::HideHungRendererDialog() { | 42 void TabDialogsViews::HideHungRendererDialog() { |
(...skipping 29 matching lines...) Expand all Loading... |
68 ManagePasswordsBubbleView::CloseBubble(); | 72 ManagePasswordsBubbleView::CloseBubble(); |
69 } | 73 } |
70 | 74 |
71 scoped_ptr<ValidationMessageBubble> TabDialogsViews::ShowValidationMessage( | 75 scoped_ptr<ValidationMessageBubble> TabDialogsViews::ShowValidationMessage( |
72 const gfx::Rect& anchor_in_root_view, | 76 const gfx::Rect& anchor_in_root_view, |
73 const base::string16& main_text, | 77 const base::string16& main_text, |
74 const base::string16& sub_text) { | 78 const base::string16& sub_text) { |
75 return make_scoped_ptr(new ValidationMessageBubbleView( | 79 return make_scoped_ptr(new ValidationMessageBubbleView( |
76 web_contents_, anchor_in_root_view, main_text, sub_text)); | 80 web_contents_, anchor_in_root_view, main_text, sub_text)); |
77 } | 81 } |
OLD | NEW |