diff options
| author | scottmg <scottmg@chromium.org> | 2016-03-18 09:14:27 -0700 |
|---|---|---|
| committer | Commit bot <commit-bot@chromium.org> | 2016-03-18 16:16:27 +0000 |
| commit | d12621f409b1b052a995b8ccc9fae7b185e85fe0 (patch) | |
| tree | 4dc89148046fa6811fa758ebf7428122487c4779 | |
| parent | a99580af7535508a417274daca97212e8b8a1e8e (diff) | |
| download | chromium_src-d12621f409b1b052a995b8ccc9fae7b185e85fe0.zip chromium_src-d12621f409b1b052a995b8ccc9fae7b185e85fe0.tar.gz chromium_src-d12621f409b1b052a995b8ccc9fae7b185e85fe0.tar.bz2 | |
Remove remaining HOST_DESKTOP_TYPE_... uses
Couldn't quite delete the .h yet. Hopefully after this one.
R=sky@chromium.org
BUG=558054
Review URL: https://codereview.chromium.org/1806903004
Cr-Commit-Position: refs/heads/master@{#381985}
19 files changed, 60 insertions, 126 deletions
diff --git a/chrome/browser/chromeos/first_run/first_run_controller.cc b/chrome/browser/chromeos/first_run/first_run_controller.cc index ecb7a75d..bb44a54 100644 --- a/chrome/browser/chromeos/first_run/first_run_controller.cc +++ b/chrome/browser/chromeos/first_run/first_run_controller.cc @@ -123,9 +123,8 @@ void FirstRunController::OnNextButtonClicked(const std::string& step_name) { void FirstRunController::OnHelpButtonClicked() { RecordCompletion(first_run::TUTORIAL_COMPLETED_WITH_KEEP_EXPLORING); - on_actor_finalized_ = - base::Bind(chrome::ShowHelpForProfile, user_profile_, - chrome::HOST_DESKTOP_TYPE_ASH, chrome::HELP_SOURCE_MENU); + on_actor_finalized_ = base::Bind(chrome::ShowHelpForProfile, user_profile_, + chrome::HELP_SOURCE_MENU); actor_->Finalize(); } diff --git a/chrome/browser/extensions/api/tabs/tabs_api.cc b/chrome/browser/extensions/api/tabs/tabs_api.cc index 33b3ac7e..38641aa 100644 --- a/chrome/browser/extensions/api/tabs/tabs_api.cc +++ b/chrome/browser/extensions/api/tabs/tabs_api.cc @@ -517,11 +517,12 @@ bool WindowsCreateFunction::RunSync() { bool use_panels = PanelManager::ShouldUsePanels(extension_id); if (use_panels) { create_panel = true; +#if !defined(USE_ASH) // Non-ash supports both docked and detached panel types. - if (chrome::GetActiveDesktop() != chrome::HOST_DESKTOP_TYPE_ASH && - create_data->type == windows::CREATE_TYPE_DETACHED_PANEL) { + if (create_data->type == windows::CREATE_TYPE_DETACHED_PANEL) { panel_create_mode = PanelManager::CREATE_AS_DETACHED; } +#endif // USE_ASH } else { window_type = Browser::TYPE_POPUP; } @@ -583,26 +584,24 @@ bool WindowsCreateFunction::RunSync() { urls.push_back(GURL(chrome::kChromeUINewTabURL)); #if defined(USE_ASH) - if (chrome::GetActiveDesktop() == chrome::HOST_DESKTOP_TYPE_ASH) { - AppWindow::CreateParams create_params; - create_params.window_type = AppWindow::WINDOW_TYPE_V1_PANEL; - create_params.window_key = extension_id; - create_params.window_spec.bounds = window_bounds; - create_params.focused = saw_focus_key && focused; - AppWindow* app_window = new AppWindow( - window_profile, new ChromeAppDelegate(true), extension()); - AshPanelContents* ash_panel_contents = new AshPanelContents(app_window); - app_window->Init(urls[0], ash_panel_contents, render_frame_host(), - create_params); - WindowController* window_controller = - WindowControllerList::GetInstance()->FindWindowById( - app_window->session_id().id()); - if (!window_controller) - return false; - SetResult(window_controller->CreateWindowValueWithTabs(extension())); - return true; - } -#endif + AppWindow::CreateParams create_params; + create_params.window_type = AppWindow::WINDOW_TYPE_V1_PANEL; + create_params.window_key = extension_id; + create_params.window_spec.bounds = window_bounds; + create_params.focused = saw_focus_key && focused; + AppWindow* app_window = + new AppWindow(window_profile, new ChromeAppDelegate(true), extension()); + AshPanelContents* ash_panel_contents = new AshPanelContents(app_window); + app_window->Init(urls[0], ash_panel_contents, render_frame_host(), + create_params); + WindowController* window_controller = + WindowControllerList::GetInstance()->FindWindowById( + app_window->session_id().id()); + if (!window_controller) + return false; + SetResult(window_controller->CreateWindowValueWithTabs(extension())); + return true; +#else std::string title = web_app::GenerateApplicationNameFromExtensionId(extension_id); content::SiteInstance* source_site_instance = @@ -621,6 +620,7 @@ bool WindowsCreateFunction::RunSync() { SetResult(panel->extension_window_controller()->CreateWindowValueWithTabs( extension())); return true; +#endif } // Create a new BrowserWindow. diff --git a/chrome/browser/extensions/launch_util.cc b/chrome/browser/extensions/launch_util.cc index 00d5d98..a0e29c0 100644 --- a/chrome/browser/extensions/launch_util.cc +++ b/chrome/browser/extensions/launch_util.cc @@ -118,8 +118,7 @@ LaunchContainer GetLaunchContainer(const ExtensionPrefs* prefs, // window opening is the default), make the container a window. result = LAUNCH_CONTAINER_WINDOW; #if defined(USE_ASH) - } else if (prefs_launch_type == LAUNCH_TYPE_FULLSCREEN && - chrome::GetActiveDesktop() == chrome::HOST_DESKTOP_TYPE_ASH) { + } else if (prefs_launch_type == LAUNCH_TYPE_FULLSCREEN) { // LAUNCH_TYPE_FULLSCREEN launches in a maximized app window in ash. // For desktop chrome AURA on all platforms we should open the // application in full screen mode in the current tab, on the same diff --git a/chrome/browser/fullscreen_aurax11.cc b/chrome/browser/fullscreen_aurax11.cc index eca8c22..cd3d6f7 100644 --- a/chrome/browser/fullscreen_aurax11.cc +++ b/chrome/browser/fullscreen_aurax11.cc @@ -14,13 +14,10 @@ bool IsFullScreenMode() { #if defined(USE_ASH) - if (chrome::GetActiveDesktop() == chrome::HOST_DESKTOP_TYPE_ASH) { - ash::RootWindowController* controller = - ash::RootWindowController::ForTargetRootWindow(); - return controller && controller->GetWindowForFullscreenMode(); - } -#endif - + ash::RootWindowController* controller = + ash::RootWindowController::ForTargetRootWindow(); + return controller && controller->GetWindowForFullscreenMode(); +#else std::vector<aura::Window*> all_windows = views::DesktopWindowTreeHostX11::GetAllOpenWindows(); // Only the topmost window is checked. This works fine in the most cases, but @@ -32,4 +29,5 @@ bool IsFullScreenMode() { views::Widget* widget = views::Widget::GetWidgetForNativeWindow(all_windows[0]); return widget && widget->IsFullscreen(); +#endif // USE_ASH } diff --git a/chrome/browser/fullscreen_win.cc b/chrome/browser/fullscreen_win.cc index 1adc471..02af9d7 100644 --- a/chrome/browser/fullscreen_win.cc +++ b/chrome/browser/fullscreen_win.cc @@ -103,13 +103,12 @@ static bool IsFullScreenConsoleMode() { bool IsFullScreenMode() { #if defined(USE_ASH) - if (chrome::GetActiveDesktop() == chrome::HOST_DESKTOP_TYPE_ASH) { - ash::RootWindowController* controller = - ash::RootWindowController::ForTargetRootWindow(); - return controller && controller->GetWindowForFullscreenMode(); - } -#endif + ash::RootWindowController* controller = + ash::RootWindowController::ForTargetRootWindow(); + return controller && controller->GetWindowForFullscreenMode(); +#else return IsPlatformFullScreenMode() || IsFullScreenWindowMode() || IsFullScreenConsoleMode(); +#endif // USE_ASH } diff --git a/chrome/browser/profiles/avatar_menu_actions_desktop.cc b/chrome/browser/profiles/avatar_menu_actions_desktop.cc index 233c8fe..87a1eb0 100644 --- a/chrome/browser/profiles/avatar_menu_actions_desktop.cc +++ b/chrome/browser/profiles/avatar_menu_actions_desktop.cc @@ -63,19 +63,11 @@ bool AvatarMenuActionsDesktop::ShouldShowAddNewProfileLink() const { // |browser_| can be NULL in unit_tests. if (browser_ && browser_->profile()->IsSupervised()) return false; -#if defined(OS_WIN) - return chrome::GetActiveDesktop() != chrome::HOST_DESKTOP_TYPE_ASH; -#else return true; -#endif } bool AvatarMenuActionsDesktop::ShouldShowEditProfileLink() const { -#if defined(OS_WIN) - return chrome::GetActiveDesktop() != chrome::HOST_DESKTOP_TYPE_ASH; -#else return true; -#endif } void AvatarMenuActionsDesktop::ActiveBrowserChanged(Browser* browser) { diff --git a/chrome/browser/ui/app_list/app_list_util.cc b/chrome/browser/ui/app_list/app_list_util.cc index 0d385d7..b68a3b4 100644 --- a/chrome/browser/ui/app_list/app_list_util.cc +++ b/chrome/browser/ui/app_list/app_list_util.cc @@ -13,14 +13,9 @@ bool IsAppLauncherEnabled() { #if !defined(ENABLE_APP_LIST) return false; - -#elif defined(OS_CHROMEOS) +#elif defined(OS_CHROMEOS) || defined(USE_ASH) return true; - -#else // defined(ENABLE_APP_LIST) && !defined(OS_CHROMEOS) - if (chrome::GetActiveDesktop() == chrome::HOST_DESKTOP_TYPE_ASH) - return true; - +#else PrefService* prefs = g_browser_process->local_state(); // In some tests, the prefs aren't initialised. return prefs && prefs->GetBoolean(prefs::kAppLauncherHasBeenEnabled); diff --git a/chrome/browser/ui/ash/chrome_new_window_delegate_chromeos.cc b/chrome/browser/ui/ash/chrome_new_window_delegate_chromeos.cc index 9d67177..c9aa10d 100644 --- a/chrome/browser/ui/ash/chrome_new_window_delegate_chromeos.cc +++ b/chrome/browser/ui/ash/chrome_new_window_delegate_chromeos.cc @@ -45,8 +45,7 @@ void ChromeNewWindowDelegateChromeos::OpenFileManager() { void ChromeNewWindowDelegateChromeos::OpenGetHelp() { Profile* const profile = ProfileManager::GetActiveUserProfile(); - chrome::ShowHelpForProfile(profile, chrome::HOST_DESKTOP_TYPE_ASH, - chrome::HELP_SOURCE_KEYBOARD); + chrome::ShowHelpForProfile(profile, chrome::HELP_SOURCE_KEYBOARD); } void ChromeNewWindowDelegateChromeos::OpenCrosh() { diff --git a/chrome/browser/ui/ash/system_tray_delegate_chromeos.cc b/chrome/browser/ui/ash/system_tray_delegate_chromeos.cc index 5eab3e7..d59f82d 100644 --- a/chrome/browser/ui/ash/system_tray_delegate_chromeos.cc +++ b/chrome/browser/ui/ash/system_tray_delegate_chromeos.cc @@ -517,7 +517,6 @@ void SystemTrayDelegateChromeOS::ShowIMESettings() { void SystemTrayDelegateChromeOS::ShowHelp() { chrome::ShowHelpForProfile(ProfileManager::GetActiveUserProfile(), - chrome::HOST_DESKTOP_TYPE_ASH, chrome::HELP_SOURCE_MENU); } diff --git a/chrome/browser/ui/ash/system_tray_delegate_common.cc b/chrome/browser/ui/ash/system_tray_delegate_common.cc index eb151dd..3c5bb4d 100644 --- a/chrome/browser/ui/ash/system_tray_delegate_common.cc +++ b/chrome/browser/ui/ash/system_tray_delegate_common.cc @@ -89,7 +89,6 @@ void SystemTrayDelegateCommon::ShowChromeSlow() { void SystemTrayDelegateCommon::ShowHelp() { chrome::ShowHelpForProfile(ProfileManager::GetLastUsedProfile(), - chrome::HOST_DESKTOP_TYPE_ASH, chrome::HELP_SOURCE_MENU); } diff --git a/chrome/browser/ui/browser_commands.cc b/chrome/browser/ui/browser_commands.cc index ff551e1..a43ae26 100644 --- a/chrome/browser/ui/browser_commands.cc +++ b/chrome/browser/ui/browser_commands.cc @@ -894,14 +894,7 @@ void BasicPrint(Browser* browser) { bool CanBasicPrint(Browser* browser) { // If printing is not disabled via pref or policy, it is always possible to - // advanced print when the print preview is visible. The exception to this - // is under Win8 ash, since showing the advanced print dialog will open it - // modally on the Desktop and hang the browser. -#if defined(OS_WIN) - if (chrome::GetActiveDesktop() == chrome::HOST_DESKTOP_TYPE_ASH) - return false; -#endif - + // advanced print when the print preview is visible. return browser->profile()->GetPrefs()->GetBoolean(prefs::kPrintingEnabled) && (PrintPreviewShowing(browser) || CanPrint(browser)); } diff --git a/chrome/browser/ui/chrome_pages.cc b/chrome/browser/ui/chrome_pages.cc index 6b621f1..928332d 100644 --- a/chrome/browser/ui/chrome_pages.cc +++ b/chrome/browser/ui/chrome_pages.cc @@ -80,10 +80,7 @@ void NavigateToSingletonTab(Browser* browser, const GURL& url) { // |browser| is NULL and the help page is used (vs the app), the help page is // shown in the last active browser. If there is no such browser, a new browser // is created. -void ShowHelpImpl(Browser* browser, - Profile* profile, - HostDesktopType host_desktop_type, - HelpSource source) { +void ShowHelpImpl(Browser* browser, Profile* profile, HelpSource source) { content::RecordAction(UserMetricsAction("ShowHelpTab")); #if defined(OS_CHROMEOS) && defined(OFFICIAL_BUILD) const extensions::Extension* extension = @@ -201,13 +198,11 @@ void ShowConflicts(Browser* browser) { } void ShowHelp(Browser* browser, HelpSource source) { - ShowHelpImpl(browser, browser->profile(), HOST_DESKTOP_TYPE_NATIVE, source); + ShowHelpImpl(browser, browser->profile(), source); } -void ShowHelpForProfile(Profile* profile, - HostDesktopType host_desktop_type, - HelpSource source) { - ShowHelpImpl(NULL, profile, host_desktop_type, source); +void ShowHelpForProfile(Profile* profile, HelpSource source) { + ShowHelpImpl(NULL, profile, source); } void ShowPolicy(Browser* browser) { diff --git a/chrome/browser/ui/chrome_pages.h b/chrome/browser/ui/chrome_pages.h index a147de2..36c6b60 100644 --- a/chrome/browser/ui/chrome_pages.h +++ b/chrome/browser/ui/chrome_pages.h @@ -54,9 +54,7 @@ void ShowFeedbackPage(Browser* browser, const std::string& category_tag); void ShowHelp(Browser* browser, HelpSource source); -void ShowHelpForProfile(Profile* profile, - HostDesktopType host_desktop_type, - HelpSource source); +void ShowHelpForProfile(Profile* profile, HelpSource source); void ShowPolicy(Browser* browser); void ShowSlow(Browser* browser); void ShowMemory(Browser* browser); diff --git a/chrome/browser/ui/startup/startup_browser_creator_impl.cc b/chrome/browser/ui/startup/startup_browser_creator_impl.cc index f181340..7e2acec 100644 --- a/chrome/browser/ui/startup/startup_browser_creator_impl.cc +++ b/chrome/browser/ui/startup/startup_browser_creator_impl.cc @@ -619,8 +619,8 @@ bool StartupBrowserCreatorImpl::ProcessStartupURLs( std::vector<GURL> adjusted_urls(urls_to_open); AddSpecialURLs(&adjusted_urls); - // The startup code only executes for browsers launched in desktop mode. - // i.e. HOST_DESKTOP_TYPE_NATIVE. Ash should never get here. + // The startup code only executes for browsers launched in desktop mode. Ash + // should never get here. Browser* browser = SessionRestore::RestoreSession( profile_, NULL, restore_behavior, adjusted_urls); diff --git a/chrome/browser/ui/views/app_list/linux/app_list_service_linux.cc b/chrome/browser/ui/views/app_list/linux/app_list_service_linux.cc index da0aaff..5d796c9 100644 --- a/chrome/browser/ui/views/app_list/linux/app_list_service_linux.cc +++ b/chrome/browser/ui/views/app_list/linux/app_list_service_linux.cc @@ -90,11 +90,10 @@ void AppListServiceLinux::MoveNearCursor(app_list::AppListView* view) { // static AppListService* AppListService::Get() { #if defined(USE_ASH) - if (desktop_type == chrome::HOST_DESKTOP_TYPE_ASH) - return AppListServiceAsh::GetInstance(); -#endif - + return AppListServiceAsh::GetInstance(); +#else return AppListServiceLinux::GetInstance(); +#endif } // static @@ -102,6 +101,7 @@ void AppListService::InitAll(Profile* initial_profile, const base::FilePath& profile_path) { #if defined(USE_ASH) AppListServiceAsh::GetInstance()->Init(initial_profile); -#endif +#else AppListServiceLinux::GetInstance()->Init(initial_profile); +#endif } diff --git a/chrome/browser/ui/views/chrome_views_delegate.cc b/chrome/browser/ui/views/chrome_views_delegate.cc index 7bcb9a9..1bb591c 100644 --- a/chrome/browser/ui/views/chrome_views_delegate.cc +++ b/chrome/browser/ui/views/chrome_views_delegate.cc @@ -264,10 +264,6 @@ views::ViewsDelegate::ProcessMenuAcceleratorResult ChromeViewsDelegate::ProcessAcceleratorWhileMenuShowing( const ui::Accelerator& accelerator) { #if defined(USE_ASH) - // Handle ash accelerators only when a menu is opened on an ash desktop. - if (chrome::GetActiveDesktop() != chrome::HOST_DESKTOP_TYPE_ASH) - return views::ViewsDelegate::ProcessMenuAcceleratorResult::LEAVE_MENU_OPEN; - ash::AcceleratorController* accelerator_controller = ash::Shell::GetInstance()->accelerator_controller(); @@ -378,8 +374,7 @@ void ChromeViewsDelegate::OnBeforeWidgetInit( // windows for most things (they get blended via WS_EX_COMPOSITED, which // allows for animation effects, but also exceeding the bounds of the parent // window). - if (chrome::GetActiveDesktop() != chrome::HOST_DESKTOP_TYPE_ASH && - params->parent && + if (params->parent && params->type != views::Widget::InitParams::TYPE_CONTROL && params->type != views::Widget::InitParams::TYPE_WINDOW) { // When we set this to false, we get a DesktopNativeWidgetAura from the @@ -395,7 +390,7 @@ void ChromeViewsDelegate::OnBeforeWidgetInit( } #endif // USE_AURA -#if defined(OS_CHROMEOS) +#if defined(OS_CHROMEOS) || defined(USE_ASH) // When we are doing straight chromeos builds, we still need to handle the // toplevel window case. // There may be a few remaining widgets in Chrome OS that are not top level, @@ -413,23 +408,7 @@ void ChromeViewsDelegate::OnBeforeWidgetInit( // existence of a global WindowTreeClient, if this window is toplevel, it's // possible that there is no contextual state that we can use. if (params->parent == NULL && params->context == NULL && !params->child) { - // We need to make a decision about where to place this window based on the - // desktop type. - switch (chrome::GetActiveDesktop()) { - case chrome::HOST_DESKTOP_TYPE_NATIVE: - // If we're native, we should give this window its own toplevel desktop - // widget. - params->native_widget = new views::DesktopNativeWidgetAura(delegate); - break; -#if defined(USE_ASH) - case chrome::HOST_DESKTOP_TYPE_ASH: - // If we're in ash, give this window the context of the main monitor. - params->context = ash::Shell::GetPrimaryRootWindow(); - break; -#endif - default: - NOTREACHED(); - } + params->native_widget = new views::DesktopNativeWidgetAura(delegate); } else if (use_non_toplevel_window) { views::NativeWidgetAura* native_widget = new views::NativeWidgetAura(delegate); diff --git a/chrome/browser/ui/views/panels/panel_view.cc b/chrome/browser/ui/views/panels/panel_view.cc index 5f93d5f..38f007e 100644 --- a/chrome/browser/ui/views/panels/panel_view.cc +++ b/chrome/browser/ui/views/panels/panel_view.cc @@ -990,16 +990,13 @@ void PanelView::OnWidgetActivationChanged(views::Widget* widget, bool active) { if (window_closed_) return; - bool focused = active; - if (chrome::GetActiveDesktop() == chrome::HOST_DESKTOP_TYPE_NATIVE) { - // The panel window is in focus (actually accepting keystrokes) if it is - // active and belongs to a foreground application. - focused = active && - views::HWNDForWidget(widget) == ::GetForegroundWindow(); - } + // The panel window is in focus (actually accepting keystrokes) if it is + // active and belongs to a foreground application. + bool focused = + active && views::HWNDForWidget(widget) == ::GetForegroundWindow(); #else bool focused = active; -#endif +#endif // OS_WIN if (focused_ == focused) return; diff --git a/chrome/browser/ui/webui/ntp/new_tab_ui.cc b/chrome/browser/ui/webui/ntp/new_tab_ui.cc index d3ef138..ccfa926 100644 --- a/chrome/browser/ui/webui/ntp/new_tab_ui.cc +++ b/chrome/browser/ui/webui/ntp/new_tab_ui.cc @@ -121,7 +121,7 @@ void NewTabUI::RegisterProfilePrefs( bool NewTabUI::ShouldShowApps() { // Ash shows apps in app list thus should not show apps page in NTP4. #if defined(USE_ASH) - return chrome::GetActiveDesktop() != chrome::HOST_DESKTOP_TYPE_ASH; + return false; #else return true; #endif diff --git a/chrome/test/base/default_ash_event_generator_delegate.cc b/chrome/test/base/default_ash_event_generator_delegate.cc index 26a909c..683c415 100644 --- a/chrome/test/base/default_ash_event_generator_delegate.cc +++ b/chrome/test/base/default_ash_event_generator_delegate.cc @@ -32,13 +32,6 @@ DefaultAshEventGeneratorDelegate::GetScreenPositionClient( void DefaultAshEventGeneratorDelegate::DispatchKeyEventToIME( ui::EventTarget* target, ui::KeyEvent* event) { - // In Ash environment, the key event will be processed by event rewriters - // first and event will not be hanlded. - // Otherwise, use EventGeneratorDelegateAura::DispatchKeyEventToIME() to - // dispatch |event| to the input method. - if (chrome::GetActiveDesktop() != chrome::HOST_DESKTOP_TYPE_ASH) { - EventGeneratorDelegateAura::DispatchKeyEventToIME(target, event); - } } DefaultAshEventGeneratorDelegate::DefaultAshEventGeneratorDelegate() |
