Chromium Code Reviews| 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" |
| 11 #include "chrome/browser/ui/views/content_setting_bubble_contents.h" | 11 #include "chrome/browser/ui/views/content_setting_bubble_contents.h" |
| 12 #include "chrome/browser/ui/views/new_task_manager_view.h" | 12 #include "chrome/browser/ui/views/new_task_manager_view.h" |
| 13 #include "chrome/browser/ui/views/website_settings/website_settings_popup_view.h " | 13 #include "chrome/browser/ui/views/website_settings/website_settings_popup_view.h " |
| 14 | 14 |
| 15 // This file provides definitions of desktop browser dialog-creation methods for | 15 // This file provides definitions of desktop browser dialog-creation methods for |
| 16 // Mac where a Cocoa browser is using Views dialogs. I.e. it is included in the | 16 // Mac where a Cocoa browser is using Views dialogs. I.e. it is included in the |
| 17 // Cocoa build and definitions under chrome/browser/ui/cocoa may select at | 17 // Cocoa build and definitions under chrome/browser/ui/cocoa may select at |
| 18 // runtime whether to show a Cocoa dialog, or the toolkit-views dialog defined | 18 // runtime whether to show a Cocoa dialog, or the toolkit-views dialog defined |
| 19 // here (declared in browser_dialogs.h). | 19 // here (declared in browser_dialogs.h). |
| 20 | 20 |
| 21 namespace chrome { | 21 namespace chrome { |
| 22 | 22 |
| 23 void ShowWebsiteSettingsBubbleViewsAtPoint( | 23 void ShowWebsiteSettingsBubbleViewsAtPoint( |
| 24 const gfx::Point& anchor_point, | 24 const gfx::Point& anchor_point, |
| 25 Profile* profile, | 25 Profile* profile, |
| 26 content::WebContents* web_contents, | 26 content::WebContents* web_contents, |
| 27 const GURL& virtual_url, | 27 const GURL& virtual_url, |
| 28 const security_state::SecurityStateModel::SecurityInfo& security_info) { | 28 const security_state::SecurityStateModel::SecurityInfo& security_info) { |
| 29 // Don't show the popup again if it's already showing. A second click on the | |
| 30 // location icon in the omnibox will dismiss an open popup. This is consistent | |
| 31 // with the non-Mac views implementation. | |
|
tapted
2016/06/06 05:06:37
toolkit-views does something weird around this in
dominickn
2016/06/08 03:03:08
Done.
| |
| 32 if (WebsiteSettingsPopupView::IsPopupShowing()) | |
| 33 return; | |
| 34 | |
| 29 WebsiteSettingsPopupView::ShowPopup( | 35 WebsiteSettingsPopupView::ShowPopup( |
| 30 nullptr, gfx::Rect(anchor_point, gfx::Size()), profile, web_contents, | 36 nullptr, gfx::Rect(anchor_point, gfx::Size()), profile, web_contents, |
| 31 virtual_url, security_info); | 37 virtual_url, security_info); |
| 32 } | 38 } |
| 33 | 39 |
| 34 void ShowBookmarkBubbleViewsAtPoint(const gfx::Point& anchor_point, | 40 void ShowBookmarkBubbleViewsAtPoint(const gfx::Point& anchor_point, |
| 35 gfx::NativeView parent, | 41 gfx::NativeView parent, |
| 36 bookmarks::BookmarkBubbleObserver* observer, | 42 bookmarks::BookmarkBubbleObserver* observer, |
| 37 Browser* browser, | 43 Browser* browser, |
| 38 const GURL& virtual_url, | 44 const GURL& virtual_url, |
| (...skipping 24 matching lines...) Expand all Loading... | |
| 63 const gfx::Point& anchor) { | 69 const gfx::Point& anchor) { |
| 64 ContentSettingBubbleContents* contents = | 70 ContentSettingBubbleContents* contents = |
| 65 new ContentSettingBubbleContents(model, web_contents, nullptr, | 71 new ContentSettingBubbleContents(model, web_contents, nullptr, |
| 66 views::BubbleBorder::Arrow::TOP_RIGHT); | 72 views::BubbleBorder::Arrow::TOP_RIGHT); |
| 67 contents->set_parent_window(parent_view); | 73 contents->set_parent_window(parent_view); |
| 68 contents->SetAnchorRect(gfx::Rect(anchor, gfx::Size())); | 74 contents->SetAnchorRect(gfx::Rect(anchor, gfx::Size())); |
| 69 views::BubbleDialogDelegateView::CreateBubble(contents)->Show(); | 75 views::BubbleDialogDelegateView::CreateBubble(contents)->Show(); |
| 70 } | 76 } |
| 71 | 77 |
| 72 } // namespace chrome | 78 } // namespace chrome |
| OLD | NEW |