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

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

Issue 12631008: alternate ntp: implement Show/HideBars API to reduce jank when showing/hiding bars (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: revert obsolete changes in search.h/cc 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
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_overlay_controller_views.h" 5 #include "chrome/browser/ui/views/frame/instant_overlay_controller_views.h"
6 6
7 #include "chrome/browser/instant/instant_overlay_model.h" 7 #include "chrome/browser/instant/instant_overlay_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/search/search_model.h"
11 #include "chrome/browser/ui/search/search_tab_helper.h"
12 #include "chrome/browser/ui/tabs/tab_strip_model.h"
10 #include "chrome/browser/ui/view_ids.h" 13 #include "chrome/browser/ui/view_ids.h"
11 #include "chrome/browser/ui/views/frame/browser_view.h" 14 #include "chrome/browser/ui/views/frame/browser_view.h"
12 #include "chrome/browser/ui/views/frame/contents_container.h" 15 #include "chrome/browser/ui/views/frame/contents_container.h"
13 #include "chrome/browser/ui/views/infobars/infobar_container_view.h" 16 #include "chrome/browser/ui/views/infobars/infobar_container_view.h"
14 #include "ui/views/controls/webview/webview.h" 17 #include "ui/views/controls/webview/webview.h"
15 18
16 InstantOverlayControllerViews::InstantOverlayControllerViews( 19 InstantOverlayControllerViews::InstantOverlayControllerViews(
17 Browser* browser, 20 Browser* browser,
18 ContentsContainer* contents) 21 ContentsContainer* contents)
19 : InstantOverlayController(browser), 22 : InstantOverlayController(browser),
(...skipping 19 matching lines...) Expand all
39 contents_->SetOverlay(overlay_.get(), web_contents, model.height(), 42 contents_->SetOverlay(overlay_.get(), web_contents, model.height(),
40 model.height_units(), draw_drop_shadow); 43 model.height_units(), draw_drop_shadow);
41 overlay_->SetWebContents(web_contents); 44 overlay_->SetWebContents(web_contents);
42 } else if (overlay_) { 45 } else if (overlay_) {
43 // Hide the overlay. SetWebContents() must happen before SetOverlay(). 46 // Hide the overlay. SetWebContents() must happen before SetOverlay().
44 overlay_->SetWebContents(NULL); 47 overlay_->SetWebContents(NULL);
45 contents_->SetOverlay(NULL, NULL, 100, INSTANT_SIZE_PERCENT, false); 48 contents_->SetOverlay(NULL, NULL, 100, INSTANT_SIZE_PERCENT, false);
46 overlay_.reset(); 49 overlay_.reset();
47 } 50 }
48 51
49 browser_->MaybeUpdateBookmarkBarStateForInstantOverlay(model.mode()); 52 // Set top bars (bookmark and info bars) visibility for current tab via
53 // |SearchTabHelper| of current active web contents: top bars are hidden if
54 // there's overlay.
55 chrome::search::SearchTabHelper* search_tab_helper =
56 chrome::search::SearchTabHelper::FromWebContents(
57 browser_->tab_strip_model()->GetActiveWebContents());
58 if (search_tab_helper)
59 search_tab_helper->model()->SetTopBarsVisible(!overlay_);
50 60
51 // If an Instant overlay is added during an immersive mode reveal, the reveal 61 // If an Instant overlay is added during an immersive mode reveal, the reveal
52 // view needs to stay on top. 62 // view needs to stay on top.
53 // Notify infobar container of change in overlay state.
54 if (overlay_) { 63 if (overlay_) {
55 BrowserView* browser_view = BrowserView::GetBrowserViewForBrowser(browser_); 64 BrowserView* browser_view = BrowserView::GetBrowserViewForBrowser(browser_);
56 if (browser_view) { 65 if (browser_view)
57 browser_view->MaybeStackImmersiveRevealAtTop(); 66 browser_view->MaybeStackImmersiveRevealAtTop();
58 browser_view->infobar_container()->OverlayStateChanged(model);
59 }
60 } 67 }
61 } 68 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698