Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(549)

Side by Side Diff: chrome/browser/ui/views/browser_dialogs_views_mac.cc

Issue 2041723002: [Mac] Dismiss an open page info dialog when the location icon is clicked. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address reviewer comments Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/browser/ui/cocoa/website_settings/website_settings_bubble_controller.mm ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 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
31 // consistent with the non-Mac views implementation.
32 // This must be checked explicitly on views platforms because the bubble is
tapted 2016/06/08 06:54:57 'views platforms' is a confusing concept now :). P
dominickn 2016/06/08 07:03:34 Done.
33 // triggered on mouse release, which is too late to stop the original bubble
34 // from being dismissed and IsPopupShowing from being reset. On Mac, this
35 // method is called on mouse press, before the bubble deallocates and resets.
36 if (WebsiteSettingsPopupView::IsPopupShowing())
37 return;
38
29 WebsiteSettingsPopupView::ShowPopup( 39 WebsiteSettingsPopupView::ShowPopup(
30 nullptr, gfx::Rect(anchor_point, gfx::Size()), profile, web_contents, 40 nullptr, gfx::Rect(anchor_point, gfx::Size()), profile, web_contents,
31 virtual_url, security_info); 41 virtual_url, security_info);
32 } 42 }
33 43
34 void ShowBookmarkBubbleViewsAtPoint(const gfx::Point& anchor_point, 44 void ShowBookmarkBubbleViewsAtPoint(const gfx::Point& anchor_point,
35 gfx::NativeView parent, 45 gfx::NativeView parent,
36 bookmarks::BookmarkBubbleObserver* observer, 46 bookmarks::BookmarkBubbleObserver* observer,
37 Browser* browser, 47 Browser* browser,
38 const GURL& virtual_url, 48 const GURL& virtual_url,
(...skipping 24 matching lines...) Expand all
63 const gfx::Point& anchor) { 73 const gfx::Point& anchor) {
64 ContentSettingBubbleContents* contents = 74 ContentSettingBubbleContents* contents =
65 new ContentSettingBubbleContents(model, web_contents, nullptr, 75 new ContentSettingBubbleContents(model, web_contents, nullptr,
66 views::BubbleBorder::Arrow::TOP_RIGHT); 76 views::BubbleBorder::Arrow::TOP_RIGHT);
67 contents->set_parent_window(parent_view); 77 contents->set_parent_window(parent_view);
68 contents->SetAnchorRect(gfx::Rect(anchor, gfx::Size())); 78 contents->SetAnchorRect(gfx::Rect(anchor, gfx::Size()));
69 views::BubbleDialogDelegateView::CreateBubble(contents)->Show(); 79 views::BubbleDialogDelegateView::CreateBubble(contents)->Show();
70 } 80 }
71 81
72 } // namespace chrome 82 } // namespace chrome
OLDNEW
« no previous file with comments | « chrome/browser/ui/cocoa/website_settings/website_settings_bubble_controller.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698