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

Unified Diff: trunk/src/chrome/browser/metro_viewer/chrome_metro_viewer_process_host_aurawin.cc

Issue 15966003: Revert 201806 "Create MetroViewerProcessHost as a common base fo..." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 7 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: trunk/src/chrome/browser/metro_viewer/chrome_metro_viewer_process_host_aurawin.cc
===================================================================
--- trunk/src/chrome/browser/metro_viewer/chrome_metro_viewer_process_host_aurawin.cc (revision 201965)
+++ trunk/src/chrome/browser/metro_viewer/chrome_metro_viewer_process_host_aurawin.cc (working copy)
@@ -1,86 +0,0 @@
-// Copyright 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "chrome/browser/metro_viewer/chrome_metro_viewer_process_host_aurawin.h"
-
-#include "base/logging.h"
-#include "base/memory/ref_counted.h"
-#include "chrome/browser/browser_process.h"
-#include "chrome/browser/browser_process_platform_part_aurawin.h"
-#include "chrome/browser/ui/ash/ash_init.h"
-#include "chrome/browser/ui/browser.h"
-#include "chrome/browser/ui/browser_list.h"
-#include "chrome/browser/ui/browser_window.h"
-#include "chrome/browser/ui/host_desktop.h"
-#include "chrome/browser/ui/tabs/tab_strip_model.h"
-#include "chrome/common/chrome_notification_types.h"
-#include "content/public/browser/browser_thread.h"
-#include "content/public/browser/notification_service.h"
-#include "content/public/browser/web_contents.h"
-#include "ui/aura/remote_root_window_host_win.h"
-#include "ui/surface/accelerated_surface_win.h"
-
-namespace {
-
-void CloseOpenAshBrowsers() {
- BrowserList* browser_list =
- BrowserList::GetInstance(chrome::HOST_DESKTOP_TYPE_ASH);
- if (browser_list) {
- for (BrowserList::const_iterator i = browser_list->begin();
- i != browser_list->end(); ++i) {
- Browser* browser = *i;
- browser->window()->Close();
- // If the attempt to Close the browser fails due to unload handlers on
- // the page or in progress downloads, etc, destroy all tabs on the page.
- while (browser->tab_strip_model()->count())
- delete browser->tab_strip_model()->GetWebContentsAt(0);
- }
- }
-}
-
-} // namespace
-
-ChromeMetroViewerProcessHost::ChromeMetroViewerProcessHost(
- const std::string& ipc_channel_name)
- : MetroViewerProcessHost(
- ipc_channel_name,
- content::BrowserThread::GetMessageLoopProxyForThread(
- content::BrowserThread::IO)) {
- g_browser_process->AddRefModule();
-}
-
-void ChromeMetroViewerProcessHost::OnChannelError() {
- // TODO(cpu): At some point we only close the browser. Right now this
- // is very convenient for developing.
- DLOG(INFO) << "viewer channel error : Quitting browser";
- aura::RemoteRootWindowHostWin::Instance()->Disconnected();
- g_browser_process->ReleaseModule();
- CloseOpenAshBrowsers();
- chrome::CloseAsh();
- // Tell the rest of Chrome about it.
- content::NotificationService::current()->Notify(
- chrome::NOTIFICATION_ASH_SESSION_ENDED,
- content::NotificationService::AllSources(),
- content::NotificationService::NoDetails());
-
- // This will delete the MetroViewerProcessHost object. Don't access member
- // variables/functions after this call.
- g_browser_process->platform_part()->OnMetroViewerProcessTerminated();
-}
-
-void ChromeMetroViewerProcessHost::OnSetTargetSurface(
- gfx::NativeViewId target_surface) {
- DLOG(INFO) << __FUNCTION__ << ", target_surface = " << target_surface;
- HWND hwnd = reinterpret_cast<HWND>(target_surface);
- chrome::OpenAsh();
- scoped_refptr<AcceleratedPresenter> any_window =
- AcceleratedPresenter::GetForWindow(NULL);
- any_window->SetNewTargetWindow(hwnd);
- aura::RemoteRootWindowHostWin::Instance()->Connected(this);
- // Tell the rest of Chrome that Ash is running.
- content::NotificationService::current()->Notify(
- chrome::NOTIFICATION_ASH_SESSION_STARTED,
- content::NotificationService::AllSources(),
- content::NotificationService::NoDetails());
-}

Powered by Google App Engine
This is Rietveld 408576698