OLD | NEW |
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 1347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1358 #if defined(OS_WIN) | 1358 #if defined(OS_WIN) |
1359 // Removing the fade is instant (on windows). We need to force the preview to | 1359 // Removing the fade is instant (on windows). We need to force the preview to |
1360 // draw, otherwise the current page flickers before the new page appears. | 1360 // draw, otherwise the current page flickers before the new page appears. |
1361 RedrawWindow(preview_contents->view()->GetContentNativeView(), NULL, NULL, | 1361 RedrawWindow(preview_contents->view()->GetContentNativeView(), NULL, NULL, |
1362 RDW_INVALIDATE | RDW_UPDATENOW | RDW_NOCHILDREN); | 1362 RDW_INVALIDATE | RDW_UPDATENOW | RDW_NOCHILDREN); |
1363 #endif | 1363 #endif |
1364 | 1364 |
1365 contents_->RemoveFade(); | 1365 contents_->RemoveFade(); |
1366 } | 1366 } |
1367 | 1367 |
1368 void BrowserView::HideInstant() { | 1368 void BrowserView::HideInstant(bool instant_is_active) { |
1369 if (!preview_container_) { | 1369 if (instant_is_active) |
| 1370 contents_->ShowFade(); |
| 1371 else |
1370 contents_->RemoveFade(); | 1372 contents_->RemoveFade(); |
| 1373 |
| 1374 if (!preview_container_) |
1371 return; | 1375 return; |
1372 } | |
1373 | 1376 |
1374 // The contents must be changed before SetPreview is invoked. | 1377 // The contents must be changed before SetPreview is invoked. |
1375 preview_container_->ChangeTabContents(NULL); | 1378 preview_container_->ChangeTabContents(NULL); |
1376 contents_->SetPreview(NULL, NULL); | 1379 contents_->SetPreview(NULL, NULL); |
1377 delete preview_container_; | 1380 delete preview_container_; |
1378 preview_container_ = NULL; | 1381 preview_container_ = NULL; |
1379 contents_->RemoveFade(); | |
1380 } | 1382 } |
1381 | 1383 |
1382 gfx::Rect BrowserView::GetInstantBounds() { | 1384 gfx::Rect BrowserView::GetInstantBounds() { |
1383 return contents_->GetPreviewBounds(); | 1385 return contents_->GetPreviewBounds(); |
1384 } | 1386 } |
1385 | 1387 |
1386 /////////////////////////////////////////////////////////////////////////////// | 1388 /////////////////////////////////////////////////////////////////////////////// |
1387 // BrowserView, BrowserWindowTesting implementation: | 1389 // BrowserView, BrowserWindowTesting implementation: |
1388 | 1390 |
1389 BookmarkBarView* BrowserView::GetBookmarkBarView() const { | 1391 BookmarkBarView* BrowserView::GetBookmarkBarView() const { |
(...skipping 1108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2498 SetAccessibleName(l10n_util::GetString(IDS_PRODUCT_NAME)); | 2500 SetAccessibleName(l10n_util::GetString(IDS_PRODUCT_NAME)); |
2499 | 2501 |
2500 return view; | 2502 return view; |
2501 } | 2503 } |
2502 #endif | 2504 #endif |
2503 | 2505 |
2504 // static | 2506 // static |
2505 FindBar* BrowserWindow::CreateFindBar(Browser* browser) { | 2507 FindBar* BrowserWindow::CreateFindBar(Browser* browser) { |
2506 return browser::CreateFindBar(static_cast<BrowserView*>(browser->window())); | 2508 return browser::CreateFindBar(static_cast<BrowserView*>(browser->window())); |
2507 } | 2509 } |
OLD | NEW |