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

Side by Side Diff: chrome/browser/chromeos/login/kiosk_browsertest.cc

Issue 576863003: Componentize NativeAppWindowViews (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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
« no previous file with comments | « chrome/browser/chromeos/login/DEPS ('k') | chrome/browser/ui/views/apps/DEPS » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 "apps/ui/views/native_app_window_views.h"
6 #include "ash/desktop_background/desktop_background_controller.h" 5 #include "ash/desktop_background/desktop_background_controller.h"
7 #include "ash/desktop_background/desktop_background_controller_observer.h" 6 #include "ash/desktop_background/desktop_background_controller_observer.h"
8 #include "ash/shell.h" 7 #include "ash/shell.h"
9 #include "base/bind.h" 8 #include "base/bind.h"
10 #include "base/bind_helpers.h" 9 #include "base/bind_helpers.h"
11 #include "base/files/file_util.h" 10 #include "base/files/file_util.h"
12 #include "base/location.h" 11 #include "base/location.h"
13 #include "base/memory/scoped_ptr.h" 12 #include "base/memory/scoped_ptr.h"
14 #include "base/path_service.h" 13 #include "base/path_service.h"
15 #include "base/prefs/pref_service.h" 14 #include "base/prefs/pref_service.h"
(...skipping 25 matching lines...) Expand all
41 #include "chrome/browser/profiles/profile_impl.h" 40 #include "chrome/browser/profiles/profile_impl.h"
42 #include "chrome/browser/profiles/profile_manager.h" 41 #include "chrome/browser/profiles/profile_manager.h"
43 #include "chrome/browser/profiles/profiles_state.h" 42 #include "chrome/browser/profiles/profiles_state.h"
44 #include "chrome/browser/ui/webui/chromeos/login/kiosk_app_menu_handler.h" 43 #include "chrome/browser/ui/webui/chromeos/login/kiosk_app_menu_handler.h"
45 #include "chrome/common/chrome_constants.h" 44 #include "chrome/common/chrome_constants.h"
46 #include "chrome/common/chrome_paths.h" 45 #include "chrome/common/chrome_paths.h"
47 #include "chrome/common/pref_names.h" 46 #include "chrome/common/pref_names.h"
48 #include "chromeos/chromeos_switches.h" 47 #include "chromeos/chromeos_switches.h"
49 #include "chromeos/dbus/cryptohome_client.h" 48 #include "chromeos/dbus/cryptohome_client.h"
50 #include "chromeos/disks/disk_mount_manager.h" 49 #include "chromeos/disks/disk_mount_manager.h"
50 #include "components/native_app_window/native_app_window_views.h"
51 #include "components/signin/core/common/signin_pref_names.h" 51 #include "components/signin/core/common/signin_pref_names.h"
52 #include "content/public/browser/browser_thread.h" 52 #include "content/public/browser/browser_thread.h"
53 #include "content/public/browser/notification_observer.h" 53 #include "content/public/browser/notification_observer.h"
54 #include "content/public/browser/notification_registrar.h" 54 #include "content/public/browser/notification_registrar.h"
55 #include "content/public/browser/notification_service.h" 55 #include "content/public/browser/notification_service.h"
56 #include "content/public/test/browser_test_utils.h" 56 #include "content/public/test/browser_test_utils.h"
57 #include "extensions/browser/app_window/app_window.h" 57 #include "extensions/browser/app_window/app_window.h"
58 #include "extensions/browser/app_window/app_window_registry.h" 58 #include "extensions/browser/app_window/app_window_registry.h"
59 #include "extensions/browser/app_window/native_app_window.h" 59 #include "extensions/browser/app_window/native_app_window.h"
60 #include "extensions/browser/extension_system.h" 60 #include "extensions/browser/extension_system.h"
(...skipping 575 matching lines...) Expand 10 before | Expand all | Expand 10 after
636 ASSERT_TRUE(window); 636 ASSERT_TRUE(window);
637 637
638 // Gets the original width of the app window. 638 // Gets the original width of the app window.
639 int original_width; 639 int original_width;
640 EXPECT_TRUE(content::ExecuteScriptAndExtractInt( 640 EXPECT_TRUE(content::ExecuteScriptAndExtractInt(
641 window->web_contents(), 641 window->web_contents(),
642 "window.domAutomationController.setAutomationId(0);" 642 "window.domAutomationController.setAutomationId(0);"
643 "window.domAutomationController.send(window.innerWidth);", 643 "window.domAutomationController.send(window.innerWidth);",
644 &original_width)); 644 &original_width));
645 645
646 apps::NativeAppWindowViews* native_app_window_views = 646 native_app_window::NativeAppWindowViews* native_app_window_views =
647 static_cast<apps::NativeAppWindowViews*>(window->GetBaseWindow()); 647 static_cast<native_app_window::NativeAppWindowViews*>(
648 window->GetBaseWindow());
648 ui::AcceleratorTarget* accelerator_target = 649 ui::AcceleratorTarget* accelerator_target =
649 static_cast<ui::AcceleratorTarget*>(native_app_window_views); 650 static_cast<ui::AcceleratorTarget*>(native_app_window_views);
650 651
651 // Zoom in. Text is bigger and content window width becomes smaller. 652 // Zoom in. Text is bigger and content window width becomes smaller.
652 accelerator_target->AcceleratorPressed(ui::Accelerator( 653 accelerator_target->AcceleratorPressed(ui::Accelerator(
653 ui::VKEY_ADD, ui::EF_CONTROL_DOWN)); 654 ui::VKEY_ADD, ui::EF_CONTROL_DOWN));
654 int width_zoomed_in; 655 int width_zoomed_in;
655 EXPECT_TRUE(content::ExecuteScriptAndExtractInt( 656 EXPECT_TRUE(content::ExecuteScriptAndExtractInt(
656 window->web_contents(), 657 window->web_contents(),
657 "window.domAutomationController.setAutomationId(0);" 658 "window.domAutomationController.setAutomationId(0);"
(...skipping 1114 matching lines...) Expand 10 before | Expand all | Expand 10 after
1772 content::WindowedNotificationObserver( 1773 content::WindowedNotificationObserver(
1773 chrome::NOTIFICATION_KIOSK_AUTOLAUNCH_WARNING_VISIBLE, 1774 chrome::NOTIFICATION_KIOSK_AUTOLAUNCH_WARNING_VISIBLE,
1774 content::NotificationService::AllSources()).Wait(); 1775 content::NotificationService::AllSources()).Wait();
1775 1776
1776 // Wait for the wallpaper to load. 1777 // Wait for the wallpaper to load.
1777 WaitForWallpaper(); 1778 WaitForWallpaper();
1778 EXPECT_TRUE(wallpaper_loaded()); 1779 EXPECT_TRUE(wallpaper_loaded());
1779 } 1780 }
1780 1781
1781 } // namespace chromeos 1782 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/login/DEPS ('k') | chrome/browser/ui/views/apps/DEPS » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698