| 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/toolbar/back_forward_menu_model.h" | 5 #include "chrome/browser/ui/toolbar/back_forward_menu_model.h" |
| 6 | 6 |
| 7 #include "base/path_service.h" | 7 #include "base/path_service.h" |
| 8 #include "base/strings/string16.h" | 8 #include "base/strings/string16.h" |
| 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" |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 SkBitmap bitmap; | 38 SkBitmap bitmap; |
| 39 bitmap.allocN32Pixels(16, 16); | 39 bitmap.allocN32Pixels(16, 16); |
| 40 bitmap.eraseColor(color); | 40 bitmap.eraseColor(color); |
| 41 return bitmap; | 41 return bitmap; |
| 42 } | 42 } |
| 43 | 43 |
| 44 class FaviconDelegate : public ui::MenuModelDelegate { | 44 class FaviconDelegate : public ui::MenuModelDelegate { |
| 45 public: | 45 public: |
| 46 FaviconDelegate() : was_called_(false) {} | 46 FaviconDelegate() : was_called_(false) {} |
| 47 | 47 |
| 48 virtual void OnIconChanged(int model_index) OVERRIDE { | 48 virtual void OnIconChanged(int model_index) override { |
| 49 was_called_ = true; | 49 was_called_ = true; |
| 50 base::MessageLoop::current()->Quit(); | 50 base::MessageLoop::current()->Quit(); |
| 51 } | 51 } |
| 52 | 52 |
| 53 bool was_called() const { return was_called_; } | 53 bool was_called() const { return was_called_; } |
| 54 | 54 |
| 55 private: | 55 private: |
| 56 bool was_called_; | 56 bool was_called_; |
| 57 | 57 |
| 58 DISALLOW_COPY_AND_ASSIGN(FaviconDelegate); | 58 DISALLOW_COPY_AND_ASSIGN(FaviconDelegate); |
| (...skipping 500 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 559 // Verify we did get the expected favicon. | 559 // Verify we did get the expected favicon. |
| 560 EXPECT_EQ(0, memcmp(new_icon_bitmap.getPixels(), | 560 EXPECT_EQ(0, memcmp(new_icon_bitmap.getPixels(), |
| 561 valid_icon_bitmap.getPixels(), | 561 valid_icon_bitmap.getPixels(), |
| 562 new_icon_bitmap.getSize())); | 562 new_icon_bitmap.getSize())); |
| 563 | 563 |
| 564 // Make sure the browser deconstructor doesn't have problems. | 564 // Make sure the browser deconstructor doesn't have problems. |
| 565 browser->tab_strip_model()->CloseAllTabs(); | 565 browser->tab_strip_model()->CloseAllTabs(); |
| 566 // This is required to prevent the message loop from hanging. | 566 // This is required to prevent the message loop from hanging. |
| 567 profile()->DestroyHistoryService(); | 567 profile()->DestroyHistoryService(); |
| 568 } | 568 } |
| OLD | NEW |