OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/signin/screenlock_bridge.h" | 5 #include "chrome/browser/signin/screenlock_bridge.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/strings/string16.h" | 8 #include "base/strings/string16.h" |
9 #include "chrome/browser/profiles/profile_window.h" | 9 #include "chrome/browser/profiles/profile_window.h" |
10 #include "chrome/browser/signin/signin_manager_factory.h" | 10 #include "chrome/browser/signin/signin_manager_factory.h" |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 : autoshow_tooltip_(false), | 55 : autoshow_tooltip_(false), |
56 hardlock_on_click_(false) { | 56 hardlock_on_click_(false) { |
57 } | 57 } |
58 | 58 |
59 ScreenlockBridge::UserPodCustomIconOptions::~UserPodCustomIconOptions() {} | 59 ScreenlockBridge::UserPodCustomIconOptions::~UserPodCustomIconOptions() {} |
60 | 60 |
61 scoped_ptr<base::DictionaryValue> | 61 scoped_ptr<base::DictionaryValue> |
62 ScreenlockBridge::UserPodCustomIconOptions::ToDictionaryValue() const { | 62 ScreenlockBridge::UserPodCustomIconOptions::ToDictionaryValue() const { |
63 scoped_ptr<base::DictionaryValue> result(new base::DictionaryValue()); | 63 scoped_ptr<base::DictionaryValue> result(new base::DictionaryValue()); |
64 std::string icon_id = GetIdForIcon(icon_); | 64 std::string icon_id = GetIdForIcon(icon_); |
65 if (icon_id.empty()) | |
66 return result.Pass(); | |
67 | |
68 result->SetString("id", icon_id); | 65 result->SetString("id", icon_id); |
69 | 66 |
70 if (!tooltip_.empty()) { | 67 if (!tooltip_.empty()) { |
71 base::DictionaryValue* tooltip_options = new base::DictionaryValue(); | 68 base::DictionaryValue* tooltip_options = new base::DictionaryValue(); |
72 tooltip_options->SetString("text", tooltip_); | 69 tooltip_options->SetString("text", tooltip_); |
73 tooltip_options->SetBoolean("autoshow", autoshow_tooltip_); | 70 tooltip_options->SetBoolean("autoshow", autoshow_tooltip_); |
74 result->Set("tooltip", tooltip_options); | 71 result->Set("tooltip", tooltip_options); |
75 } | 72 } |
76 | 73 |
77 if (hardlock_on_click_) | 74 if (hardlock_on_click_) |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
146 lock_handler_->Unlock(GetAuthenticatedUserEmail(profile)); | 143 lock_handler_->Unlock(GetAuthenticatedUserEmail(profile)); |
147 } | 144 } |
148 | 145 |
149 void ScreenlockBridge::AddObserver(Observer* observer) { | 146 void ScreenlockBridge::AddObserver(Observer* observer) { |
150 observers_.AddObserver(observer); | 147 observers_.AddObserver(observer); |
151 } | 148 } |
152 | 149 |
153 void ScreenlockBridge::RemoveObserver(Observer* observer) { | 150 void ScreenlockBridge::RemoveObserver(Observer* observer) { |
154 observers_.RemoveObserver(observer); | 151 observers_.RemoveObserver(observer); |
155 } | 152 } |
OLD | NEW |