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

Unified Diff: chrome/browser/ui/cocoa/tab_contents/instant_overlay_controller_mac.mm

Issue 12386019: Instant: Use only one hidden WebContents per profile. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 10 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/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];
+}

Powered by Google App Engine
This is Rietveld 408576698