New issue
Advanced search Search tips

Issue 890355 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Oct 1
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Mac
Pri: 3
Type: Bug-Regression



Sign in to add a comment

-[ShareMenuController saveTransitionDataFromBrowser] does the wrong thing after macviews (?)

Project Member Reported by thakis@chromium.org, Sep 28

Issue description

https://cs.chromium.org/chromium/src/chrome/browser/ui/cocoa/share_menu_controller.mm?type=cs&g=0&l=161


  TabWindowController* tabWindowController =
      TabWindowControllerForWindow(windowForShare_);
  NSView* contentsView = [tabWindowController tabContentArea];
  NSRect rectInWindow =
      [[contentsView superview] convertRect:[contentsView frame] toView:nil];
  rectForShare_ = [windowForShare_ convertRectToScreen:rectInWindow];

  gfx::Image image;
  gfx::Rect rect = gfx::Rect(NSRectToCGRect([contentsView bounds]));
  if (ui::GrabViewSnapshot(contentsView, rect, &image)) {
    snapshotForShare_.reset(image.CopyNSImage());
  }



But:

// Returns the TabWindowController backing a Cocoa browser window. Always
// returns nil if |window| is a views browser window.
TabWindowController* TabWindowControllerForWindow(NSWindow* window);


So the code probably doesn't do what we want.
 
Oof! Thanks. I'll get to this today to unblock you.
Project Member

Comment 2 by bugdroid1@chromium.org, Oct 1

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/51e76634e66d80b5341db6c26a3f6fb895e2384a

commit 51e76634e66d80b5341db6c26a3f6fb895e2384a
Author: Leonard Grey <lgrey@chromium.org>
Date: Mon Oct 01 16:52:21 2018

Mac: De-Cocoa ShareMenuController

We managed to miss the fact that ShareMenuController's transition animation
data was dependent on Cocoa browser windows. This change uses Views APIs
to get the content area's rect and screengrab instead.

Bug:  890355 
Change-Id: Ifa86782902e24985228a423510b65b5a58ef37b5
Reviewed-on: https://chromium-review.googlesource.com/1252245
Reviewed-by: Avi Drissman <avi@chromium.org>
Commit-Queue: Leonard Grey <lgrey@chromium.org>
Cr-Commit-Position: refs/heads/master@{#595469}
[modify] https://crrev.com/51e76634e66d80b5341db6c26a3f6fb895e2384a/chrome/browser/ui/cocoa/share_menu_controller.mm

Owner: lgrey@chromium.org
Status: Started (was: Untriaged)
Status: Fixed (was: Started)

Sign in to add a comment