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

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

Issue 10915217: Hook up SetInstantPreviewHeight for ChromeOS. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Move hidden notification, too. Created 8 years, 3 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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/browser_view.h" 5 #include "chrome/browser/ui/views/frame/browser_view.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/auto_reset.h" 9 #include "base/auto_reset.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 1333 matching lines...) Expand 10 before | Expand all | Expand 10 after
1344 } 1344 }
1345 } 1345 }
1346 1346
1347 void BrowserView::Paste() { 1347 void BrowserView::Paste() {
1348 if (!DoCutCopyPaste(&content::RenderWidgetHost::Paste)) { 1348 if (!DoCutCopyPaste(&content::RenderWidgetHost::Paste)) {
1349 ui_controls::SendKeyPress(GetNativeWindow(), ui::VKEY_V, 1349 ui_controls::SendKeyPress(GetNativeWindow(), ui::VKEY_V,
1350 true, false, false, false); 1350 true, false, false, false);
1351 } 1351 }
1352 } 1352 }
1353 1353
1354 void BrowserView::ShowInstant(TabContents* preview) { 1354 void BrowserView::ShowInstant(TabContents* preview,
1355 int height,
1356 InstantSizeUnits units) {
1355 if (!preview_container_) { 1357 if (!preview_container_) {
1356 preview_container_ = new views::WebView(browser_->profile()); 1358 preview_container_ = new views::WebView(browser_->profile());
1357 preview_container_->set_id(VIEW_ID_TAB_CONTAINER); 1359 preview_container_->set_id(VIEW_ID_TAB_CONTAINER);
1358 } 1360 }
1359 contents_->SetPreview(preview_container_, preview->web_contents()); 1361 contents_->SetPreview(preview_container_, preview->web_contents(),
1362 height, units);
1360 preview_container_->SetWebContents(preview->web_contents()); 1363 preview_container_->SetWebContents(preview->web_contents());
1361 #if defined(USE_AURA) 1364 #if defined(USE_AURA)
1362 if (search_view_controller_.get()) 1365 if (search_view_controller_.get())
1363 search_view_controller_->InstantReady(); 1366 search_view_controller_->InstantReady();
1364 #endif 1367 #endif
1365 RestackLocationBarContainer(); 1368 RestackLocationBarContainer();
1366 } 1369 }
1367 1370
1368 void BrowserView::HideInstant() { 1371 void BrowserView::HideInstant() {
1369 if (!preview_container_) 1372 if (!preview_container_)
1370 return; 1373 return;
1371 1374
1372 // The contents must be changed before SetPreview is invoked. 1375 // The contents must be changed before SetPreview is invoked.
1373 preview_container_->SetWebContents(NULL); 1376 preview_container_->SetWebContents(NULL);
1374 contents_->SetPreview(NULL, NULL); 1377 contents_->SetPreview(NULL, NULL, 100, INSTANT_SIZE_PERCENT);
1375 delete preview_container_; 1378 delete preview_container_;
1376 preview_container_ = NULL; 1379 preview_container_ = NULL;
1377 } 1380 }
1378 1381
1379 gfx::Rect BrowserView::GetInstantBounds() { 1382 gfx::Rect BrowserView::GetInstantBounds() {
1380 return contents_->GetPreviewBounds(); 1383 return contents_->GetPreviewBounds();
1381 } 1384 }
1382 1385
1383 bool BrowserView::IsInstantTabShowing() { 1386 bool BrowserView::IsInstantTabShowing() {
1384 return preview_container_ != NULL; 1387 return preview_container_ != NULL;
(...skipping 1254 matching lines...) Expand 10 before | Expand all | Expand 10 after
2639 2642
2640 Browser* modal_browser = 2643 Browser* modal_browser =
2641 browser::FindBrowserWithWebContents(active_dialog->web_contents()); 2644 browser::FindBrowserWithWebContents(active_dialog->web_contents());
2642 if (modal_browser && (browser_ != modal_browser)) { 2645 if (modal_browser && (browser_ != modal_browser)) {
2643 modal_browser->window()->FlashFrame(true); 2646 modal_browser->window()->FlashFrame(true);
2644 modal_browser->window()->Activate(); 2647 modal_browser->window()->Activate();
2645 } 2648 }
2646 2649
2647 AppModalDialogQueue::GetInstance()->ActivateModalDialog(); 2650 AppModalDialogQueue::GetInstance()->ActivateModalDialog();
2648 } 2651 }
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