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

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

Issue 2560973002: Remove unnecessary chrome window property util functions. (Closed)
Patch Set: Created 4 years 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/apps/chrome_native_app_window_views_aura_ash.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 22 matching lines...) Expand all
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 // Note: gn check complains here, despite the correct conditional //ash dep. 37 // Note: gn check complains here, despite the correct conditional //ash dep.
38 #include "ash/common/shelf/shelf_item_types.h" // nogncheck 38 #include "ash/common/shelf/shelf_item_types.h" // nogncheck
39 #include "ash/resources/grit/ash_resources.h" // nogncheck 39 #include "ash/resources/grit/ash_resources.h" // nogncheck
40 #include "ash/wm/window_properties.h" // nogncheck 40 #include "ash/wm/window_properties.h" // nogncheck
41 #include "ash/wm/window_util.h" // nogncheck 41 #include "ash/wm/window_util.h" // nogncheck
42 #include "chrome/browser/ui/ash/ash_util.h" // nogncheck 42 #include "chrome/browser/ui/ash/ash_util.h" // nogncheck
43 #include "chrome/browser/ui/ash/property_util.h" // nogncheck
44 #include "ui/aura/client/aura_constants.h" 43 #include "ui/aura/client/aura_constants.h"
45 #include "ui/base/resource/resource_bundle.h" 44 #include "ui/base/resource/resource_bundle.h"
46 #include "ui/gfx/image/image_skia.h" 45 #include "ui/gfx/image/image_skia.h"
47 #endif // defined(USE_ASH) 46 #endif // defined(USE_ASH)
48 47
49 #if defined(OS_WIN) 48 #if defined(OS_WIN)
50 #include "chrome/browser/shell_integration_win.h" 49 #include "chrome/browser/shell_integration_win.h"
51 #include "ui/base/win/shell.h" 50 #include "ui/base/win/shell.h"
52 #include "ui/views/win/hwnd_util.h" 51 #include "ui/views/win/hwnd_util.h"
53 #endif // defined(OS_WIN) 52 #endif // defined(OS_WIN)
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 g_task_manager_view->SelectTaskOfActiveTab(browser); 100 g_task_manager_view->SelectTaskOfActiveTab(browser);
102 g_task_manager_view->GetWidget()->Show(); 101 g_task_manager_view->GetWidget()->Show();
103 102
104 // Set the initial focus to the list of tasks. 103 // Set the initial focus to the list of tasks.
105 views::FocusManager* focus_manager = g_task_manager_view->GetFocusManager(); 104 views::FocusManager* focus_manager = g_task_manager_view->GetFocusManager();
106 if (focus_manager) 105 if (focus_manager)
107 focus_manager->SetFocusedView(g_task_manager_view->tab_table_); 106 focus_manager->SetFocusedView(g_task_manager_view->tab_table_);
108 107
109 #if defined(USE_ASH) 108 #if defined(USE_ASH)
110 aura::Window* window = g_task_manager_view->GetWidget()->GetNativeWindow(); 109 aura::Window* window = g_task_manager_view->GetWidget()->GetNativeWindow();
111 property_util::SetIntProperty(window, ash::kShelfItemTypeKey, 110 window->SetProperty<int>(ash::kShelfItemTypeKey, ash::TYPE_DIALOG);
112 ash::TYPE_DIALOG);
113 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); 111 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();
114 gfx::ImageSkia* icon = rb.GetImageSkiaNamed(IDR_ASH_SHELF_ICON_TASK_MANAGER); 112 gfx::ImageSkia* icon = rb.GetImageSkiaNamed(IDR_ASH_SHELF_ICON_TASK_MANAGER);
115 // The new gfx::ImageSkia instance is owned by the window itself. 113 // The new gfx::ImageSkia instance is owned by the window itself.
116 window->SetProperty(aura::client::kWindowIconKey, new gfx::ImageSkia(*icon)); 114 window->SetProperty(aura::client::kWindowIconKey, new gfx::ImageSkia(*icon));
117 #endif 115 #endif
118 return g_task_manager_view->table_model_.get(); 116 return g_task_manager_view->table_model_.get();
119 } 117 }
120 118
121 // static 119 // static
122 void TaskManagerView::Hide() { 120 void TaskManagerView::Hide() {
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after
367 if (!g_browser_process->local_state()) 365 if (!g_browser_process->local_state())
368 return; 366 return;
369 367
370 const base::DictionaryValue* dictionary = 368 const base::DictionaryValue* dictionary =
371 g_browser_process->local_state()->GetDictionary(GetWindowName()); 369 g_browser_process->local_state()->GetDictionary(GetWindowName());
372 if (dictionary) 370 if (dictionary)
373 dictionary->GetBoolean("always_on_top", &is_always_on_top_); 371 dictionary->GetBoolean("always_on_top", &is_always_on_top_);
374 } 372 }
375 373
376 } // namespace task_manager 374 } // namespace task_manager
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/apps/chrome_native_app_window_views_aura_ash.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698