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 (!aria_label_.empty()) | 74 if (!aria_label_.empty()) |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
154 lock_handler_->Unlock(GetAuthenticatedUserEmail(profile)); | 151 lock_handler_->Unlock(GetAuthenticatedUserEmail(profile)); |
155 } | 152 } |
156 | 153 |
157 void ScreenlockBridge::AddObserver(Observer* observer) { | 154 void ScreenlockBridge::AddObserver(Observer* observer) { |
158 observers_.AddObserver(observer); | 155 observers_.AddObserver(observer); |
159 } | 156 } |
160 | 157 |
161 void ScreenlockBridge::RemoveObserver(Observer* observer) { | 158 void ScreenlockBridge::RemoveObserver(Observer* observer) { |
162 observers_.RemoveObserver(observer); | 159 observers_.RemoveObserver(observer); |
163 } | 160 } |
OLD | NEW |