OLD | NEW |
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 "base/command_line.h" | 5 #include "base/command_line.h" |
6 #include "base/prefs/pref_service.h" | 6 #include "base/prefs/pref_service.h" |
7 #include "base/utf_string_conversions.h" | 7 #include "base/utf_string_conversions.h" |
8 #include "base/values.h" | 8 #include "base/values.h" |
9 #include "chrome/browser/common/cancelable_request.h" | 9 #include "chrome/browser/common/cancelable_request.h" |
10 #include "chrome/browser/history/history_service_factory.h" | 10 #include "chrome/browser/history/history_service_factory.h" |
11 #include "chrome/browser/infobars/confirm_infobar_delegate.h" | 11 #include "chrome/browser/infobars/confirm_infobar_delegate.h" |
12 #include "chrome/browser/infobars/infobar.h" | 12 #include "chrome/browser/infobars/infobar.h" |
13 #include "chrome/browser/infobars/infobar_service.h" | 13 #include "chrome/browser/infobars/infobar_service.h" |
14 #include "chrome/browser/managed_mode/managed_mode.h" | 14 #include "chrome/browser/managed_mode/managed_mode.h" |
15 #include "chrome/browser/managed_mode/managed_mode_interstitial.h" | 15 #include "chrome/browser/managed_mode/managed_mode_interstitial.h" |
16 #include "chrome/browser/managed_mode/managed_mode_navigation_observer.h" | 16 #include "chrome/browser/managed_mode/managed_mode_navigation_observer.h" |
17 #include "chrome/browser/managed_mode/managed_user_service.h" | 17 #include "chrome/browser/managed_mode/managed_user_service.h" |
18 #include "chrome/browser/managed_mode/managed_user_service_factory.h" | 18 #include "chrome/browser/managed_mode/managed_user_service_factory.h" |
19 #include "chrome/browser/policy/managed_mode_policy_provider.h" | 19 #include "chrome/browser/policy/managed_mode_policy_provider.h" |
20 #include "chrome/browser/policy/profile_policy_connector.h" | 20 #include "chrome/browser/policy/profile_policy_connector.h" |
21 #include "chrome/browser/policy/profile_policy_connector_factory.h" | 21 #include "chrome/browser/policy/profile_policy_connector_factory.h" |
22 #include "chrome/browser/profiles/profile.h" | 22 #include "chrome/browser/profiles/profile.h" |
23 #include "chrome/browser/ui/browser.h" | 23 #include "chrome/browser/ui/browser.h" |
24 #include "chrome/browser/ui/browser_navigator.h" | 24 #include "chrome/browser/ui/browser_navigator.h" |
25 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 25 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
26 #include "chrome/browser/ui/web_contents_modal_dialog_manager.h" | |
27 #include "chrome/common/chrome_notification_types.h" | 26 #include "chrome/common/chrome_notification_types.h" |
28 #include "chrome/common/chrome_switches.h" | 27 #include "chrome/common/chrome_switches.h" |
29 #include "chrome/common/pref_names.h" | 28 #include "chrome/common/pref_names.h" |
30 #include "chrome/test/base/in_process_browser_test.h" | 29 #include "chrome/test/base/in_process_browser_test.h" |
31 #include "chrome/test/base/ui_test_utils.h" | 30 #include "chrome/test/base/ui_test_utils.h" |
32 #include "components/user_prefs/pref_registry_syncable.h" | 31 #include "components/user_prefs/pref_registry_syncable.h" |
| 32 #include "components/web_modal/web_contents_modal_dialog_manager.h" |
33 #include "content/public/browser/interstitial_page.h" | 33 #include "content/public/browser/interstitial_page.h" |
34 #include "content/public/browser/navigation_controller.h" | 34 #include "content/public/browser/navigation_controller.h" |
35 #include "content/public/browser/navigation_entry.h" | 35 #include "content/public/browser/navigation_entry.h" |
36 #include "content/public/browser/notification_service.h" | 36 #include "content/public/browser/notification_service.h" |
37 #include "content/public/browser/web_contents.h" | 37 #include "content/public/browser/web_contents.h" |
38 #include "content/public/browser/web_contents_observer.h" | 38 #include "content/public/browser/web_contents_observer.h" |
39 #include "grit/generated_resources.h" | 39 #include "grit/generated_resources.h" |
40 #include "policy/policy_constants.h" | 40 #include "policy/policy_constants.h" |
41 #include "ui/base/l10n/l10n_util.h" | 41 #include "ui/base/l10n/l10n_util.h" |
42 | 42 |
43 using content::InterstitialPage; | 43 using content::InterstitialPage; |
44 using content::NavigationController; | 44 using content::NavigationController; |
45 using content::NavigationEntry; | 45 using content::NavigationEntry; |
46 using content::WebContents; | 46 using content::WebContents; |
| 47 using web_modal::WebContentsModalDialogManager; |
47 | 48 |
48 namespace { | 49 namespace { |
49 | 50 |
50 class InterstitialObserver : public content::WebContentsObserver { | 51 class InterstitialObserver : public content::WebContentsObserver { |
51 public: | 52 public: |
52 InterstitialObserver(content::WebContents* web_contents, | 53 InterstitialObserver(content::WebContents* web_contents, |
53 const base::Closure& callback) | 54 const base::Closure& callback) |
54 : WebContentsObserver(web_contents), | 55 : WebContentsObserver(web_contents), |
55 callback_(callback) { | 56 callback_(callback) { |
56 } | 57 } |
(...skipping 661 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
718 // Simulate the click on the "preview" button. | 719 // Simulate the click on the "preview" button. |
719 delegate->CommandReceived("\"preview\""); | 720 delegate->CommandReceived("\"preview\""); |
720 WebContentsModalDialogManager* web_contents_modal_dialog_manager = | 721 WebContentsModalDialogManager* web_contents_modal_dialog_manager = |
721 WebContentsModalDialogManager::FromWebContents(tab); | 722 WebContentsModalDialogManager::FromWebContents(tab); |
722 EXPECT_TRUE(web_contents_modal_dialog_manager->IsShowingDialog()); | 723 EXPECT_TRUE(web_contents_modal_dialog_manager->IsShowingDialog()); |
723 } | 724 } |
724 | 725 |
725 #endif // OS_CHROMEOS | 726 #endif // OS_CHROMEOS |
726 | 727 |
727 } // namespace | 728 } // namespace |
OLD | NEW |