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

Side by Side Diff: chrome/browser/ui/ash/launcher/settings_window_observer.cc

Issue 2632543003: Refactor and push window properties up to class properties. (Closed)
Patch Set: More build fixes Created 3 years, 10 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 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/ash/launcher/settings_window_observer.h" 5 #include "chrome/browser/ui/ash/launcher/settings_window_observer.h"
6 6
7 #include "ash/common/shelf/shelf_item_types.h" 7 #include "ash/common/shelf/shelf_item_types.h"
8 #include "ash/resources/grit/ash_resources.h" 8 #include "ash/resources/grit/ash_resources.h"
9 #include "ash/wm/window_properties.h" 9 #include "ash/wm/window_properties.h"
10 #include "base/memory/ptr_util.h" 10 #include "base/memory/ptr_util.h"
11 #include "chrome/browser/ui/ash/ash_util.h" 11 #include "chrome/browser/ui/ash/ash_util.h"
12 #include "chrome/browser/ui/browser.h" 12 #include "chrome/browser/ui/browser.h"
13 #include "chrome/browser/ui/browser_window.h" 13 #include "chrome/browser/ui/browser_window.h"
14 #include "chrome/browser/ui/settings_window_manager.h" 14 #include "chrome/browser/ui/settings_window_manager.h"
15 #include "components/strings/grit/components_strings.h" 15 #include "components/strings/grit/components_strings.h"
16 #include "services/ui/public/interfaces/window_manager.mojom.h" 16 #include "services/ui/public/interfaces/window_manager.mojom.h"
17 #include "ui/aura/client/aura_constants.h" 17 #include "ui/aura/client/aura_constants.h"
18 #include "ui/aura/window.h" 18 #include "ui/aura/window.h"
19 #include "ui/aura/window_property.h" 19 #include "ui/base/class_property.h"
20 #include "ui/base/l10n/l10n_util.h" 20 #include "ui/base/l10n/l10n_util.h"
21 #include "ui/base/resource/resource_bundle.h" 21 #include "ui/base/resource/resource_bundle.h"
22 #include "ui/gfx/image/image_skia.h" 22 #include "ui/gfx/image/image_skia.h"
23 23
24 namespace { 24 namespace {
25 25
26 // This class is only used in classic ash to rename the Settings window. 26 // This class is only used in classic ash to rename the Settings window.
27 class AuraWindowSettingsTitleTracker : public aura::WindowTracker { 27 class AuraWindowSettingsTitleTracker : public aura::WindowTracker {
28 public: 28 public:
29 AuraWindowSettingsTitleTracker() {} 29 AuraWindowSettingsTitleTracker() {}
(...skipping 23 matching lines...) Expand all
53 void SettingsWindowObserver::OnNewSettingsWindow(Browser* settings_browser) { 53 void SettingsWindowObserver::OnNewSettingsWindow(Browser* settings_browser) {
54 aura::Window* window = settings_browser->window()->GetNativeWindow(); 54 aura::Window* window = settings_browser->window()->GetNativeWindow();
55 window->SetTitle(l10n_util::GetStringUTF16(IDS_SETTINGS_TITLE)); 55 window->SetTitle(l10n_util::GetStringUTF16(IDS_SETTINGS_TITLE));
56 window->SetProperty<int>(ash::kShelfItemTypeKey, ash::TYPE_DIALOG); 56 window->SetProperty<int>(ash::kShelfItemTypeKey, ash::TYPE_DIALOG);
57 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); 57 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();
58 gfx::ImageSkia* icon = rb.GetImageSkiaNamed(IDR_ASH_SHELF_ICON_SETTINGS); 58 gfx::ImageSkia* icon = rb.GetImageSkiaNamed(IDR_ASH_SHELF_ICON_SETTINGS);
59 // The new gfx::ImageSkia instance is owned by the window itself. 59 // The new gfx::ImageSkia instance is owned by the window itself.
60 window->SetProperty(aura::client::kWindowIconKey, new gfx::ImageSkia(*icon)); 60 window->SetProperty(aura::client::kWindowIconKey, new gfx::ImageSkia(*icon));
61 aura_window_tracker_->Add(window); 61 aura_window_tracker_->Add(window);
62 } 62 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698