OLD | NEW |
---|---|
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "chrome/browser/ui/views/apps/chrome_native_app_window_views_aura_ash.h " | 5 #include "chrome/browser/ui/views/apps/chrome_native_app_window_views_aura_ash.h " |
6 | 6 |
7 #include "apps/ui/views/app_window_frame_view.h" | 7 #include "apps/ui/views/app_window_frame_view.h" |
8 #include "ash/ash_constants.h" | 8 #include "ash/ash_constants.h" |
9 #include "ash/ash_switches.h" | 9 #include "ash/ash_switches.h" |
10 #include "ash/frame/custom_frame_view_ash.h" | 10 #include "ash/frame/custom_frame_view_ash.h" |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
124 | 124 |
125 ChromeNativeAppWindowViewsAuraAsh::ChromeNativeAppWindowViewsAuraAsh() {} | 125 ChromeNativeAppWindowViewsAuraAsh::ChromeNativeAppWindowViewsAuraAsh() {} |
126 | 126 |
127 ChromeNativeAppWindowViewsAuraAsh::~ChromeNativeAppWindowViewsAuraAsh() {} | 127 ChromeNativeAppWindowViewsAuraAsh::~ChromeNativeAppWindowViewsAuraAsh() {} |
128 | 128 |
129 void ChromeNativeAppWindowViewsAuraAsh::InitializeWindow( | 129 void ChromeNativeAppWindowViewsAuraAsh::InitializeWindow( |
130 AppWindow* app_window, | 130 AppWindow* app_window, |
131 const AppWindow::CreateParams& create_params) { | 131 const AppWindow::CreateParams& create_params) { |
132 ChromeNativeAppWindowViewsAura::InitializeWindow(app_window, create_params); | 132 ChromeNativeAppWindowViewsAura::InitializeWindow(app_window, create_params); |
133 aura::Window* window = widget()->GetNativeWindow(); | 133 aura::Window* window = widget()->GetNativeWindow(); |
134 window->SetProperty(aura::client::kAppIdKey, | |
James Cook
2017/05/04 16:38:49
Just for my understanding: Where does the window p
msw
2017/05/04 19:05:58
It's done by ExtensionAppWindowLauncherController:
James Cook
2017/05/04 19:45:08
This SGTM.
| |
135 new std::string(app_window->extension_id())); | |
136 | 134 |
137 if (app_window->window_type_is_panel()) { | 135 if (app_window->window_type_is_panel()) { |
138 // Ash's ShelfWindowWatcher handles app panel windows once this type is set. | 136 // Ash's ShelfWindowWatcher handles app panel windows once this type is set. |
139 // The type should have been initialized for mash below, via mus_properties. | 137 // The type should have been initialized for mash below, via mus_properties. |
140 if (!ash_util::IsRunningInMash()) | 138 if (!ash_util::IsRunningInMash()) |
141 window->SetProperty<int>(ash::kShelfItemTypeKey, ash::TYPE_APP_PANEL); | 139 window->SetProperty<int>(ash::kShelfItemTypeKey, ash::TYPE_APP_PANEL); |
142 } else { | 140 } else { |
143 window->SetProperty(aura::client::kAppType, | 141 window->SetProperty(aura::client::kAppType, |
144 static_cast<int>(ash::AppType::CHROME_APP)); | 142 static_cast<int>(ash::AppType::CHROME_APP)); |
145 } | 143 } |
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
373 window_tree_host->SetClientArea(insets, | 371 window_tree_host->SetClientArea(insets, |
374 std::move(additional_client_regions)); | 372 std::move(additional_client_regions)); |
375 } | 373 } |
376 } | 374 } |
377 | 375 |
378 void ChromeNativeAppWindowViewsAuraAsh::OnMenuClosed() { | 376 void ChromeNativeAppWindowViewsAuraAsh::OnMenuClosed() { |
379 menu_runner_.reset(); | 377 menu_runner_.reset(); |
380 menu_model_adapter_.reset(); | 378 menu_model_adapter_.reset(); |
381 menu_model_.reset(); | 379 menu_model_.reset(); |
382 } | 380 } |
OLD | NEW |