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

Side by Side Diff: chrome/browser/ui/cocoa/tab_contents/instant_preview_controller_mac.mm

Issue 12224052: Alternate NTP: Fix bug where shadow is not removed (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix tests 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/ui/cocoa/tab_contents/previewable_contents_controller.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/cocoa/tab_contents/instant_preview_controller_mac.h" 5 #include "chrome/browser/ui/cocoa/tab_contents/instant_preview_controller_mac.h"
6 6
7 #include "chrome/browser/instant/instant_model.h" 7 #include "chrome/browser/instant/instant_model.h"
8 #include "chrome/browser/ui/browser.h" 8 #include "chrome/browser/ui/browser.h"
9 #import "chrome/browser/ui/cocoa/browser_window_controller.h" 9 #import "chrome/browser/ui/cocoa/browser_window_controller.h"
10 #import "chrome/browser/ui/cocoa/tab_contents/previewable_contents_controller.h" 10 #import "chrome/browser/ui/cocoa/tab_contents/previewable_contents_controller.h"
(...skipping 11 matching lines...) Expand all
22 } 22 }
23 23
24 void InstantPreviewControllerMac::PreviewStateChanged( 24 void InstantPreviewControllerMac::PreviewStateChanged(
25 const InstantModel& model) { 25 const InstantModel& model) {
26 if (model.mode().is_ntp() || model.mode().is_search_suggestions()) { 26 if (model.mode().is_ntp() || model.mode().is_search_suggestions()) {
27 // Drop shadow is only needed if search mode is not |NTP| and preview does 27 // Drop shadow is only needed if search mode is not |NTP| and preview does
28 // not fill up the entire contents page. 28 // not fill up the entire contents page.
29 BOOL drawDropShadow = !model.mode().is_ntp() && 29 BOOL drawDropShadow = !model.mode().is_ntp() &&
30 !(model.height() == 100 && 30 !(model.height() == 100 &&
31 model.height_units() == INSTANT_SIZE_PERCENT); 31 model.height_units() == INSTANT_SIZE_PERCENT);
32 [preview_ showPreview:model.GetPreviewContents() 32 [preview_ setPreview:model.GetPreviewContents()
33 height:model.height() 33 height:model.height()
34 heightUnits:model.height_units() 34 heightUnits:model.height_units()
35 drawDropShadow:drawDropShadow]; 35 drawDropShadow:drawDropShadow];
36 } else { 36 } else {
37 [preview_ hidePreview]; 37 [preview_ setPreview:NULL
38 height:0
39 heightUnits:INSTANT_SIZE_PIXELS
40 drawDropShadow:NO];
38 } 41 }
39 browser_->MaybeUpdateBookmarkBarStateForInstantPreview(model.mode()); 42 browser_->MaybeUpdateBookmarkBarStateForInstantPreview(model.mode());
40 [window_ updateBookmarkBarStateForInstantPreview]; 43 [window_ updateBookmarkBarStateForInstantPreview];
41 } 44 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/cocoa/tab_contents/previewable_contents_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698