| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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 "chrome/browser/ui/libgtk2ui/app_indicator_icon.h" | 5 #include "chrome/browser/ui/libgtkui/app_indicator_icon.h" |
| 6 | 6 |
| 7 #include <dlfcn.h> | 7 #include <dlfcn.h> |
| 8 #include <gtk/gtk.h> | 8 #include <gtk/gtk.h> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| 11 #include "base/environment.h" | 11 #include "base/environment.h" |
| 12 #include "base/files/file_util.h" | 12 #include "base/files/file_util.h" |
| 13 #include "base/md5.h" | 13 #include "base/md5.h" |
| 14 #include "base/memory/ref_counted_memory.h" | 14 #include "base/memory/ref_counted_memory.h" |
| 15 #include "base/strings/stringprintf.h" | 15 #include "base/strings/stringprintf.h" |
| 16 #include "base/strings/utf_string_conversions.h" | 16 #include "base/strings/utf_string_conversions.h" |
| 17 #include "base/threading/sequenced_worker_pool.h" | 17 #include "base/threading/sequenced_worker_pool.h" |
| 18 #include "chrome/browser/ui/libgtk2ui/app_indicator_icon_menu.h" | 18 #include "chrome/browser/ui/libgtkui/app_indicator_icon_menu.h" |
| 19 #include "content/public/browser/browser_thread.h" | 19 #include "content/public/browser/browser_thread.h" |
| 20 #include "third_party/skia/include/core/SkBitmap.h" | 20 #include "third_party/skia/include/core/SkBitmap.h" |
| 21 #include "third_party/skia/include/core/SkCanvas.h" | 21 #include "third_party/skia/include/core/SkCanvas.h" |
| 22 #include "ui/base/models/menu_model.h" | 22 #include "ui/base/models/menu_model.h" |
| 23 #include "ui/gfx/codec/png_codec.h" | 23 #include "ui/gfx/codec/png_codec.h" |
| 24 #include "ui/gfx/image/image.h" | 24 #include "ui/gfx/image/image.h" |
| 25 #include "ui/gfx/image/image_skia.h" | 25 #include "ui/gfx/image/image_skia.h" |
| 26 | 26 |
| 27 namespace { | 27 namespace { |
| 28 | 28 |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 164 } | 164 } |
| 165 | 165 |
| 166 void DeleteTempDirectory(const base::FilePath& dir_path) { | 166 void DeleteTempDirectory(const base::FilePath& dir_path) { |
| 167 if (dir_path.empty()) | 167 if (dir_path.empty()) |
| 168 return; | 168 return; |
| 169 base::DeleteFile(dir_path, true); | 169 base::DeleteFile(dir_path, true); |
| 170 } | 170 } |
| 171 | 171 |
| 172 } // namespace | 172 } // namespace |
| 173 | 173 |
| 174 namespace libgtk2ui { | 174 namespace libgtkui { |
| 175 | 175 |
| 176 AppIndicatorIcon::AppIndicatorIcon(std::string id, | 176 AppIndicatorIcon::AppIndicatorIcon(std::string id, |
| 177 const gfx::ImageSkia& image, | 177 const gfx::ImageSkia& image, |
| 178 const base::string16& tool_tip) | 178 const base::string16& tool_tip) |
| 179 : id_(id), | 179 : id_(id), |
| 180 icon_(NULL), | 180 icon_(NULL), |
| 181 menu_model_(NULL), | 181 menu_model_(NULL), |
| 182 icon_change_count_(0), | 182 icon_change_count_(0), |
| 183 weak_factory_(this) { | 183 weak_factory_(this) { |
| 184 std::unique_ptr<base::Environment> env(base::Environment::Create()); | 184 std::unique_ptr<base::Environment> env(base::Environment::Create()); |
| (...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 387 tool_tip_.c_str(), | 387 tool_tip_.c_str(), |
| 388 base::Bind(&AppIndicatorIcon::OnClickActionReplacementMenuItemActivated, | 388 base::Bind(&AppIndicatorIcon::OnClickActionReplacementMenuItemActivated, |
| 389 base::Unretained(this))); | 389 base::Unretained(this))); |
| 390 } | 390 } |
| 391 | 391 |
| 392 void AppIndicatorIcon::OnClickActionReplacementMenuItemActivated() { | 392 void AppIndicatorIcon::OnClickActionReplacementMenuItemActivated() { |
| 393 if (delegate()) | 393 if (delegate()) |
| 394 delegate()->OnClick(); | 394 delegate()->OnClick(); |
| 395 } | 395 } |
| 396 | 396 |
| 397 } // namespace libgtk2ui | 397 } // namespace libgtkui |
| OLD | NEW |