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 <utility> | 5 #include <utility> |
6 | 6 |
7 #include "chrome/browser/ui/bookmarks/bookmark_bubble_sign_in_delegate.h" | 7 #include "chrome/browser/ui/bookmarks/bookmark_bubble_sign_in_delegate.h" |
8 #include "chrome/browser/ui/browser.h" | 8 #include "chrome/browser/ui/browser.h" |
9 #include "chrome/browser/ui/browser_dialogs.h" | 9 #include "chrome/browser/ui/browser_dialogs.h" |
10 #include "chrome/browser/ui/views/bookmarks/bookmark_bubble_view.h" | 10 #include "chrome/browser/ui/views/bookmarks/bookmark_bubble_view.h" |
(...skipping 19 matching lines...) Expand all Loading... |
30 security_info); | 30 security_info); |
31 } | 31 } |
32 | 32 |
33 void ShowBookmarkBubbleViewsAtPoint(const gfx::Point& anchor_point, | 33 void ShowBookmarkBubbleViewsAtPoint(const gfx::Point& anchor_point, |
34 gfx::NativeView parent, | 34 gfx::NativeView parent, |
35 bookmarks::BookmarkBubbleObserver* observer, | 35 bookmarks::BookmarkBubbleObserver* observer, |
36 Browser* browser, | 36 Browser* browser, |
37 const GURL& url, | 37 const GURL& url, |
38 bool already_bookmarked) { | 38 bool already_bookmarked) { |
39 // The Views dialog may prompt for sign in. | 39 // The Views dialog may prompt for sign in. |
40 scoped_ptr<BubbleSyncPromoDelegate> delegate( | 40 std::unique_ptr<BubbleSyncPromoDelegate> delegate( |
41 new BookmarkBubbleSignInDelegate(browser)); | 41 new BookmarkBubbleSignInDelegate(browser)); |
42 | 42 |
43 BookmarkBubbleView::ShowBubble(nullptr, gfx::Rect(anchor_point, gfx::Size()), | 43 BookmarkBubbleView::ShowBubble(nullptr, gfx::Rect(anchor_point, gfx::Size()), |
44 parent, observer, std::move(delegate), | 44 parent, observer, std::move(delegate), |
45 browser->profile(), url, already_bookmarked); | 45 browser->profile(), url, already_bookmarked); |
46 } | 46 } |
47 | 47 |
48 void ContentSettingBubbleViewsBridge::Show(gfx::NativeView parent_view, | 48 void ContentSettingBubbleViewsBridge::Show(gfx::NativeView parent_view, |
49 ContentSettingBubbleModel* model, | 49 ContentSettingBubbleModel* model, |
50 content::WebContents* web_contents, | 50 content::WebContents* web_contents, |
51 const gfx::Point& anchor) { | 51 const gfx::Point& anchor) { |
52 ContentSettingBubbleContents* contents = | 52 ContentSettingBubbleContents* contents = |
53 new ContentSettingBubbleContents(model, web_contents, nullptr, | 53 new ContentSettingBubbleContents(model, web_contents, nullptr, |
54 views::BubbleBorder::Arrow::TOP_RIGHT); | 54 views::BubbleBorder::Arrow::TOP_RIGHT); |
55 contents->set_parent_window(parent_view); | 55 contents->set_parent_window(parent_view); |
56 contents->SetAnchorRect(gfx::Rect(anchor, gfx::Size())); | 56 contents->SetAnchorRect(gfx::Rect(anchor, gfx::Size())); |
57 views::BubbleDialogDelegateView::CreateBubble(contents)->Show(); | 57 views::BubbleDialogDelegateView::CreateBubble(contents)->Show(); |
58 } | 58 } |
59 | 59 |
60 } // namespace chrome | 60 } // namespace chrome |
OLD | NEW |