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

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

Issue 1149263003: Add user_gesture param to BaseWindow::Activate Base URL: https://chromium.googlesource.com/chromium/src.git@ug2_WebContentsDelegate_ActivateContents
Patch Set: Update callers Created 5 years, 7 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
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/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 703 matching lines...) Expand 10 before | Expand all | Expand 10 after
714 714
715 void BrowserView::SetBounds(const gfx::Rect& bounds) { 715 void BrowserView::SetBounds(const gfx::Rect& bounds) {
716 ExitFullscreen(); 716 ExitFullscreen();
717 GetWidget()->SetBounds(bounds); 717 GetWidget()->SetBounds(bounds);
718 } 718 }
719 719
720 void BrowserView::Close() { 720 void BrowserView::Close() {
721 frame_->Close(); 721 frame_->Close();
722 } 722 }
723 723
724 void BrowserView::Activate() { 724 void BrowserView::Activate(bool user_gesture) {
725 // TODO(johnme): Pass user_gesture to Activate.
725 frame_->Activate(); 726 frame_->Activate();
726 } 727 }
727 728
728 void BrowserView::Deactivate() { 729 void BrowserView::Deactivate() {
729 frame_->Deactivate(); 730 frame_->Deactivate();
730 } 731 }
731 732
732 bool BrowserView::IsActive() const { 733 bool BrowserView::IsActive() const {
733 return frame_->IsActive(); 734 return frame_->IsActive();
734 } 735 }
(...skipping 1813 matching lines...) Expand 10 before | Expand all | Expand 10 after
2548 // If another browser is app modal, flash and activate the modal browser. 2549 // If another browser is app modal, flash and activate the modal browser.
2549 app_modal::AppModalDialog* active_dialog = 2550 app_modal::AppModalDialog* active_dialog =
2550 app_modal::AppModalDialogQueue::GetInstance()->active_dialog(); 2551 app_modal::AppModalDialogQueue::GetInstance()->active_dialog();
2551 if (!active_dialog) 2552 if (!active_dialog)
2552 return; 2553 return;
2553 2554
2554 Browser* modal_browser = 2555 Browser* modal_browser =
2555 chrome::FindBrowserWithWebContents(active_dialog->web_contents()); 2556 chrome::FindBrowserWithWebContents(active_dialog->web_contents());
2556 if (modal_browser && (browser_ != modal_browser)) { 2557 if (modal_browser && (browser_ != modal_browser)) {
2557 modal_browser->window()->FlashFrame(true); 2558 modal_browser->window()->FlashFrame(true);
2558 modal_browser->window()->Activate(); 2559 // TODO(johnme): Can we sometimes be certain this was for a user gesture?
2560 modal_browser->window()->Activate(false /* user_gesture */);
2559 } 2561 }
2560 2562
2561 app_modal::AppModalDialogQueue::GetInstance()->ActivateModalDialog(); 2563 app_modal::AppModalDialogQueue::GetInstance()->ActivateModalDialog();
2562 } 2564 }
2563 2565
2564 int BrowserView::GetMaxTopInfoBarArrowHeight() { 2566 int BrowserView::GetMaxTopInfoBarArrowHeight() {
2565 int top_arrow_height = 0; 2567 int top_arrow_height = 0;
2566 // Only show the arrows when not in fullscreen and when there's no omnibox 2568 // Only show the arrows when not in fullscreen and when there's no omnibox
2567 // popup. 2569 // popup.
2568 if (!IsFullscreen() && 2570 if (!IsFullscreen() &&
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
2608 return immersive_mode_controller()->IsEnabled(); 2610 return immersive_mode_controller()->IsEnabled();
2609 } 2611 }
2610 2612
2611 views::Widget* BrowserView::GetBubbleAssociatedWidget() { 2613 views::Widget* BrowserView::GetBubbleAssociatedWidget() {
2612 return GetWidget(); 2614 return GetWidget();
2613 } 2615 }
2614 2616
2615 gfx::Rect BrowserView::GetTopContainerBoundsInScreen() { 2617 gfx::Rect BrowserView::GetTopContainerBoundsInScreen() {
2616 return top_container_->GetBoundsInScreen(); 2618 return top_container_->GetBoundsInScreen();
2617 } 2619 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698