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

Side by Side Diff: chrome/browser/ui/views/task_manager_view.cc

Issue 2381183002: mash: Fix shelf window property use in Chrome. (Closed)
Patch Set: Address comments. Created 4 years, 2 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 "chrome/browser/ui/views/task_manager_view.h" 5 #include "chrome/browser/ui/views/task_manager_view.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "build/build_config.h" 9 #include "build/build_config.h"
10 #include "chrome/browser/browser_process.h" 10 #include "chrome/browser/browser_process.h"
(...skipping 16 matching lines...) Expand all
27 #include "ui/views/border.h" 27 #include "ui/views/border.h"
28 #include "ui/views/controls/label.h" 28 #include "ui/views/controls/label.h"
29 #include "ui/views/controls/table/table_view.h" 29 #include "ui/views/controls/table/table_view.h"
30 #include "ui/views/layout/fill_layout.h" 30 #include "ui/views/layout/fill_layout.h"
31 #include "ui/views/layout/layout_constants.h" 31 #include "ui/views/layout/layout_constants.h"
32 #include "ui/views/view.h" 32 #include "ui/views/view.h"
33 #include "ui/views/widget/widget.h" 33 #include "ui/views/widget/widget.h"
34 #include "ui/views/window/dialog_client_view.h" 34 #include "ui/views/window/dialog_client_view.h"
35 35
36 #if defined(USE_ASH) 36 #if defined(USE_ASH)
37 #include "ash/common/shelf/shelf_item_types.h" // nogncheck 37 // Note: gn check complains here, despite the correct conditional //ash dep.
38 #include "ash/common/wm_lookup.h" // nogncheck 38 #include "ash/common/shelf/shelf_item_types.h" // nogncheck
39 #include "ash/common/wm_window.h" // nogncheck 39 #include "ash/resources/grit/ash_resources.h" // nogncheck
40 #include "ash/common/wm_window_property.h" // nogncheck 40 #include "ash/wm/window_properties.h" // nogncheck
41 #include "ash/resources/grit/ash_resources.h" // nogncheck 41 #include "ash/wm/window_util.h" // nogncheck
42 #include "ash/wm/window_util.h" // nogncheck 42 #include "chrome/browser/ui/ash/property_util.h" // nogncheck
43 #endif // defined(USE_ASH) 43 #endif // defined(USE_ASH)
44 44
45 #if defined(OS_WIN) 45 #if defined(OS_WIN)
46 #include "chrome/browser/shell_integration_win.h" 46 #include "chrome/browser/shell_integration_win.h"
47 #include "ui/base/win/shell.h" 47 #include "ui/base/win/shell.h"
48 #include "ui/views/win/hwnd_util.h" 48 #include "ui/views/win/hwnd_util.h"
49 #endif // defined(OS_WIN) 49 #endif // defined(OS_WIN)
50 50
51 namespace task_manager { 51 namespace task_manager {
52 52
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 96
97 g_task_manager_view->SelectTaskOfActiveTab(browser); 97 g_task_manager_view->SelectTaskOfActiveTab(browser);
98 g_task_manager_view->GetWidget()->Show(); 98 g_task_manager_view->GetWidget()->Show();
99 99
100 // Set the initial focus to the list of tasks. 100 // Set the initial focus to the list of tasks.
101 views::FocusManager* focus_manager = g_task_manager_view->GetFocusManager(); 101 views::FocusManager* focus_manager = g_task_manager_view->GetFocusManager();
102 if (focus_manager) 102 if (focus_manager)
103 focus_manager->SetFocusedView(g_task_manager_view->tab_table_); 103 focus_manager->SetFocusedView(g_task_manager_view->tab_table_);
104 104
105 #if defined(USE_ASH) 105 #if defined(USE_ASH)
106 ash::WmWindow* wm_window = ash::WmLookup::Get()->GetWindowForWidget( 106 aura::Window* aura_window =
107 g_task_manager_view->GetWidget()); 107 g_task_manager_view->GetWidget()->GetNativeWindow();
108 wm_window->SetIntProperty(ash::WmWindowProperty::SHELF_ITEM_TYPE, 108 property_util::SetIntProperty(aura_window, ash::kShelfItemTypeKey,
109 ash::TYPE_DIALOG); 109 ash::TYPE_DIALOG);
110 wm_window->SetIntProperty(ash::WmWindowProperty::SHELF_ICON_RESOURCE_ID, 110 property_util::SetIntProperty(aura_window, ash::kShelfIconResourceIdKey,
111 IDR_ASH_SHELF_ICON_TASK_MANAGER); 111 IDR_ASH_SHELF_ICON_TASK_MANAGER);
112 #endif 112 #endif
113 return g_task_manager_view->table_model_.get(); 113 return g_task_manager_view->table_model_.get();
114 } 114 }
115 115
116 // static 116 // static
117 void TaskManagerView::Hide() { 117 void TaskManagerView::Hide() {
118 if (g_task_manager_view) 118 if (g_task_manager_view)
119 g_task_manager_view->GetWidget()->Close(); 119 g_task_manager_view->GetWidget()->Close();
120 } 120 }
121 121
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after
362 if (!g_browser_process->local_state()) 362 if (!g_browser_process->local_state())
363 return; 363 return;
364 364
365 const base::DictionaryValue* dictionary = 365 const base::DictionaryValue* dictionary =
366 g_browser_process->local_state()->GetDictionary(GetWindowName()); 366 g_browser_process->local_state()->GetDictionary(GetWindowName());
367 if (dictionary) 367 if (dictionary)
368 dictionary->GetBoolean("always_on_top", &is_always_on_top_); 368 dictionary->GetBoolean("always_on_top", &is_always_on_top_);
369 } 369 }
370 370
371 } // namespace task_manager 371 } // namespace task_manager
OLDNEW
« no previous file with comments | « chrome/browser/ui/ash/property_util.cc ('k') | services/ui/public/interfaces/window_manager.mojom » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698