| Index: chrome/browser/ui/cocoa/tab_contents/instant_overlay_controller_mac.mm
|
| diff --git a/chrome/browser/ui/cocoa/tab_contents/instant_overlay_controller_mac.mm b/chrome/browser/ui/cocoa/tab_contents/instant_overlay_controller_mac.mm
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..e958ff1c9d8b7c0d57c839a4c8dec334493163ed
|
| --- /dev/null
|
| +++ b/chrome/browser/ui/cocoa/tab_contents/instant_overlay_controller_mac.mm
|
| @@ -0,0 +1,42 @@
|
| +// Copyright 2012 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#include "chrome/browser/ui/cocoa/tab_contents/instant_overlay_controller_mac.h"
|
| +
|
| +#include "chrome/browser/instant/instant_model.h"
|
| +#include "chrome/browser/ui/browser.h"
|
| +#import "chrome/browser/ui/cocoa/browser_window_controller.h"
|
| +#import "chrome/browser/ui/cocoa/tab_contents/overlayable_contents_controller.h"
|
| +
|
| +InstantOverlayControllerMac::InstantOverlayControllerMac(
|
| + Browser* browser,
|
| + BrowserWindowController* window,
|
| + OverlayableContentsController* overlay)
|
| + : InstantOverlayController(browser),
|
| + window_(window),
|
| + overlay_(overlay) {
|
| +}
|
| +
|
| +InstantOverlayControllerMac::~InstantOverlayControllerMac() {
|
| +}
|
| +
|
| +void InstantOverlayControllerMac::OverlayStateChanged(
|
| + const InstantModel& model) {
|
| + if (model.overlay()) {
|
| + // Drop shadow is only needed if the overlay does not fill up the entire
|
| + // contents page. TODO(sail): Use the computed height, a la the Views code.
|
| + BOOL drawDropShadow = model.height() != 100 || model.is_height_in_pixels();
|
| + [overlay_ setOverlay:model.overlay()
|
| + height:model.height()
|
| + isHeightInPixels:model.is_height_in_pixels()
|
| + drawDropShadow:drawDropShadow];
|
| + browser_->MaybeUpdateBookmarkBarStateForInstantOverlay();
|
| + } else {
|
| + [overlay_ setOverlay:NULL
|
| + height:0
|
| + isHeightInPixels:NO
|
| + drawDropShadow:NO];
|
| + }
|
| + [window_ updateBookmarkBarStateForInstantOverlay];
|
| +}
|
|
|