#include "chrome/browser/ui/cocoa/apps/quit_with_apps_controller_mac.h"
-#include "apps/app_window_registry.h"
-#include "apps/ui/native_app_window.h"
#include "base/command_line.h"
#include "base/run_loop.h"
#include "chrome/browser/apps/app_browsertest_util.h"
+#include "chrome/browser/apps/app_window_registry_util.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/chrome_browser_application_mac.h"
#include "chrome/browser/extensions/extension_service.h"
-#include "chrome/browser/extensions/extension_test_message_listener.h"
#include "chrome/browser/lifetime/application_lifetime.h"
#include "chrome/browser/notifications/message_center_notification_manager.h"
#include "chrome/browser/notifications/notification_ui_manager.h"
#include "content/public/browser/notification_service.h"
#include "content/public/test/test_utils.h"
#include "extensions/common/extension.h"
+#include "extensions/test/extension_test_message_listener.h"
#include "ui/message_center/message_center.h"
-typedef apps::AppWindowRegistry::AppWindowList AppWindowList;
-
namespace {
class QuitWithAppsControllerInteractiveTest
// One browser and one app window at this point.
EXPECT_FALSE(chrome::BrowserIterator().done());
- EXPECT_TRUE(apps::AppWindowRegistry::IsAppWindowRegisteredInAnyProfile(0));
+ EXPECT_TRUE(AppWindowRegistryUtil::IsAppWindowRegisteredInAnyProfile(0));
// On the first quit, show notification.
EXPECT_FALSE(controller->ShouldQuit());
- EXPECT_TRUE(apps::AppWindowRegistry::IsAppWindowRegisteredInAnyProfile(0));
+ EXPECT_TRUE(AppWindowRegistryUtil::IsAppWindowRegisteredInAnyProfile(0));
notification = g_browser_process->notification_ui_manager()->FindById(
QuitWithAppsController::kQuitWithAppsNotificationID);
ASSERT_TRUE(notification);
notification->delegate()->Click();
message_center->RemoveAllNotifications(false);
EXPECT_FALSE(controller->ShouldQuit());
- EXPECT_TRUE(apps::AppWindowRegistry::IsAppWindowRegisteredInAnyProfile(0));
+ EXPECT_TRUE(AppWindowRegistryUtil::IsAppWindowRegisteredInAnyProfile(0));
notification = g_browser_process->notification_ui_manager()->FindById(
QuitWithAppsController::kQuitWithAppsNotificationID);
ASSERT_TRUE(notification);
EXPECT_FALSE(chrome::BrowserIterator().done());
- EXPECT_TRUE(apps::AppWindowRegistry::IsAppWindowRegisteredInAnyProfile(0));
+ EXPECT_TRUE(AppWindowRegistryUtil::IsAppWindowRegisteredInAnyProfile(0));
// If notification is closed by user, don't show it next time.
notification->delegate()->Close(true);
message_center->RemoveAllNotifications(false);
EXPECT_FALSE(controller->ShouldQuit());
- EXPECT_TRUE(apps::AppWindowRegistry::IsAppWindowRegisteredInAnyProfile(0));
+ EXPECT_TRUE(AppWindowRegistryUtil::IsAppWindowRegisteredInAnyProfile(0));
notification = g_browser_process->notification_ui_manager()->FindById(
QuitWithAppsController::kQuitWithAppsNotificationID);
EXPECT_EQ(NULL, notification);
EXPECT_FALSE(chrome::BrowserIterator().done());
- EXPECT_TRUE(apps::AppWindowRegistry::IsAppWindowRegisteredInAnyProfile(0));
+ EXPECT_TRUE(AppWindowRegistryUtil::IsAppWindowRegisteredInAnyProfile(0));
// Quitting should not quit but close all browsers
content::WindowedNotificationObserver observer(
observer.Wait();
EXPECT_TRUE(chrome::BrowserIterator().done());
- EXPECT_TRUE(apps::AppWindowRegistry::IsAppWindowRegisteredInAnyProfile(0));
+ EXPECT_TRUE(AppWindowRegistryUtil::IsAppWindowRegisteredInAnyProfile(0));
// Trying to quit while there are no browsers always shows notification.
EXPECT_FALSE(controller->ShouldQuit());
content::NotificationService::AllSources());
notification->delegate()->ButtonClick(0);
message_center->RemoveAllNotifications(false);
- EXPECT_FALSE(apps::AppWindowRegistry::IsAppWindowRegisteredInAnyProfile(0));
+ EXPECT_FALSE(AppWindowRegistryUtil::IsAppWindowRegisteredInAnyProfile(0));
quit_observer.Wait();
}