|
|
Chromium Code Reviews
Descriptionexo: Add ShellSurface::SetApplicationId.
The application ID identifies the general class of applications to which
the surface belongs. Chromium can use this to group multiple surfaces
together, or to determine how to launch a new application.
BUG=549781
TEST=exo_unittest --gtest_filter=ShellSurfaceTest.SetApplicationId
Committed: https://crrev.com/936be6f74b610c83c41f426a8fad5270507c02f6
Cr-Commit-Position: refs/heads/master@{#362930}
Patch Set 1 #Patch Set 2 : std::string #Patch Set 3 : rebase #Patch Set 4 : rebase #
Dependent Patchsets: Messages
Total messages: 28 (15 generated)
The CQ bit was checked by reveman@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1491843002/1 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1491843002/1
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: linux_chromium_chromeos_ozone_rel_ng on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...)
The CQ bit was checked by reveman@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1491843002/20001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1491843002/20001
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
reveman@chromium.org changed reviewers: + denniskempin@chromium.org, piman@chromium.org
lgtm
The CQ bit was checked by reveman@chromium.org
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1491843002/20001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1491843002/20001
The CQ bit was unchecked by commit-bot@chromium.org
Failed to apply patch for components/exo/shell_surface.cc:
While running git apply --index -3 -p1;
error: patch failed: components/exo/shell_surface.cc:138
Falling back to three-way merge...
Applied patch to 'components/exo/shell_surface.cc' with conflicts.
U components/exo/shell_surface.cc
Patch: components/exo/shell_surface.cc
Index: components/exo/shell_surface.cc
diff --git a/components/exo/shell_surface.cc b/components/exo/shell_surface.cc
index
dfcc0923b47838a12075e3bf404caaad0f793718..26abdd920505574666d2533a15534820110eec02
100644
--- a/components/exo/shell_surface.cc
+++ b/components/exo/shell_surface.cc
@@ -13,9 +13,12 @@
#include "base/trace_event/trace_event_argument.h"
#include "components/exo/surface.h"
#include "ui/aura/window.h"
+#include "ui/aura/window_property.h"
#include "ui/base/hit_test.h"
#include "ui/views/widget/widget.h"
+DECLARE_WINDOW_PROPERTY_TYPE(std::string*)
+
namespace exo {
namespace {
@@ -64,6 +67,8 @@ views::Widget::InitParams CreateWidgetInitParams(
////////////////////////////////////////////////////////////////////////////////
// ShellSurface, public:
+DEFINE_LOCAL_WINDOW_PROPERTY_KEY(std::string*, kApplicationIdKey, nullptr)
+
ShellSurface::ShellSurface(Surface* surface) : surface_(surface) {
surface_->SetSurfaceDelegate(this);
surface_->AddSurfaceObserver(this);
@@ -93,6 +98,7 @@ void ShellSurface::SetToplevel() {
widget_.reset(new views::Widget);
widget_->Init(params);
widget_->GetNativeWindow()->set_owned_by_parent(false);
+ SetApplicationId(widget_->GetNativeWindow(), &application_id_);
// The position of a standard top level shell surface is managed by Ash.
ash::wm::GetWindowState(widget_->GetNativeWindow())
@@ -112,6 +118,7 @@ void ShellSurface::SetMaximized() {
widget_.reset(new views::Widget);
widget_->Init(params);
widget_->GetNativeWindow()->set_owned_by_parent(false);
+ SetApplicationId(widget_->GetNativeWindow(), &application_id_);
}
void ShellSurface::SetFullscreen() {
@@ -127,6 +134,7 @@ void ShellSurface::SetFullscreen() {
widget_.reset(new views::Widget);
widget_->Init(params);
widget_->GetNativeWindow()->set_owned_by_parent(false);
+ SetApplicationId(widget_->GetNativeWindow(), &application_id_);
}
void ShellSurface::SetTitle(const base::string16& title) {
@@ -138,11 +146,31 @@ void ShellSurface::SetTitle(const base::string16& title) {
widget_->UpdateWindowTitle();
}
+// static
+void ShellSurface::SetApplicationId(aura::Window* window,
+ std::string* application_id) {
+ window->SetProperty(kApplicationIdKey, application_id);
+}
+
+// static
+const std::string ShellSurface::GetApplicationId(aura::Window* window) {
+ std::string* string_ptr = window->GetProperty(kApplicationIdKey);
+ return string_ptr ? *string_ptr : std::string();
+}
+
+void ShellSurface::SetApplicationId(const std::string& application_id) {
+ TRACE_EVENT1("exo", "ShellSurface::SetApplicationId", "application_id",
+ application_id);
+
+ application_id_ = application_id;
+}
+
scoped_refptr<base::trace_event::TracedValue> ShellSurface::AsTracedValue()
const {
scoped_refptr<base::trace_event::TracedValue> value =
new base::trace_event::TracedValue;
value->SetString("title", base::UTF16ToUTF8(title_));
+ value->SetString("application_id", application_id_);
return value;
}
The CQ bit was unchecked by commit-bot@chromium.org
The CQ bit was checked by reveman@chromium.org
The patchset sent to the CQ was uploaded after l-g-t-m from piman@chromium.org Link to the patchset: https://codereview.chromium.org/1491843002/#ps40001 (title: "rebase")
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1491843002/40001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1491843002/40001
The CQ bit was unchecked by commit-bot@chromium.org
Failed to apply patch for components/exo/shell_surface.cc:
While running git apply --index -3 -p1;
error: patch failed: components/exo/shell_surface.cc:93
Falling back to three-way merge...
Applied patch to 'components/exo/shell_surface.cc' with conflicts.
U components/exo/shell_surface.cc
Patch: components/exo/shell_surface.cc
Index: components/exo/shell_surface.cc
diff --git a/components/exo/shell_surface.cc b/components/exo/shell_surface.cc
index
dd6caba000c691fc0dc518366e4c58e35e326902..1bc82b4f7696f19c6cb484cd13a55978296c33cd
100644
--- a/components/exo/shell_surface.cc
+++ b/components/exo/shell_surface.cc
@@ -13,9 +13,12 @@
#include "base/trace_event/trace_event_argument.h"
#include "components/exo/surface.h"
#include "ui/aura/window.h"
+#include "ui/aura/window_property.h"
#include "ui/base/hit_test.h"
#include "ui/views/widget/widget.h"
+DECLARE_WINDOW_PROPERTY_TYPE(std::string*)
+
namespace exo {
namespace {
@@ -64,6 +67,8 @@ views::Widget::InitParams CreateWidgetInitParams(
////////////////////////////////////////////////////////////////////////////////
// ShellSurface, public:
+DEFINE_LOCAL_WINDOW_PROPERTY_KEY(std::string*, kApplicationIdKey, nullptr)
+
ShellSurface::ShellSurface(Surface* surface) : surface_(surface) {
surface_->SetSurfaceDelegate(this);
surface_->AddSurfaceObserver(this);
@@ -93,6 +98,7 @@ void ShellSurface::SetToplevel() {
widget_.reset(new views::Widget);
widget_->Init(params);
widget_->GetNativeWindow()->set_owned_by_parent(false);
+ SetApplicationId(widget_->GetNativeWindow(), &application_id_);
// The position of a standard top level shell surface is managed by Ash.
ash::wm::GetWindowState(widget_->GetNativeWindow())
@@ -112,6 +118,7 @@ void ShellSurface::SetMaximized() {
widget_.reset(new views::Widget);
widget_->Init(params);
widget_->GetNativeWindow()->set_owned_by_parent(false);
+ SetApplicationId(widget_->GetNativeWindow(), &application_id_);
}
void ShellSurface::SetFullscreen() {
@@ -127,6 +134,7 @@ void ShellSurface::SetFullscreen() {
widget_.reset(new views::Widget);
widget_->Init(params);
widget_->GetNativeWindow()->set_owned_by_parent(false);
+ SetApplicationId(widget_->GetNativeWindow(), &application_id_);
}
void ShellSurface::SetTitle(const base::string16& title) {
@@ -138,6 +146,25 @@ void ShellSurface::SetTitle(const base::string16& title) {
widget_->UpdateWindowTitle();
}
+// static
+void ShellSurface::SetApplicationId(aura::Window* window,
+ std::string* application_id) {
+ window->SetProperty(kApplicationIdKey, application_id);
+}
+
+// static
+const std::string ShellSurface::GetApplicationId(aura::Window* window) {
+ std::string* string_ptr = window->GetProperty(kApplicationIdKey);
+ return string_ptr ? *string_ptr : std::string();
+}
+
+void ShellSurface::SetApplicationId(const std::string& application_id) {
+ TRACE_EVENT1("exo", "ShellSurface::SetApplicationId", "application_id",
+ application_id);
+
+ application_id_ = application_id;
+}
+
void ShellSurface::Move() {
TRACE_EVENT0("exo", "ShellSurface::Move");
@@ -152,6 +179,7 @@ scoped_refptr<base::trace_event::TracedValue>
ShellSurface::AsTracedValue()
scoped_refptr<base::trace_event::TracedValue> value =
new base::trace_event::TracedValue;
value->SetString("title", base::UTF16ToUTF8(title_));
+ value->SetString("application_id", application_id_);
return value;
}
The CQ bit was unchecked by commit-bot@chromium.org
The CQ bit was checked by reveman@chromium.org
The patchset sent to the CQ was uploaded after l-g-t-m from piman@chromium.org Link to the patchset: https://codereview.chromium.org/1491843002/#ps60001 (title: "rebase")
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1491843002/60001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1491843002/60001
Message was sent while issue was closed.
Committed patchset #4 (id:60001)
Message was sent while issue was closed.
Description was changed from ========== exo: Add ShellSurface::SetApplicationId. The application ID identifies the general class of applications to which the surface belongs. Chromium can use this to group multiple surfaces together, or to determine how to launch a new application. BUG=549781 TEST=exo_unittest --gtest_filter=ShellSurfaceTest.SetApplicationId ========== to ========== exo: Add ShellSurface::SetApplicationId. The application ID identifies the general class of applications to which the surface belongs. Chromium can use this to group multiple surfaces together, or to determine how to launch a new application. BUG=549781 TEST=exo_unittest --gtest_filter=ShellSurfaceTest.SetApplicationId Committed: https://crrev.com/936be6f74b610c83c41f426a8fad5270507c02f6 Cr-Commit-Position: refs/heads/master@{#362930} ==========
Message was sent while issue was closed.
Patchset 4 (id:??) landed as https://crrev.com/936be6f74b610c83c41f426a8fad5270507c02f6 Cr-Commit-Position: refs/heads/master@{#362930} |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
