OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/session_state_delegate_stub.h" | 5 #include "ash/session_state_delegate_stub.h" |
6 | 6 |
7 #include "ash/shell.h" | 7 #include "ash/shell.h" |
8 #include "ash/shell/example_factory.h" | 8 #include "ash/shell/example_factory.h" |
| 9 #include "ash/shell_delegate.h" |
9 #include "base/strings/string16.h" | 10 #include "base/strings/string16.h" |
10 #include "base/strings/utf_string_conversions.h" | 11 #include "base/strings/utf_string_conversions.h" |
11 | 12 |
12 namespace ash { | 13 namespace ash { |
13 | 14 |
14 SessionStateDelegateStub::SessionStateDelegateStub() : screen_locked_(false) { | 15 SessionStateDelegateStub::SessionStateDelegateStub() : screen_locked_(false) { |
15 } | 16 } |
16 | 17 |
17 SessionStateDelegateStub::~SessionStateDelegateStub() { | 18 SessionStateDelegateStub::~SessionStateDelegateStub() { |
18 } | 19 } |
19 | 20 |
20 content::BrowserContext* | 21 content::BrowserContext* |
21 SessionStateDelegateStub::GetBrowserContextByIndex( | 22 SessionStateDelegateStub::GetBrowserContextByIndex( |
22 MultiProfileIndex index) { | 23 MultiProfileIndex index) { |
23 return NULL; | 24 return Shell::GetInstance()->delegate()->GetActiveBrowserContext(); |
| 25 } |
| 26 |
| 27 content::BrowserContext* |
| 28 SessionStateDelegateStub::GetBrowserContextForWindow( |
| 29 aura::Window* window) { |
| 30 return Shell::GetInstance()->delegate()->GetActiveBrowserContext(); |
24 } | 31 } |
25 | 32 |
26 int SessionStateDelegateStub::GetMaximumNumberOfLoggedInUsers() const { | 33 int SessionStateDelegateStub::GetMaximumNumberOfLoggedInUsers() const { |
27 return 3; | 34 return 3; |
28 } | 35 } |
29 | 36 |
30 int SessionStateDelegateStub::NumberOfLoggedInUsers() const { | 37 int SessionStateDelegateStub::NumberOfLoggedInUsers() const { |
31 return 1; | 38 return 1; |
32 } | 39 } |
33 | 40 |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 return "stub-user@domain.com"; | 79 return "stub-user@domain.com"; |
73 } | 80 } |
74 | 81 |
75 const std::string SessionStateDelegateStub::GetUserID( | 82 const std::string SessionStateDelegateStub::GetUserID( |
76 MultiProfileIndex index) const { | 83 MultiProfileIndex index) const { |
77 return GetUserEmail(index); | 84 return GetUserEmail(index); |
78 } | 85 } |
79 | 86 |
80 const gfx::ImageSkia& SessionStateDelegateStub::GetUserImage( | 87 const gfx::ImageSkia& SessionStateDelegateStub::GetUserImage( |
81 content::BrowserContext* context) const { | 88 content::BrowserContext* context) const { |
82 return null_image_; | 89 return user_image_; |
83 } | 90 } |
84 | 91 |
85 bool SessionStateDelegateStub::ShouldShowAvatar(aura::Window* window) { | 92 bool SessionStateDelegateStub::ShouldShowAvatar(aura::Window* window) { |
86 return false; | 93 return !user_image_.isNull(); |
87 } | 94 } |
88 | 95 |
89 void SessionStateDelegateStub::SwitchActiveUser(const std::string& user_id) { | 96 void SessionStateDelegateStub::SwitchActiveUser(const std::string& user_id) { |
90 } | 97 } |
91 | 98 |
92 void SessionStateDelegateStub::CycleActiveUser(CycleUser cycle_user) { | 99 void SessionStateDelegateStub::CycleActiveUser(CycleUser cycle_user) { |
93 } | 100 } |
94 | 101 |
95 void SessionStateDelegateStub::AddSessionStateObserver( | 102 void SessionStateDelegateStub::AddSessionStateObserver( |
96 ash::SessionStateObserver* observer) { | 103 ash::SessionStateObserver* observer) { |
97 } | 104 } |
98 | 105 |
99 void SessionStateDelegateStub::RemoveSessionStateObserver( | 106 void SessionStateDelegateStub::RemoveSessionStateObserver( |
100 ash::SessionStateObserver* observer) { | 107 ash::SessionStateObserver* observer) { |
101 } | 108 } |
102 | 109 |
103 } // namespace ash | 110 } // namespace ash |
OLD | NEW |