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

Unified Diff: components/exo/shell_surface.cc

Issue 2889523003: Add kApplicationIdKey for ShellSurface::GetApplicationId and SetApplicationId (Closed)
Patch Set: Use DEFINE_OWNED_UI_CLASS_PROPERTY_KEY. Created 3 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/exo/shell_surface.cc
diff --git a/components/exo/shell_surface.cc b/components/exo/shell_surface.cc
index e4fff6f17a71d2ddb9ce98a97105c2dec3b6f52f..cee613102682d3d542ae61dfdd8b203b824a89f4 100644
--- a/components/exo/shell_surface.cc
+++ b/components/exo/shell_surface.cc
@@ -313,6 +313,14 @@ ShellSurface::ScopedAnimationsDisabled::~ScopedAnimationsDisabled() {
DEFINE_LOCAL_UI_CLASS_PROPERTY_KEY(Surface*, kMainSurfaceKey, nullptr)
+namespace {
reveman 2017/05/17 15:31:06 nit: for consistency, please remove this namespace
yawano 2017/05/18 02:06:28 Done. Moved it to the anonymous namespace at the t
+
+// An application Id which is set by a wayland server. This property is not
reveman 2017/05/17 15:31:06 This code should not be referring to wayland. How
yawano 2017/05/18 02:06:28 Done.
+// exported.
+DEFINE_OWNED_UI_CLASS_PROPERTY_KEY(std::string, kExoAppIdKey, nullptr);
+
+} // namespace
+
ShellSurface::ShellSurface(Surface* surface,
ShellSurface* parent,
BoundsMode bounds_mode,
@@ -555,14 +563,13 @@ void ShellSurface::UpdateSystemModal() {
void ShellSurface::SetApplicationId(aura::Window* window,
const std::string& id) {
TRACE_EVENT1("exo", "ShellSurface::SetApplicationId", "application_id", id);
- const ash::ShelfID shelf_id(id);
- window->SetProperty(ash::kShelfIDKey, new std::string(shelf_id.Serialize()));
+ window->SetProperty(kExoAppIdKey, new std::string(id));
}
// static
const std::string ShellSurface::GetApplicationId(aura::Window* window) {
reveman 2017/05/17 15:31:06 can this return a pointer instead so we don't have
yawano 2017/05/18 02:06:28 Done.
- return ash::ShelfID::Deserialize(window->GetProperty(ash::kShelfIDKey))
- .app_id;
+ std::string* string_ptr = window->GetProperty(kExoAppIdKey);
+ return string_ptr ? *string_ptr : std::string();
}
void ShellSurface::SetApplicationId(const std::string& application_id) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698