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

Unified Diff: chrome/browser/ui/cocoa/passwords/passwords_bubble_cocoa.mm

Issue 2808823002: MacViews: Allows the toolkit-views Manage Passwords Dialog to be used (Closed)
Patch Set: MacViews: Allows the toolkit-views Manage Passwords Dialog to be used Created 3 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/cocoa/passwords/passwords_bubble_cocoa.mm
diff --git a/chrome/browser/ui/cocoa/passwords/passwords_bubble_cocoa.mm b/chrome/browser/ui/cocoa/passwords/passwords_bubble_cocoa.mm
index d5e520aa1f95ff367d1f59e4ec006f0767bb715e..9fe797cbcc88a1752403f3dce4434bb112a11ac2 100644
--- a/chrome/browser/ui/cocoa/passwords/passwords_bubble_cocoa.mm
+++ b/chrome/browser/ui/cocoa/passwords/passwords_bubble_cocoa.mm
@@ -15,6 +15,7 @@
#include "chrome/browser/ui/passwords/manage_passwords_icon.h"
#include "chrome/browser/ui/passwords/passwords_model_delegate.h"
#include "content/public/browser/web_contents.h"
+#include "ui/base/material_design/material_design_controller.h"
typedef void (^Callback)(void);
@@ -109,6 +110,19 @@ void ManagePasswordsBubbleCocoa::OnClose() {
// static
void ManagePasswordsBubbleCocoa::Show(content::WebContents* webContents,
bool user_action) {
+ if (ui::MaterialDesignController::IsSecondaryUiMaterial()) {
tapted 2017/04/11 07:48:58 I think it's fine to move this down to line 140 so
varkha 2017/04/12 01:57:28 Done.
+ NSWindow* window = [webContents->GetNativeView() window];
+ if (!window) {
+ // The tab isn't active right now.
+ return;
+ }
+ BrowserWindowController* bwc =
+ [BrowserWindowController browserWindowControllerForWindow:window];
+ NSPoint ns_point = [bwc bookmarkBubblePoint];
tapted 2017/04/11 07:48:58 nit: ns_point -> anchor?
varkha 2017/04/12 01:57:28 Done.
+ ShowManagePasswordsBubbleOnCocoaBrowser(ns_point, webContents, user_action);
+ return;
+ }
+
if (bubble_) {
// The bubble is currently shown. It's to be reopened with the new content.
// Disable closing animation so that it's destroyed immediately.

Powered by Google App Engine
This is Rietveld 408576698