| 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 <algorithm> | 5 #include <algorithm> |
| 6 #include <string> | 6 #include <string> |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 154 #include "ui/base/resource/resource_bundle.h" | 154 #include "ui/base/resource/resource_bundle.h" |
| 155 #include "url/gurl.h" | 155 #include "url/gurl.h" |
| 156 | 156 |
| 157 #if defined(OS_CHROMEOS) | 157 #if defined(OS_CHROMEOS) |
| 158 #include "ash/accelerators/accelerator_controller.h" | 158 #include "ash/accelerators/accelerator_controller.h" |
| 159 #include "ash/accelerators/accelerator_table.h" | 159 #include "ash/accelerators/accelerator_table.h" |
| 160 #include "ash/shell.h" | 160 #include "ash/shell.h" |
| 161 #include "chrome/browser/chromeos/accessibility/accessibility_manager.h" | 161 #include "chrome/browser/chromeos/accessibility/accessibility_manager.h" |
| 162 #include "chrome/browser/chromeos/accessibility/magnification_manager.h" | 162 #include "chrome/browser/chromeos/accessibility/magnification_manager.h" |
| 163 #include "chrome/browser/profiles/profile_manager.h" | 163 #include "chrome/browser/profiles/profile_manager.h" |
| 164 #include "chrome/browser/ui/ash/screenshot_taker.h" | 164 #include "chrome/browser/ui/ash/chrome_screenshot_taker.h" |
| 165 #include "chromeos/audio/cras_audio_handler.h" | 165 #include "chromeos/audio/cras_audio_handler.h" |
| 166 #include "components/screenshot_taker/screenshot_taker.h" |
| 166 #include "ui/chromeos/accessibility_types.h" | 167 #include "ui/chromeos/accessibility_types.h" |
| 167 #include "ui/keyboard/keyboard_util.h" | 168 #include "ui/keyboard/keyboard_util.h" |
| 168 #endif | 169 #endif |
| 169 | 170 |
| 170 #if !defined(OS_MACOSX) | 171 #if !defined(OS_MACOSX) |
| 171 #include "base/basictypes.h" | 172 #include "base/basictypes.h" |
| 172 #include "base/compiler_specific.h" | 173 #include "base/compiler_specific.h" |
| 173 #include "chrome/browser/ui/extensions/application_launch.h" | 174 #include "chrome/browser/ui/extensions/application_launch.h" |
| 174 #include "extensions/browser/app_window/app_window.h" | 175 #include "extensions/browser/app_window/app_window.h" |
| 175 #include "extensions/browser/app_window/app_window_registry.h" | 176 #include "extensions/browser/app_window/app_window_registry.h" |
| (...skipping 485 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 661 base::Bind(base::DoNothing), | 662 base::Bind(base::DoNothing), |
| 662 base::MessageLoop::QuitClosure()); | 663 base::MessageLoop::QuitClosure()); |
| 663 } | 664 } |
| 664 | 665 |
| 665 virtual ~QuitMessageLoopAfterScreenshot() {} | 666 virtual ~QuitMessageLoopAfterScreenshot() {} |
| 666 }; | 667 }; |
| 667 | 668 |
| 668 void TestScreenshotFile(bool enabled) { | 669 void TestScreenshotFile(bool enabled) { |
| 669 // AddObserver is an ash-specific method, so just replace the screenshot | 670 // AddObserver is an ash-specific method, so just replace the screenshot |
| 670 // taker with one we've created here. | 671 // taker with one we've created here. |
| 671 scoped_ptr<ScreenshotTaker> screenshot_taker(new ScreenshotTaker); | 672 scoped_ptr<ChromeScreenshotTaker> chrome_screenshot_taker( |
| 673 new ChromeScreenshotTaker); |
| 672 // ScreenshotTaker doesn't own this observer, so the observer's lifetime | 674 // ScreenshotTaker doesn't own this observer, so the observer's lifetime |
| 673 // is tied to the test instead. | 675 // is tied to the test instead. |
| 674 screenshot_taker->AddObserver(&observer_); | 676 chrome_screenshot_taker->screenshot_taker()->AddObserver(&observer_); |
| 675 ash::Shell::GetInstance()->accelerator_controller()->SetScreenshotDelegate( | 677 ash::Shell::GetInstance()->accelerator_controller()->SetScreenshotDelegate( |
| 676 screenshot_taker.Pass()); | 678 chrome_screenshot_taker.Pass()); |
| 677 | 679 |
| 678 SetScreenshotPolicy(enabled); | 680 SetScreenshotPolicy(enabled); |
| 679 ash::Shell::GetInstance()->accelerator_controller()->PerformAction( | 681 ash::Shell::GetInstance()->accelerator_controller()->PerformAction( |
| 680 ash::TAKE_SCREENSHOT, ui::Accelerator()); | 682 ash::TAKE_SCREENSHOT, ui::Accelerator()); |
| 681 | 683 |
| 682 content::RunMessageLoop(); | 684 content::RunMessageLoop(); |
| 683 } | 685 } |
| 684 #endif | 686 #endif |
| 685 | 687 |
| 686 ExtensionService* extension_service() { | 688 ExtensionService* extension_service() { |
| (...skipping 2739 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3426 EXPECT_TRUE(content::ExecuteScriptAndExtractBool( | 3428 EXPECT_TRUE(content::ExecuteScriptAndExtractBool( |
| 3427 browser2->tab_strip_model()->GetActiveWebContents(), | 3429 browser2->tab_strip_model()->GetActiveWebContents(), |
| 3428 "domAutomationController.send(window.showModalDialog !== undefined);", | 3430 "domAutomationController.send(window.showModalDialog !== undefined);", |
| 3429 &result)); | 3431 &result)); |
| 3430 EXPECT_TRUE(result); | 3432 EXPECT_TRUE(result); |
| 3431 } | 3433 } |
| 3432 | 3434 |
| 3433 #endif // !defined(CHROME_OS) | 3435 #endif // !defined(CHROME_OS) |
| 3434 | 3436 |
| 3435 } // namespace policy | 3437 } // namespace policy |
| OLD | NEW |