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

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

Issue 4932001: Makes the current page dim out when transitioning to instant preview. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Cleanup Created 10 years, 1 month 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 (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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/views/frame/browser_view.h" 5 #include "chrome/browser/views/frame/browser_view.h"
6 6
7 #if defined(OS_LINUX) 7 #if defined(OS_LINUX)
8 #include <gtk/gtk.h> 8 #include <gtk/gtk.h>
9 #endif 9 #endif
10 10
(...skipping 1344 matching lines...) Expand 10 before | Expand all | Expand 10 after
1355 ui_controls::SendKeyPress(GetNativeHandle(), app::VKEY_V, 1355 ui_controls::SendKeyPress(GetNativeHandle(), app::VKEY_V,
1356 false, false, false, true); 1356 false, false, false, true);
1357 } 1357 }
1358 #endif 1358 #endif
1359 1359
1360 void BrowserView::ToggleTabStripMode() { 1360 void BrowserView::ToggleTabStripMode() {
1361 InitTabStrip(browser_->tabstrip_model()); 1361 InitTabStrip(browser_->tabstrip_model());
1362 frame_->TabStripDisplayModeChanged(); 1362 frame_->TabStripDisplayModeChanged();
1363 } 1363 }
1364 1364
1365 void BrowserView::PrepareForInstant() {
1366 contents_->FadeActiveContents();
1367 }
1368
1365 void BrowserView::ShowInstant(TabContents* preview_contents) { 1369 void BrowserView::ShowInstant(TabContents* preview_contents) {
1366 if (!preview_container_) 1370 if (!preview_container_)
1367 preview_container_ = new TabContentsContainer(); 1371 preview_container_ = new TabContentsContainer();
1368 contents_->SetPreview(preview_container_, preview_contents); 1372 contents_->SetPreview(preview_container_, preview_contents);
1369 preview_container_->ChangeTabContents(preview_contents); 1373 preview_container_->ChangeTabContents(preview_contents);
1374
1375 #if defined(OS_WIN)
1376 // Removing the fade is instant (on windows). We need to force the preview to
1377 // draw, otherwise the current page flickers before the new page appears.
1378 RedrawWindow(preview_contents->view()->GetContentNativeView(), NULL, NULL,
1379 RDW_INVALIDATE | RDW_UPDATENOW | RDW_NOCHILDREN);
1380 #endif
1381
1382 contents_->RemoveFade();
1370 } 1383 }
1371 1384
1372 void BrowserView::HideInstant() { 1385 void BrowserView::HideInstant() {
1373 if (!preview_container_) 1386 if (!preview_container_)
1374 return; 1387 return;
1375 1388
1376 // The contents must be changed before SetPreview is invoked. 1389 // The contents must be changed before SetPreview is invoked.
1377 preview_container_->ChangeTabContents(NULL); 1390 preview_container_->ChangeTabContents(NULL);
1378 contents_->SetPreview(NULL, NULL); 1391 contents_->SetPreview(NULL, NULL);
1379 delete preview_container_; 1392 delete preview_container_;
1380 preview_container_ = NULL; 1393 preview_container_ = NULL;
1394 contents_->RemoveFade();
1381 } 1395 }
1382 1396
1383 gfx::Rect BrowserView::GetInstantBounds() { 1397 gfx::Rect BrowserView::GetInstantBounds() {
1384 return contents_->GetPreviewBounds(); 1398 return contents_->GetPreviewBounds();
1385 } 1399 }
1386 1400
1387 /////////////////////////////////////////////////////////////////////////////// 1401 ///////////////////////////////////////////////////////////////////////////////
1388 // BrowserView, BrowserWindowTesting implementation: 1402 // BrowserView, BrowserWindowTesting implementation:
1389 1403
1390 BookmarkBarView* BrowserView::GetBookmarkBarView() const { 1404 BookmarkBarView* BrowserView::GetBookmarkBarView() const {
(...skipping 1072 matching lines...) Expand 10 before | Expand all | Expand 10 after
2463 SetAccessibleName(l10n_util::GetString(IDS_PRODUCT_NAME)); 2477 SetAccessibleName(l10n_util::GetString(IDS_PRODUCT_NAME));
2464 2478
2465 return view; 2479 return view;
2466 } 2480 }
2467 #endif 2481 #endif
2468 2482
2469 // static 2483 // static
2470 FindBar* BrowserWindow::CreateFindBar(Browser* browser) { 2484 FindBar* BrowserWindow::CreateFindBar(Browser* browser) {
2471 return browser::CreateFindBar(static_cast<BrowserView*>(browser->window())); 2485 return browser::CreateFindBar(static_cast<BrowserView*>(browser->window()));
2472 } 2486 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/frame/browser_view.h ('k') | chrome/browser/ui/views/frame/contents_container.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698