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

Side by Side Diff: ash/shell/shell_delegate_impl.cc

Issue 2910773002: cros: CustomFrameViewAsh avatar icon from a window prop (Closed)
Patch Set: add test Created 3 years, 6 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 | « ash/shell/shell_delegate_impl.h ('k') | ash/shell_delegate.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "ash/shell/shell_delegate_impl.h" 5 #include "ash/shell/shell_delegate_impl.h"
6 6
7 #include "ash/accessibility_delegate.h" 7 #include "ash/accessibility_delegate.h"
8 #include "ash/default_accessibility_delegate.h" 8 #include "ash/default_accessibility_delegate.h"
9 #include "ash/default_wallpaper_delegate.h" 9 #include "ash/default_wallpaper_delegate.h"
10 #include "ash/gpu_support_stub.h" 10 #include "ash/gpu_support_stub.h"
11 #include "ash/palette_delegate.h" 11 #include "ash/palette_delegate.h"
12 #include "ash/public/cpp/shell_window_ids.h" 12 #include "ash/public/cpp/shell_window_ids.h"
13 #include "ash/session/session_state_delegate.h"
14 #include "ash/shell.h" 13 #include "ash/shell.h"
15 #include "ash/shell/context_menu.h" 14 #include "ash/shell/context_menu.h"
16 #include "ash/shell/example_factory.h" 15 #include "ash/shell/example_factory.h"
17 #include "ash/shell/toplevel_window.h" 16 #include "ash/shell/toplevel_window.h"
18 #include "ash/test/test_keyboard_ui.h" 17 #include "ash/test/test_keyboard_ui.h"
19 #include "ash/test/test_system_tray_delegate.h" 18 #include "ash/test/test_system_tray_delegate.h"
20 #include "ash/wm/window_state.h" 19 #include "ash/wm/window_state.h"
21 #include "base/memory/ptr_util.h" 20 #include "base/memory/ptr_util.h"
22 #include "base/message_loop/message_loop.h" 21 #include "base/message_loop/message_loop.h"
23 #include "base/strings/utf_string_conversions.h" 22 #include "base/strings/utf_string_conversions.h"
(...skipping 28 matching lines...) Expand all
52 } 51 }
53 void CancelPartialScreenshot() override {} 52 void CancelPartialScreenshot() override {}
54 bool IsMetalayerSupported() override { return false; } 53 bool IsMetalayerSupported() override { return false; }
55 void ShowMetalayer(const base::Closure& closed) override {} 54 void ShowMetalayer(const base::Closure& closed) override {}
56 void HideMetalayer() override {} 55 void HideMetalayer() override {}
57 56
58 private: 57 private:
59 DISALLOW_COPY_AND_ASSIGN(PaletteDelegateImpl); 58 DISALLOW_COPY_AND_ASSIGN(PaletteDelegateImpl);
60 }; 59 };
61 60
62 class SessionStateDelegateImpl : public SessionStateDelegate {
63 public:
64 SessionStateDelegateImpl() : user_info_(new user_manager::UserInfoImpl()) {}
65
66 ~SessionStateDelegateImpl() override {}
67
68 // SessionStateDelegate:
69 bool ShouldShowAvatar(WmWindow* window) const override {
70 return !user_info_->GetImage().isNull();
71 }
72 gfx::ImageSkia GetAvatarImageForWindow(WmWindow* window) const override {
73 return gfx::ImageSkia();
74 }
75
76 private:
77 // A pseudo user info.
78 std::unique_ptr<user_manager::UserInfo> user_info_;
79
80 DISALLOW_COPY_AND_ASSIGN(SessionStateDelegateImpl);
81 };
82
83 } // namespace 61 } // namespace
84 62
85 ShellDelegateImpl::ShellDelegateImpl() {} 63 ShellDelegateImpl::ShellDelegateImpl() {}
86 64
87 ShellDelegateImpl::~ShellDelegateImpl() {} 65 ShellDelegateImpl::~ShellDelegateImpl() {}
88 66
89 ::service_manager::Connector* ShellDelegateImpl::GetShellConnector() const { 67 ::service_manager::Connector* ShellDelegateImpl::GetShellConnector() const {
90 return nullptr; 68 return nullptr;
91 } 69 }
92 70
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 108
131 SystemTrayDelegate* ShellDelegateImpl::CreateSystemTrayDelegate() { 109 SystemTrayDelegate* ShellDelegateImpl::CreateSystemTrayDelegate() {
132 return new test::TestSystemTrayDelegate; 110 return new test::TestSystemTrayDelegate;
133 } 111 }
134 112
135 std::unique_ptr<WallpaperDelegate> 113 std::unique_ptr<WallpaperDelegate>
136 ShellDelegateImpl::CreateWallpaperDelegate() { 114 ShellDelegateImpl::CreateWallpaperDelegate() {
137 return base::MakeUnique<DefaultWallpaperDelegate>(); 115 return base::MakeUnique<DefaultWallpaperDelegate>();
138 } 116 }
139 117
140 SessionStateDelegate* ShellDelegateImpl::CreateSessionStateDelegate() {
141 return new SessionStateDelegateImpl;
142 }
143
144 AccessibilityDelegate* ShellDelegateImpl::CreateAccessibilityDelegate() { 118 AccessibilityDelegate* ShellDelegateImpl::CreateAccessibilityDelegate() {
145 return new DefaultAccessibilityDelegate; 119 return new DefaultAccessibilityDelegate;
146 } 120 }
147 121
148 std::unique_ptr<PaletteDelegate> ShellDelegateImpl::CreatePaletteDelegate() { 122 std::unique_ptr<PaletteDelegate> ShellDelegateImpl::CreatePaletteDelegate() {
149 return base::MakeUnique<PaletteDelegateImpl>(); 123 return base::MakeUnique<PaletteDelegateImpl>();
150 } 124 }
151 125
152 ui::MenuModel* ShellDelegateImpl::CreateContextMenu(Shelf* shelf, 126 ui::MenuModel* ShellDelegateImpl::CreateContextMenu(Shelf* shelf,
153 const ShelfItem* item) { 127 const ShelfItem* item) {
(...skipping 22 matching lines...) Expand all
176 return true; 150 return true;
177 } 151 }
178 152
179 void ShellDelegateImpl::SetTouchscreenEnabledInPrefs(bool enabled, 153 void ShellDelegateImpl::SetTouchscreenEnabledInPrefs(bool enabled,
180 bool use_local_state) {} 154 bool use_local_state) {}
181 155
182 void ShellDelegateImpl::UpdateTouchscreenStatusFromPrefs() {} 156 void ShellDelegateImpl::UpdateTouchscreenStatusFromPrefs() {}
183 157
184 } // namespace shell 158 } // namespace shell
185 } // namespace ash 159 } // namespace ash
OLDNEW
« no previous file with comments | « ash/shell/shell_delegate_impl.h ('k') | ash/shell_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698