| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/ui/webui/ntp/favicon_webui_handler.h" | 5 #include "chrome/browser/ui/webui/ntp/favicon_webui_handler.h" |
| 6 | 6 |
| 7 #include "base/callback.h" | 7 #include "base/callback.h" |
| 8 #include "base/string_util.h" | 8 #include "base/string_util.h" |
| 9 #include "base/stringprintf.h" |
| 9 #include "base/values.h" | 10 #include "base/values.h" |
| 10 #include "chrome/browser/profiles/profile.h" | 11 #include "chrome/browser/profiles/profile.h" |
| 11 #include "chrome/common/url_constants.h" | 12 #include "chrome/common/url_constants.h" |
| 12 #include "grit/ui_resources.h" | 13 #include "grit/ui_resources.h" |
| 13 #include "third_party/skia/include/core/SkBitmap.h" | 14 #include "third_party/skia/include/core/SkBitmap.h" |
| 14 #include "ui/gfx/codec/png_codec.h" | 15 #include "ui/gfx/codec/png_codec.h" |
| 15 #include "ui/gfx/color_analysis.h" | 16 #include "ui/gfx/color_analysis.h" |
| 16 | 17 |
| 17 FaviconWebUIHandler::FaviconWebUIHandler() { | 18 FaviconWebUIHandler::FaviconWebUIHandler() { |
| 18 } | 19 } |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 SkColorGetG(color), | 73 SkColorGetG(color), |
| 73 SkColorGetB(color)); | 74 SkColorGetB(color)); |
| 74 color_value.reset(new StringValue(css_color)); | 75 color_value.reset(new StringValue(css_color)); |
| 75 } else { | 76 } else { |
| 76 color_value.reset(new StringValue("#919191")); | 77 color_value.reset(new StringValue("#919191")); |
| 77 } | 78 } |
| 78 | 79 |
| 79 web_ui_->CallJavascriptFunction(callbacks_map_[id], id_value, *color_value); | 80 web_ui_->CallJavascriptFunction(callbacks_map_[id], id_value, *color_value); |
| 80 callbacks_map_.erase(id); | 81 callbacks_map_.erase(id); |
| 81 } | 82 } |
| OLD | NEW |