| Index: components/exo/shell_surface.cc
|
| diff --git a/components/exo/shell_surface.cc b/components/exo/shell_surface.cc
|
| index 92fb6e0772851f374ec0a5ad6072b55a8248ba85..2811720b5f539457fa0e57e307e7fc6b023eb61d 100644
|
| --- a/components/exo/shell_surface.cc
|
| +++ b/components/exo/shell_surface.cc
|
| @@ -43,8 +43,6 @@
|
| #include "chromeos/audio/chromeos_sounds.h"
|
| #endif
|
|
|
| -DECLARE_WINDOW_PROPERTY_TYPE(std::string*)
|
| -
|
| namespace exo {
|
| namespace {
|
|
|
| @@ -329,7 +327,6 @@ ShellSurface::ScopedAnimationsDisabled::~ScopedAnimationsDisabled() {
|
| ////////////////////////////////////////////////////////////////////////////////
|
| // ShellSurface, public:
|
|
|
| -DEFINE_LOCAL_WINDOW_PROPERTY_KEY(std::string*, kApplicationIdKey, nullptr)
|
| DEFINE_LOCAL_WINDOW_PROPERTY_KEY(Surface*, kMainSurfaceKey, nullptr)
|
|
|
| ShellSurface::ShellSurface(Surface* surface,
|
| @@ -532,21 +529,22 @@ void ShellSurface::SetSystemModal(bool system_modal) {
|
|
|
| // static
|
| void ShellSurface::SetApplicationId(aura::Window* window,
|
| - std::string* application_id) {
|
| - window->SetProperty(kApplicationIdKey, application_id);
|
| + const std::string& id) {
|
| + TRACE_EVENT1("exo", "ShellSurface::SetApplicationId", "application_id", id);
|
| + window->SetProperty(aura::client::kAppIdKey, new std::string(id));
|
| }
|
|
|
| // static
|
| const std::string ShellSurface::GetApplicationId(aura::Window* window) {
|
| - std::string* string_ptr = window->GetProperty(kApplicationIdKey);
|
| + std::string* string_ptr = window->GetProperty(aura::client::kAppIdKey);
|
| return string_ptr ? *string_ptr : std::string();
|
| }
|
|
|
| void ShellSurface::SetApplicationId(const std::string& application_id) {
|
| - TRACE_EVENT1("exo", "ShellSurface::SetApplicationId", "application_id",
|
| - application_id);
|
| -
|
| + // Store the value in |application_id_| in case the window does not exist yet.
|
| application_id_ = application_id;
|
| + if (widget_ && widget_->GetNativeWindow())
|
| + SetApplicationId(widget_->GetNativeWindow(), application_id);
|
| }
|
|
|
| void ShellSurface::Move() {
|
| @@ -626,7 +624,10 @@ std::unique_ptr<base::trace_event::TracedValue> ShellSurface::AsTracedValue()
|
| std::unique_ptr<base::trace_event::TracedValue> value(
|
| new base::trace_event::TracedValue());
|
| value->SetString("title", base::UTF16ToUTF8(title_));
|
| - value->SetString("application_id", application_id_);
|
| + std::string application_id;
|
| + if (GetWidget() && GetWidget()->GetNativeWindow())
|
| + application_id = GetApplicationId(GetWidget()->GetNativeWindow());
|
| + value->SetString("application_id", application_id);
|
| return value;
|
| }
|
|
|
| @@ -1023,7 +1024,7 @@ void ShellSurface::CreateShellSurfaceWidget(ui::WindowShowState show_state) {
|
| window->SetName("ExoShellSurface");
|
| window->AddChild(surface_->window());
|
| window->SetEventTargeter(base::WrapUnique(new CustomWindowTargeter(widget_)));
|
| - SetApplicationId(window, &application_id_);
|
| + SetApplicationId(window, application_id_);
|
| SetMainSurface(window, surface_);
|
|
|
| // Start tracking changes to window bounds and window state.
|
|
|