forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert of Remove remote tree host and some related input and metro_dr…
…iver code (patchset chromium#5 id:80001 of https://codereview.chromium.org/1586843002/ ) Reason for revert: Suspecting that this is breaking the Webkit Win (dbg) builder. First failed build: https://build.chromium.org/p/chromium.webkit/builders/WebKit%20Win%20Builder%20%28dbg%29/builds/88362 Original issue's description: > Remove remote tree host and some related input and metro_driver code > > Part of continued stripping out of Metro/Win8/Immersive mode. > > BUG=558054 > > Committed: https://crrev.com/5cc04f70e424020d8afe49bdc4c1c76683f0ea7b > Cr-Commit-Position: refs/heads/master@{#370068} TBR=sky@chromium.org,thestig@chromium.org,shuchen@chromium.org,ananta@chromium.org,dpranke@chromium.org,scottmg@chromium.org NOTRY=true NOPRESUBMIT=true NOTREECHECKS=true BUG=558054 Review URL: https://codereview.chromium.org/1602403002 Cr-Commit-Position: refs/heads/master@{#370290}
- Loading branch information
Showing
63 changed files
with
8,006 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
// Copyright 2014 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 "ash/host/ash_remote_window_tree_host_win.h" | ||
|
||
#include "ash/host/root_window_transformer.h" | ||
#include "ash/ime/input_method_event_handler.h" | ||
#include "ui/events/event_processor.h" | ||
#include "ui/gfx/geometry/insets.h" | ||
#include "ui/gfx/transform.h" | ||
|
||
namespace ash { | ||
|
||
AshRemoteWindowTreeHostWin::AshRemoteWindowTreeHostWin(HWND remote_hwnd) | ||
: aura::RemoteWindowTreeHostWin(), | ||
transformer_helper_(this) { | ||
SetRemoteWindowHandle(remote_hwnd); | ||
transformer_helper_.Init(); | ||
} | ||
|
||
AshRemoteWindowTreeHostWin::~AshRemoteWindowTreeHostWin() {} | ||
|
||
void AshRemoteWindowTreeHostWin::ToggleFullScreen() {} | ||
|
||
bool AshRemoteWindowTreeHostWin::ConfineCursorToRootWindow() { return false; } | ||
|
||
void AshRemoteWindowTreeHostWin::UnConfineCursor() {} | ||
|
||
void AshRemoteWindowTreeHostWin::SetRootWindowTransformer( | ||
scoped_ptr<RootWindowTransformer> transformer) { | ||
transformer_helper_.SetRootWindowTransformer(transformer.Pass()); | ||
} | ||
|
||
gfx::Insets AshRemoteWindowTreeHostWin::GetHostInsets() const { | ||
return gfx::Insets(); | ||
} | ||
|
||
aura::WindowTreeHost* AshRemoteWindowTreeHostWin::AsWindowTreeHost() { | ||
return this; | ||
} | ||
|
||
gfx::Transform AshRemoteWindowTreeHostWin::GetRootTransform() const { | ||
return transformer_helper_.GetTransform(); | ||
} | ||
|
||
void AshRemoteWindowTreeHostWin::SetRootTransform( | ||
const gfx::Transform& transform) { | ||
transformer_helper_.SetTransform(transform); | ||
} | ||
|
||
gfx::Transform AshRemoteWindowTreeHostWin::GetInverseRootTransform() const { | ||
return transformer_helper_.GetInverseTransform(); | ||
} | ||
|
||
void AshRemoteWindowTreeHostWin::UpdateRootWindowSize( | ||
const gfx::Size& host_size) { | ||
transformer_helper_.UpdateWindowSize(host_size); | ||
} | ||
|
||
ui::EventDispatchDetails AshRemoteWindowTreeHostWin::DispatchKeyEventPostIME( | ||
ui::KeyEvent* event) { | ||
input_method_handler()->SetPostIME(true); | ||
ui::EventDispatchDetails details = | ||
event_processor()->OnEventFromSource(event); | ||
if (!details.dispatcher_destroyed) | ||
input_method_handler()->SetPostIME(false); | ||
return details; | ||
} | ||
|
||
} // namespace ash |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
// Copyright 2014 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. | ||
|
||
#ifndef ASH_HOST_REMOTE_WINDOW_TREE_HOST_WIN_H_ | ||
#define ASH_HOST_REMOTE_WINDOW_TREE_HOST_WIN_H_ | ||
|
||
#include <windows.h> | ||
|
||
#include "ash/ash_export.h" | ||
#include "ash/host/ash_window_tree_host.h" | ||
#include "ash/host/transformer_helper.h" | ||
#include "base/macros.h" | ||
#include "ui/aura/remote_window_tree_host_win.h" | ||
|
||
namespace ash { | ||
|
||
class ASH_EXPORT AshRemoteWindowTreeHostWin | ||
: public AshWindowTreeHost, | ||
public aura::RemoteWindowTreeHostWin { | ||
public: | ||
explicit AshRemoteWindowTreeHostWin(HWND remote_hwnd); | ||
|
||
private: | ||
~AshRemoteWindowTreeHostWin() override; | ||
|
||
// AshWindowTreeHost: | ||
void ToggleFullScreen() override; | ||
bool ConfineCursorToRootWindow() override; | ||
void UnConfineCursor() override; | ||
void SetRootWindowTransformer( | ||
scoped_ptr<RootWindowTransformer> transformer) override; | ||
gfx::Insets GetHostInsets() const override; | ||
aura::WindowTreeHost* AsWindowTreeHost() override; | ||
|
||
// WindowTreeHostWin: | ||
gfx::Transform GetRootTransform() const override; | ||
void SetRootTransform(const gfx::Transform& transform) override; | ||
gfx::Transform GetInverseRootTransform() const override; | ||
void UpdateRootWindowSize(const gfx::Size& host_size) override; | ||
|
||
// ui::internal::InputMethodDelegate: | ||
ui::EventDispatchDetails DispatchKeyEventPostIME( | ||
ui::KeyEvent* event) override; | ||
|
||
TransformerHelper transformer_helper_; | ||
|
||
DISALLOW_COPY_AND_ASSIGN(AshRemoteWindowTreeHostWin); | ||
}; | ||
|
||
} // namespace ash | ||
|
||
#endif // ASH_HOST_REMOTE_WINDOW_TREE_HOST_WIN_H_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
// Copyright (c) 2013 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/browser_process_platform_part_aurawin.h" | ||
|
||
#include "base/command_line.h" | ||
#include "base/logging.h" | ||
#include "base/prefs/pref_service.h" | ||
#include "base/process/kill.h" | ||
#include "base/win/windows_version.h" | ||
#include "chrome/browser/browser_process.h" | ||
#include "chrome/browser/chrome_notification_types.h" | ||
#include "chrome/browser/first_run/upgrade_util.h" | ||
#include "chrome/browser/first_run/upgrade_util_win.h" | ||
#include "chrome/browser/lifetime/application_lifetime.h" | ||
#include "chrome/browser/metro_viewer/chrome_metro_viewer_process_host_aurawin.h" | ||
#include "chrome/common/chrome_switches.h" | ||
#include "chrome/common/pref_names.h" | ||
#include "content/public/browser/notification_service.h" | ||
|
||
#include "ui/aura/remote_window_tree_host_win.h" | ||
#include "ui/base/ui_base_switches.h" | ||
|
||
BrowserProcessPlatformPart::BrowserProcessPlatformPart() { | ||
if (base::win::GetVersion() >= base::win::VERSION_WIN7) { | ||
// Tell metro viewer to close when we are shutting down. | ||
registrar_.Add(this, chrome::NOTIFICATION_APP_TERMINATING, | ||
content::NotificationService::AllSources()); | ||
} | ||
} | ||
|
||
BrowserProcessPlatformPart::~BrowserProcessPlatformPart() { | ||
} | ||
|
||
void BrowserProcessPlatformPart::OnMetroViewerProcessTerminated() { | ||
metro_viewer_process_host_.reset(NULL); | ||
} | ||
|
||
void BrowserProcessPlatformPart::PlatformSpecificCommandLineProcessing( | ||
const base::CommandLine& command_line) { | ||
// Check for Windows 8 specific commandlines requesting that this process | ||
// either connect to an existing viewer or launch a new viewer and | ||
// synchronously wait for it to connect. | ||
|
||
bool launch = command_line.HasSwitch(switches::kViewerLaunchViaAppId); | ||
bool connect = (launch || | ||
(command_line.HasSwitch(switches::kViewerConnect) && | ||
!metro_viewer_process_host_.get())); | ||
if (!connect) | ||
return; | ||
// Create a host to connect to the Metro viewer process over IPC. | ||
metro_viewer_process_host_.reset(new ChromeMetroViewerProcessHost()); | ||
if (launch) { | ||
CHECK(metro_viewer_process_host_->LaunchViewerAndWaitForConnection( | ||
command_line.GetSwitchValueNative( | ||
switches::kViewerLaunchViaAppId))); | ||
} | ||
} | ||
|
||
void BrowserProcessPlatformPart::Observe( | ||
int type, | ||
const content::NotificationSource& source, | ||
const content::NotificationDetails& details) { | ||
|
||
DCHECK(type == chrome::NOTIFICATION_APP_TERMINATING); | ||
PrefService* pref_service = g_browser_process->local_state(); | ||
bool is_relaunch = pref_service->GetBoolean(prefs::kWasRestarted); | ||
if (is_relaunch) { | ||
// TODO(scottmg): A lot of this can be removed http://crbug.com/558054. | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
// Copyright (c) 2013 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. | ||
|
||
#ifndef CHROME_BROWSER_BROWSER_PROCESS_PLATFORM_PART_AURAWIN_H_ | ||
#define CHROME_BROWSER_BROWSER_PROCESS_PLATFORM_PART_AURAWIN_H_ | ||
|
||
#include "base/compiler_specific.h" | ||
#include "base/macros.h" | ||
#include "base/memory/scoped_ptr.h" | ||
#include "chrome/browser/browser_process_platform_part_base.h" | ||
#include "content/public/browser/notification_observer.h" | ||
#include "content/public/browser/notification_registrar.h" | ||
|
||
class ChromeMetroViewerProcessHost; | ||
|
||
class BrowserProcessPlatformPart : public BrowserProcessPlatformPartBase, | ||
public content::NotificationObserver { | ||
public: | ||
BrowserProcessPlatformPart(); | ||
~BrowserProcessPlatformPart() override; | ||
|
||
// Invoked when the ASH metro viewer process on Windows 8 exits. | ||
void OnMetroViewerProcessTerminated(); | ||
|
||
// Overridden from BrowserProcessPlatformPartBase: | ||
void PlatformSpecificCommandLineProcessing( | ||
const base::CommandLine& command_line) override; | ||
|
||
// content::NotificationObserver method: | ||
void Observe(int type, | ||
const content::NotificationSource& source, | ||
const content::NotificationDetails& details) override; | ||
|
||
private: | ||
// Hosts the channel for the Windows 8 metro viewer process which runs in | ||
// the ASH environment. | ||
scoped_ptr<ChromeMetroViewerProcessHost> metro_viewer_process_host_; | ||
|
||
content::NotificationRegistrar registrar_; | ||
|
||
DISALLOW_COPY_AND_ASSIGN(BrowserProcessPlatformPart); | ||
}; | ||
|
||
#endif // CHROME_BROWSER_BROWSER_PROCESS_PLATFORM_PART_AURAWIN_H_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
include_rules = [ | ||
"+win8/viewer", | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
ananta@chromium.org | ||
cpu@chromium.org | ||
scottmg@chromium.org |
Oops, something went wrong.