| OLD | NEW |
| 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 <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 #include "chrome/browser/ui/window_sizer/window_sizer.h" | 96 #include "chrome/browser/ui/window_sizer/window_sizer.h" |
| 97 #include "chrome/common/chrome_switches.h" | 97 #include "chrome/common/chrome_switches.h" |
| 98 #include "chrome/common/extensions/command.h" | 98 #include "chrome/common/extensions/command.h" |
| 99 #include "chrome/common/features.h" | 99 #include "chrome/common/features.h" |
| 100 #include "chrome/common/pref_names.h" | 100 #include "chrome/common/pref_names.h" |
| 101 #include "chrome/common/url_constants.h" | 101 #include "chrome/common/url_constants.h" |
| 102 #include "chrome/grit/chromium_strings.h" | 102 #include "chrome/grit/chromium_strings.h" |
| 103 #include "chrome/grit/generated_resources.h" | 103 #include "chrome/grit/generated_resources.h" |
| 104 #include "chrome/grit/locale_settings.h" | 104 #include "chrome/grit/locale_settings.h" |
| 105 #include "chrome/grit/theme_resources.h" | 105 #include "chrome/grit/theme_resources.h" |
| 106 #include "components/app_modal/app_modal_dialog.h" | |
| 107 #include "components/app_modal/app_modal_dialog_queue.h" | 106 #include "components/app_modal/app_modal_dialog_queue.h" |
| 107 #include "components/app_modal/javascript_app_modal_dialog.h" |
| 108 #include "components/app_modal/native_app_modal_dialog.h" | 108 #include "components/app_modal/native_app_modal_dialog.h" |
| 109 #include "components/omnibox/browser/omnibox_popup_model.h" | 109 #include "components/omnibox/browser/omnibox_popup_model.h" |
| 110 #include "components/omnibox/browser/omnibox_popup_view.h" | 110 #include "components/omnibox/browser/omnibox_popup_view.h" |
| 111 #include "components/omnibox/browser/omnibox_view.h" | 111 #include "components/omnibox/browser/omnibox_view.h" |
| 112 #include "components/prefs/pref_service.h" | 112 #include "components/prefs/pref_service.h" |
| 113 #include "components/sessions/core/tab_restore_service.h" | 113 #include "components/sessions/core/tab_restore_service.h" |
| 114 #include "components/signin/core/common/profile_management_switches.h" | 114 #include "components/signin/core/common/profile_management_switches.h" |
| 115 #include "components/translate/core/browser/language_state.h" | 115 #include "components/translate/core/browser/language_state.h" |
| 116 #include "content/public/browser/download_manager.h" | 116 #include "content/public/browser/download_manager.h" |
| 117 #include "content/public/browser/keyboard_event_processing_result.h" | 117 #include "content/public/browser/keyboard_event_processing_result.h" |
| (...skipping 2472 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2590 if (!rwhv || !rwhv->HasFocus()) | 2590 if (!rwhv || !rwhv->HasFocus()) |
| 2591 return false; | 2591 return false; |
| 2592 // Calling |method| rather than using a fake key event is important since a | 2592 // Calling |method| rather than using a fake key event is important since a |
| 2593 // fake event might be consumed by the web content. | 2593 // fake event might be consumed by the web content. |
| 2594 (contents->*method)(); | 2594 (contents->*method)(); |
| 2595 return true; | 2595 return true; |
| 2596 } | 2596 } |
| 2597 | 2597 |
| 2598 void BrowserView::ActivateAppModalDialog() const { | 2598 void BrowserView::ActivateAppModalDialog() const { |
| 2599 // If another browser is app modal, flash and activate the modal browser. | 2599 // If another browser is app modal, flash and activate the modal browser. |
| 2600 app_modal::AppModalDialog* active_dialog = | 2600 app_modal::JavaScriptAppModalDialog* active_dialog = |
| 2601 app_modal::AppModalDialogQueue::GetInstance()->active_dialog(); | 2601 app_modal::AppModalDialogQueue::GetInstance()->active_dialog(); |
| 2602 if (!active_dialog) | 2602 if (!active_dialog) |
| 2603 return; | 2603 return; |
| 2604 | 2604 |
| 2605 Browser* modal_browser = | 2605 Browser* modal_browser = |
| 2606 chrome::FindBrowserWithWebContents(active_dialog->web_contents()); | 2606 chrome::FindBrowserWithWebContents(active_dialog->web_contents()); |
| 2607 if (modal_browser && (browser_.get() != modal_browser)) { | 2607 if (modal_browser && (browser_.get() != modal_browser)) { |
| 2608 modal_browser->window()->FlashFrame(true); | 2608 modal_browser->window()->FlashFrame(true); |
| 2609 modal_browser->window()->Activate(); | 2609 modal_browser->window()->Activate(); |
| 2610 } | 2610 } |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2693 } | 2693 } |
| 2694 | 2694 |
| 2695 extensions::ActiveTabPermissionGranter* | 2695 extensions::ActiveTabPermissionGranter* |
| 2696 BrowserView::GetActiveTabPermissionGranter() { | 2696 BrowserView::GetActiveTabPermissionGranter() { |
| 2697 content::WebContents* web_contents = GetActiveWebContents(); | 2697 content::WebContents* web_contents = GetActiveWebContents(); |
| 2698 if (!web_contents) | 2698 if (!web_contents) |
| 2699 return nullptr; | 2699 return nullptr; |
| 2700 return extensions::TabHelper::FromWebContents(web_contents) | 2700 return extensions::TabHelper::FromWebContents(web_contents) |
| 2701 ->active_tab_permission_granter(); | 2701 ->active_tab_permission_granter(); |
| 2702 } | 2702 } |
| OLD | NEW |