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

Side by Side Diff: components/exo/shell_surface.cc

Issue 2860503002: mash: Replace int ShelfIDs with AppLaunchID strings. (Closed)
Patch Set: Fix struct traits typo. 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "components/exo/shell_surface.h" 5 #include "components/exo/shell_surface.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "ash/frame/custom_frame_view_ash.h" 9 #include "ash/frame/custom_frame_view_ash.h"
10 #include "ash/public/cpp/shell_window_ids.h" 10 #include "ash/public/cpp/shell_window_ids.h"
(...skipping 537 matching lines...) Expand 10 before | Expand all | Expand 10 after
548 DCHECK_EQ(container_, ash::kShellWindowId_SystemModalContainer); 548 DCHECK_EQ(container_, ash::kShellWindowId_SystemModalContainer);
549 widget_->GetNativeWindow()->SetProperty( 549 widget_->GetNativeWindow()->SetProperty(
550 aura::client::kModalKey, 550 aura::client::kModalKey,
551 system_modal_ ? ui::MODAL_TYPE_SYSTEM : ui::MODAL_TYPE_NONE); 551 system_modal_ ? ui::MODAL_TYPE_SYSTEM : ui::MODAL_TYPE_NONE);
552 } 552 }
553 553
554 // static 554 // static
555 void ShellSurface::SetApplicationId(aura::Window* window, 555 void ShellSurface::SetApplicationId(aura::Window* window,
556 const std::string& id) { 556 const std::string& id) {
557 TRACE_EVENT1("exo", "ShellSurface::SetApplicationId", "application_id", id); 557 TRACE_EVENT1("exo", "ShellSurface::SetApplicationId", "application_id", id);
558 window->SetProperty(aura::client::kAppIdKey, new std::string(id)); 558 window->SetProperty(ash::kShelfIDKey, new ash::ShelfID(id));
559 } 559 }
560 560
561 // static 561 // static
562 const std::string ShellSurface::GetApplicationId(aura::Window* window) { 562 const std::string ShellSurface::GetApplicationId(aura::Window* window) {
563 std::string* string_ptr = window->GetProperty(aura::client::kAppIdKey); 563 ash::ShelfID* shelf_id = window->GetProperty(ash::kShelfIDKey);
564 return string_ptr ? *string_ptr : std::string(); 564 return shelf_id ? shelf_id->app_id : std::string();
565 } 565 }
566 566
567 void ShellSurface::SetApplicationId(const std::string& application_id) { 567 void ShellSurface::SetApplicationId(const std::string& application_id) {
568 // Store the value in |application_id_| in case the window does not exist yet. 568 // Store the value in |application_id_| in case the window does not exist yet.
569 application_id_ = application_id; 569 application_id_ = application_id;
570 if (widget_ && widget_->GetNativeWindow()) 570 if (widget_ && widget_->GetNativeWindow())
571 SetApplicationId(widget_->GetNativeWindow(), application_id); 571 SetApplicationId(widget_->GetNativeWindow(), application_id);
572 } 572 }
573 573
574 void ShellSurface::Move() { 574 void ShellSurface::Move() {
(...skipping 1159 matching lines...) Expand 10 before | Expand all | Expand 10 after
1734 gfx::Point ShellSurface::GetMouseLocation() const { 1734 gfx::Point ShellSurface::GetMouseLocation() const {
1735 aura::Window* const root_window = widget_->GetNativeWindow()->GetRootWindow(); 1735 aura::Window* const root_window = widget_->GetNativeWindow()->GetRootWindow();
1736 gfx::Point location = 1736 gfx::Point location =
1737 root_window->GetHost()->dispatcher()->GetLastMouseLocationInRoot(); 1737 root_window->GetHost()->dispatcher()->GetLastMouseLocationInRoot();
1738 aura::Window::ConvertPointToTarget( 1738 aura::Window::ConvertPointToTarget(
1739 root_window, widget_->GetNativeWindow()->parent(), &location); 1739 root_window, widget_->GetNativeWindow()->parent(), &location);
1740 return location; 1740 return location;
1741 } 1741 }
1742 1742
1743 } // namespace exo 1743 } // namespace exo
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/task_manager_view.cc ('k') | services/ui/public/interfaces/window_manager.mojom » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698