| Index: chrome/browser/ui/cocoa/chrome_to_mobile_bubble_controller.mm
|
| diff --git a/chrome/browser/ui/cocoa/chrome_to_mobile_bubble_controller.mm b/chrome/browser/ui/cocoa/chrome_to_mobile_bubble_controller.mm
|
| index ae823a96b2e42a973397236d5126125fadfe0a78..e9d2db37dc55aa1940947e3e403a0c96a8ec4452 100644
|
| --- a/chrome/browser/ui/cocoa/chrome_to_mobile_bubble_controller.mm
|
| +++ b/chrome/browser/ui/cocoa/chrome_to_mobile_bubble_controller.mm
|
| @@ -15,6 +15,7 @@
|
| #include "content/public/browser/notification_service.h"
|
| #include "content/public/browser/notification_types.h"
|
| #include "grit/generated_resources.h"
|
| +#include "grit/theme_resources.h"
|
| #include "ui/base/l10n/l10n_util.h"
|
| #include "ui/base/l10n/l10n_util_mac.h"
|
| #include "ui/base/text/bytes_formatting.h"
|
| @@ -88,6 +89,15 @@ void ChromeToMobileBubbleNotificationBridge::OnSendComplete(bool success) {
|
| // Instruct the service to delete the snapshot file.
|
| service_->DeleteSnapshot(snapshotPath_);
|
|
|
| + BrowserWindowController* controller = [BrowserWindowController
|
| + browserWindowControllerForWindow:self.parentWindow];
|
| + [controller chromeToMobileBubbleWindowWillClose];
|
| +
|
| + // Restore the Action Box icon when the bubble closes.
|
| + LocationBarViewMac* locationBar = [controller locationBarBridge];
|
| + if (locationBar)
|
| + locationBar->SetActionBoxIcon(IDR_ACTION_BOX_BUTTON);
|
| +
|
| // We caught a close so we don't need to observe further notifications.
|
| bridge_.reset(NULL);
|
| [progressAnimation_ stopAnimation];
|
| @@ -141,29 +151,24 @@ void ChromeToMobileBubbleNotificationBridge::OnSendComplete(bool success) {
|
| [window setFrame:windowFrame display:YES animate:NO];
|
| }
|
|
|
| - // Get the anchor point for the bubble in screen coordinates.
|
| - BrowserWindowController* controller = [BrowserWindowController
|
| - browserWindowControllerForWindow:self.parentWindow];
|
| - if (controller != nil) {
|
| - LocationBarViewMac* locationBar = [controller locationBarBridge];
|
| - NSPoint bubblePoint;
|
| - if (extensions::switch_utils::IsExtensionsInActionBoxEnabled()) {
|
| - bubblePoint = locationBar->GetActionBoxAnchorPoint();
|
| - bubblePoint = [self.parentWindow convertBaseToScreen:bubblePoint];
|
| - // Without an arrow, the anchor point of a bubble is the top left corner,
|
| - // but GetActionBoxAnchorPoint returns the top right corner.
|
| - bubblePoint.x -= self.bubble.frame.size.width;
|
| - [self.bubble setArrowLocation:info_bubble::kNoArrow];
|
| - [self.bubble setCornerFlags:info_bubble::kRoundedBottomCorners];
|
| - [self.bubble setAlignment:info_bubble::kAlignEdgeToAnchorEdge];
|
| - [window setContentSize:self.bubble.frame.size];
|
| - [window setContentView:self.bubble];
|
| - } else {
|
| - bubblePoint = locationBar->GetChromeToMobileBubblePoint();
|
| - bubblePoint = [self.parentWindow convertBaseToScreen:bubblePoint];
|
| - [self.bubble setArrowLocation:info_bubble::kTopRight];
|
| - }
|
| + LocationBarViewMac* locationBar = [[BrowserWindowController
|
| + browserWindowControllerForWindow:self.parentWindow] locationBarBridge];
|
| + if (locationBar) {
|
| + // Get the anchor point for the bubble in screen coordinates.
|
| + NSPoint bubblePoint = locationBar->GetActionBoxAnchorPoint();
|
| + bubblePoint = [self.parentWindow convertBaseToScreen:bubblePoint];
|
| + // Without an arrow, the anchor point of a bubble is the top left corner,
|
| + // but GetActionBoxAnchorPoint returns the top right corner.
|
| + bubblePoint.x -= self.bubble.frame.size.width;
|
| + [self.bubble setArrowLocation:info_bubble::kNoArrow];
|
| + [self.bubble setCornerFlags:info_bubble::kRoundedBottomCorners];
|
| + [self.bubble setAlignment:info_bubble::kAlignEdgeToAnchorEdge];
|
| + [window setContentSize:self.bubble.frame.size];
|
| + [window setContentView:self.bubble];
|
| [self setAnchorPoint:bubblePoint];
|
| +
|
| + // Show the lit Chrome To Mobile icon while the bubble is open.
|
| + locationBar->SetActionBoxIcon(IDR_MOBILE_LIT);
|
| }
|
|
|
| // Initialize the checkbox to send an offline copy.
|
|
|