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

Side by Side 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, 9 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "chrome/browser/ui/cocoa/tab_contents/instant_overlay_controller_mac.h"
6
7 #include "chrome/browser/instant/instant_model.h"
8 #include "chrome/browser/ui/browser.h"
9 #import "chrome/browser/ui/cocoa/browser_window_controller.h"
10 #import "chrome/browser/ui/cocoa/tab_contents/overlayable_contents_controller.h"
11
12 InstantOverlayControllerMac::InstantOverlayControllerMac(
13 Browser* browser,
14 BrowserWindowController* window,
15 OverlayableContentsController* overlay)
16 : InstantOverlayController(browser),
17 window_(window),
18 overlay_(overlay) {
19 }
20
21 InstantOverlayControllerMac::~InstantOverlayControllerMac() {
22 }
23
24 void InstantOverlayControllerMac::OverlayStateChanged(
25 const InstantModel& model) {
26 if (model.overlay()) {
27 // Drop shadow is only needed if the overlay does not fill up the entire
28 // contents page. TODO(sail): Use the computed height, a la the Views code.
29 BOOL drawDropShadow = model.height() != 100 || model.is_height_in_pixels();
30 [overlay_ setOverlay:model.overlay()
31 height:model.height()
32 isHeightInPixels:model.is_height_in_pixels()
33 drawDropShadow:drawDropShadow];
34 browser_->MaybeUpdateBookmarkBarStateForInstantOverlay();
35 } else {
36 [overlay_ setOverlay:NULL
37 height:0
38 isHeightInPixels:NO
39 drawDropShadow:NO];
40 }
41 [window_ updateBookmarkBarStateForInstantOverlay];
42 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698