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

Side by Side Diff: chrome/browser/ui/views/frame/instant_preview_controller_views.cc

Issue 12036075: alternate ntp: fix website page jankiness when suggestions show and top bars are hidden (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: changed mechanism to receive PreviewStateChanged 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 | « chrome/browser/ui/views/frame/contents_container.cc ('k') | no next file » | 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/views/frame/instant_preview_controller_views.h" 5 #include "chrome/browser/ui/views/frame/instant_preview_controller_views.h"
6 6
7 #include "chrome/browser/instant/instant_model.h" 7 #include "chrome/browser/instant/instant_model.h"
8 #include "chrome/browser/profiles/profile.h" 8 #include "chrome/browser/profiles/profile.h"
9 #include "chrome/browser/ui/browser.h" 9 #include "chrome/browser/ui/browser.h"
10 #include "chrome/browser/ui/view_ids.h" 10 #include "chrome/browser/ui/view_ids.h"
11 #include "chrome/browser/ui/views/frame/browser_view.h" 11 #include "chrome/browser/ui/views/frame/browser_view.h"
12 #include "chrome/browser/ui/views/frame/contents_container.h" 12 #include "chrome/browser/ui/views/frame/contents_container.h"
13 #include "chrome/browser/ui/views/infobars/infobar_container_view.h"
13 #include "ui/views/controls/webview/webview.h" 14 #include "ui/views/controls/webview/webview.h"
14 15
15 InstantPreviewControllerViews::InstantPreviewControllerViews( 16 InstantPreviewControllerViews::InstantPreviewControllerViews(
16 Browser* browser, 17 Browser* browser,
17 ContentsContainer* contents) 18 ContentsContainer* contents)
18 : InstantPreviewController(browser), 19 : InstantPreviewController(browser),
19 contents_(contents) { 20 contents_(contents) {
20 } 21 }
21 22
22 InstantPreviewControllerViews::~InstantPreviewControllerViews() { 23 InstantPreviewControllerViews::~InstantPreviewControllerViews() {
(...skipping 21 matching lines...) Expand all
44 preview_->SetWebContents(NULL); 45 preview_->SetWebContents(NULL);
45 contents_->SetPreview(NULL, NULL, model.mode(), 100, INSTANT_SIZE_PERCENT, 46 contents_->SetPreview(NULL, NULL, model.mode(), 100, INSTANT_SIZE_PERCENT,
46 false); 47 false);
47 preview_.reset(); 48 preview_.reset();
48 } 49 }
49 50
50 browser_->MaybeUpdateBookmarkBarStateForInstantPreview(model.mode()); 51 browser_->MaybeUpdateBookmarkBarStateForInstantPreview(model.mode());
51 52
52 // If an instant preview is added during an immersive mode reveal, the reveal 53 // If an instant preview is added during an immersive mode reveal, the reveal
53 // view needs to stay on top. 54 // view needs to stay on top.
55 // Notify infobar container of change in preview state.
54 if (preview_) { 56 if (preview_) {
55 BrowserView* browser_view = BrowserView::GetBrowserViewForBrowser(browser_); 57 BrowserView* browser_view = BrowserView::GetBrowserViewForBrowser(browser_);
56 if (browser_view) 58 if (browser_view) {
57 browser_view->MaybeStackImmersiveRevealAtTop(); 59 browser_view->MaybeStackImmersiveRevealAtTop();
60 browser_view->infobar_container()->PreviewStateChanged(model);
61 }
58 } 62 }
59 } 63 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/frame/contents_container.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698