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

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

Issue 2332393003: mash: Remove shelf util functions; use WmWindow properties. (Closed)
Patch Set: Address comments. Created 4 years, 3 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
« no previous file with comments | « chrome/browser/ui/views/profiles/user_manager_view.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/resources/grit/ash_resources.h" // nogncheck 37 #include "ash/common/shelf/shelf_item_types.h" // nogncheck
38 #include "ash/shelf/shelf_util.h" // nogncheck 38 #include "ash/common/wm_lookup.h" // nogncheck
39 #include "ash/wm/window_util.h" // nogncheck 39 #include "ash/common/wm_window.h" // nogncheck
40 #include "ash/common/wm_window_property.h" // nogncheck
41 #include "ash/resources/grit/ash_resources.h" // nogncheck
42 #include "ash/wm/window_util.h" // nogncheck
40 #endif // defined(USE_ASH) 43 #endif // defined(USE_ASH)
41 44
42 #if defined(OS_WIN) 45 #if defined(OS_WIN)
43 #include "chrome/browser/shell_integration_win.h" 46 #include "chrome/browser/shell_integration_win.h"
44 #include "ui/base/win/shell.h" 47 #include "ui/base/win/shell.h"
45 #include "ui/views/win/hwnd_util.h" 48 #include "ui/views/win/hwnd_util.h"
46 #endif // defined(OS_WIN) 49 #endif // defined(OS_WIN)
47 50
48 namespace task_manager { 51 namespace task_manager {
49 52
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 96
94 g_task_manager_view->SelectTaskOfActiveTab(browser); 97 g_task_manager_view->SelectTaskOfActiveTab(browser);
95 g_task_manager_view->GetWidget()->Show(); 98 g_task_manager_view->GetWidget()->Show();
96 99
97 // Set the initial focus to the list of tasks. 100 // Set the initial focus to the list of tasks.
98 views::FocusManager* focus_manager = g_task_manager_view->GetFocusManager(); 101 views::FocusManager* focus_manager = g_task_manager_view->GetFocusManager();
99 if (focus_manager) 102 if (focus_manager)
100 focus_manager->SetFocusedView(g_task_manager_view->tab_table_); 103 focus_manager->SetFocusedView(g_task_manager_view->tab_table_);
101 104
102 #if defined(USE_ASH) 105 #if defined(USE_ASH)
103 gfx::NativeWindow native_window = 106 ash::WmWindow* wm_window = ash::WmLookup::Get()->GetWindowForWidget(
104 g_task_manager_view->GetWidget()->GetNativeWindow(); 107 g_task_manager_view->GetWidget());
105 ash::SetShelfItemDetailsForDialogWindow( 108 ash::ShelfItemDetails item_details;
106 native_window, IDR_ASH_SHELF_ICON_TASK_MANAGER, native_window->title()); 109 item_details.type = ash::TYPE_DIALOG;
110 item_details.image_resource_id = IDR_ASH_SHELF_ICON_TASK_MANAGER;
111 item_details.title = wm_window->GetTitle();
112 wm_window->SetShelfItemDetails(item_details);
107 #endif 113 #endif
108 return g_task_manager_view->table_model_.get(); 114 return g_task_manager_view->table_model_.get();
109 } 115 }
110 116
111 // static 117 // static
112 void TaskManagerView::Hide() { 118 void TaskManagerView::Hide() {
113 if (g_task_manager_view) 119 if (g_task_manager_view)
114 g_task_manager_view->GetWidget()->Close(); 120 g_task_manager_view->GetWidget()->Close();
115 } 121 }
116 122
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after
357 if (!g_browser_process->local_state()) 363 if (!g_browser_process->local_state())
358 return; 364 return;
359 365
360 const base::DictionaryValue* dictionary = 366 const base::DictionaryValue* dictionary =
361 g_browser_process->local_state()->GetDictionary(GetWindowName()); 367 g_browser_process->local_state()->GetDictionary(GetWindowName());
362 if (dictionary) 368 if (dictionary)
363 dictionary->GetBoolean("always_on_top", &is_always_on_top_); 369 dictionary->GetBoolean("always_on_top", &is_always_on_top_);
364 } 370 }
365 371
366 } // namespace task_manager 372 } // namespace task_manager
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/profiles/user_manager_view.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698