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

Unified Diff: ash/session_state_delegate_stub.cc

Issue 200483004: Show avatar icon on V2 app's frame (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/session_state_delegate_stub.h ('k') | ash/test/test_session_state_delegate.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/session_state_delegate_stub.cc
diff --git a/ash/session_state_delegate_stub.cc b/ash/session_state_delegate_stub.cc
index 7fc01da402071a79f67c67504e5895b8eb4b883d..dcbd346dfd478123008ebb3f243995d8b1be8c96 100644
--- a/ash/session_state_delegate_stub.cc
+++ b/ash/session_state_delegate_stub.cc
@@ -6,6 +6,7 @@
#include "ash/shell.h"
#include "ash/shell/example_factory.h"
+#include "ash/shell_delegate.h"
#include "base/strings/string16.h"
#include "base/strings/utf_string_conversions.h"
@@ -20,7 +21,13 @@ SessionStateDelegateStub::~SessionStateDelegateStub() {
content::BrowserContext*
SessionStateDelegateStub::GetBrowserContextByIndex(
MultiProfileIndex index) {
- return NULL;
+ return Shell::GetInstance()->delegate()->GetActiveBrowserContext();
+}
+
+content::BrowserContext*
+SessionStateDelegateStub::GetBrowserContextForWindow(
+ aura::Window* window) {
+ return Shell::GetInstance()->delegate()->GetActiveBrowserContext();
}
int SessionStateDelegateStub::GetMaximumNumberOfLoggedInUsers() const {
@@ -79,11 +86,11 @@ const std::string SessionStateDelegateStub::GetUserID(
const gfx::ImageSkia& SessionStateDelegateStub::GetUserImage(
content::BrowserContext* context) const {
- return null_image_;
+ return user_image_;
}
bool SessionStateDelegateStub::ShouldShowAvatar(aura::Window* window) {
- return false;
+ return !user_image_.isNull();
}
void SessionStateDelegateStub::SwitchActiveUser(const std::string& user_id) {
« no previous file with comments | « ash/session_state_delegate_stub.h ('k') | ash/test/test_session_state_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698