| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/views/status_icons/status_tray_win.h" | 5 #include "chrome/browser/ui/views/status_icons/status_tray_win.h" |
| 6 | 6 |
| 7 #include <commctrl.h> | 7 #include <commctrl.h> |
| 8 | 8 |
| 9 #include "base/strings/string_util.h" | 9 #include "base/strings/string_util.h" |
| 10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
| 11 #include "chrome/app/theme/grit/chrome_unscaled_resources.h" | |
| 12 #include "chrome/browser/status_icons/status_icon_menu_model.h" | 11 #include "chrome/browser/status_icons/status_icon_menu_model.h" |
| 13 #include "chrome/browser/status_icons/status_icon_observer.h" | 12 #include "chrome/browser/status_icons/status_icon_observer.h" |
| 14 #include "chrome/browser/ui/views/status_icons/status_icon_win.h" | 13 #include "chrome/browser/ui/views/status_icons/status_icon_win.h" |
| 14 #include "grit/chrome_unscaled_resources.h" |
| 15 #include "testing/gtest/include/gtest/gtest.h" | 15 #include "testing/gtest/include/gtest/gtest.h" |
| 16 #include "ui/base/resource/resource_bundle.h" | 16 #include "ui/base/resource/resource_bundle.h" |
| 17 #include "ui/gfx/image/image_skia.h" | 17 #include "ui/gfx/image/image_skia.h" |
| 18 | 18 |
| 19 class FakeStatusTrayStateChangerProxy : public StatusTrayStateChangerProxy { | 19 class FakeStatusTrayStateChangerProxy : public StatusTrayStateChangerProxy { |
| 20 public: | 20 public: |
| 21 FakeStatusTrayStateChangerProxy() | 21 FakeStatusTrayStateChangerProxy() |
| 22 : enqueue_called_(false), icon_id_(0), window_(NULL) {} | 22 : enqueue_called_(false), icon_id_(0), window_(NULL) {} |
| 23 | 23 |
| 24 virtual void EnqueueChange(UINT icon_id, HWND window) { | 24 virtual void EnqueueChange(UINT icon_id, HWND window) { |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 141 StatusIconWin* icon = static_cast<StatusIconWin*>(tray.CreateStatusIcon( | 141 StatusIconWin* icon = static_cast<StatusIconWin*>(tray.CreateStatusIcon( |
| 142 StatusTray::OTHER_ICON, *image, base::ASCIIToUTF16("tool tip"))); | 142 StatusTray::OTHER_ICON, *image, base::ASCIIToUTF16("tool tip"))); |
| 143 | 143 |
| 144 icon->ForceVisible(); | 144 icon->ForceVisible(); |
| 145 // |proxy| is owned by |tray|, and |tray| lives to the end of the scope, | 145 // |proxy| is owned by |tray|, and |tray| lives to the end of the scope, |
| 146 // so calling methods on |proxy| is safe. | 146 // so calling methods on |proxy| is safe. |
| 147 EXPECT_TRUE(proxy->enqueue_called()); | 147 EXPECT_TRUE(proxy->enqueue_called()); |
| 148 EXPECT_EQ(proxy->window(), icon->window()); | 148 EXPECT_EQ(proxy->window(), icon->window()); |
| 149 EXPECT_EQ(proxy->icon_id(), icon->icon_id()); | 149 EXPECT_EQ(proxy->icon_id(), icon->icon_id()); |
| 150 } | 150 } |
| OLD | NEW |