| 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 15 matching lines...) Expand all Loading... |
| 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 bubble again if it's already showing. A second click on the | 29 // Don't show the bubble again if it's already showing. A second click on the |
| 30 // location icon in the omnibox will dismiss an open bubble. This behaviour is | 30 // location icon in the omnibox will dismiss an open bubble. This behaviour is |
| 31 // consistent with the non-Mac views implementation. | 31 // consistent with the non-Mac views implementation. |
| 32 // Note that when the browser is toolkit-views, IsPopupShowing() is checked | 32 // Note that when the browser is toolkit-views, IsPopupShowing() is checked |
| 33 // earlier because the popup is shown on mouse release (but dismissed on | 33 // earlier because the popup is shown on mouse release (but dismissed on |
| 34 // mouse pressed). A Cocoa browser does both on mouse pressed, so a check | 34 // mouse pressed). A Cocoa browser does both on mouse pressed, so a check |
| 35 // when showing is sufficient. | 35 // when showing is sufficient. |
| 36 if (WebsiteSettingsPopupView::IsPopupShowing()) | 36 if (WebsiteSettingsPopupView::GetShownPopupType() != |
| 37 WebsiteSettingsPopupView::POPUP_NONE) { |
| 37 return; | 38 return; |
| 39 } |
| 38 | 40 |
| 39 WebsiteSettingsPopupView::ShowPopup( | 41 WebsiteSettingsPopupView::ShowPopup( |
| 40 nullptr, gfx::Rect(anchor_point, gfx::Size()), profile, web_contents, | 42 nullptr, gfx::Rect(anchor_point, gfx::Size()), profile, web_contents, |
| 41 virtual_url, security_info); | 43 virtual_url, security_info); |
| 42 } | 44 } |
| 43 | 45 |
| 44 void ShowBookmarkBubbleViewsAtPoint(const gfx::Point& anchor_point, | 46 void ShowBookmarkBubbleViewsAtPoint(const gfx::Point& anchor_point, |
| 45 gfx::NativeView parent, | 47 gfx::NativeView parent, |
| 46 bookmarks::BookmarkBubbleObserver* observer, | 48 bookmarks::BookmarkBubbleObserver* observer, |
| 47 Browser* browser, | 49 Browser* browser, |
| (...skipping 25 matching lines...) Expand all Loading... |
| 73 const gfx::Point& anchor) { | 75 const gfx::Point& anchor) { |
| 74 ContentSettingBubbleContents* contents = | 76 ContentSettingBubbleContents* contents = |
| 75 new ContentSettingBubbleContents(model, web_contents, nullptr, | 77 new ContentSettingBubbleContents(model, web_contents, nullptr, |
| 76 views::BubbleBorder::Arrow::TOP_RIGHT); | 78 views::BubbleBorder::Arrow::TOP_RIGHT); |
| 77 contents->set_parent_window(parent_view); | 79 contents->set_parent_window(parent_view); |
| 78 contents->SetAnchorRect(gfx::Rect(anchor, gfx::Size())); | 80 contents->SetAnchorRect(gfx::Rect(anchor, gfx::Size())); |
| 79 views::BubbleDialogDelegateView::CreateBubble(contents)->Show(); | 81 views::BubbleDialogDelegateView::CreateBubble(contents)->Show(); |
| 80 } | 82 } |
| 81 | 83 |
| 82 } // namespace chrome | 84 } // namespace chrome |
| OLD | NEW |