| 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/cocoa/history_menu_bridge.h" | 5 #include "chrome/browser/ui/cocoa/history_menu_bridge.h" |
| 6 | 6 |
| 7 #import <Cocoa/Cocoa.h> | 7 #import <Cocoa/Cocoa.h> |
| 8 | 8 |
| 9 #include <initializer_list> | 9 #include <initializer_list> |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 std::initializer_list<MockTRS::Entry*> entries) { | 103 std::initializer_list<MockTRS::Entry*> entries) { |
| 104 MockTRS::Entries ret; | 104 MockTRS::Entries ret; |
| 105 for (auto* entry : entries) | 105 for (auto* entry : entries) |
| 106 ret.emplace_back(entry); | 106 ret.emplace_back(entry); |
| 107 return ret; | 107 return ret; |
| 108 } | 108 } |
| 109 | 109 |
| 110 MockTRS::Tab* CreateSessionTab(SessionID::id_type id, | 110 MockTRS::Tab* CreateSessionTab(SessionID::id_type id, |
| 111 const std::string& url, | 111 const std::string& url, |
| 112 const std::string& title) { | 112 const std::string& title) { |
| 113 auto tab = new MockTRS::Tab; | 113 auto* tab = new MockTRS::Tab; |
| 114 tab->id = id; | 114 tab->id = id; |
| 115 tab->current_navigation_index = 0; | 115 tab->current_navigation_index = 0; |
| 116 tab->navigations.push_back( | 116 tab->navigations.push_back( |
| 117 sessions::SerializedNavigationEntryTestHelper::CreateNavigation(url, | 117 sessions::SerializedNavigationEntryTestHelper::CreateNavigation(url, |
| 118 title)); | 118 title)); |
| 119 return tab; | 119 return tab; |
| 120 } | 120 } |
| 121 | 121 |
| 122 MockTRS::Window* CreateSessionWindow( | 122 MockTRS::Window* CreateSessionWindow( |
| 123 SessionID::id_type id, | 123 SessionID::id_type id, |
| 124 std::initializer_list<MockTRS::Tab*> tabs) { | 124 std::initializer_list<MockTRS::Tab*> tabs) { |
| 125 auto window = new MockTRS::Window; | 125 auto* window = new MockTRS::Window; |
| 126 window->id = id; | 126 window->id = id; |
| 127 window->tabs.reserve(tabs.size()); | 127 window->tabs.reserve(tabs.size()); |
| 128 for (auto* tab : tabs) | 128 for (auto* tab : tabs) |
| 129 window->tabs.emplace_back(std::move(tab)); | 129 window->tabs.emplace_back(std::move(tab)); |
| 130 return window; | 130 return window; |
| 131 } | 131 } |
| 132 | 132 |
| 133 void GetFaviconForHistoryItem(HistoryMenuBridge::HistoryItem* item) { | 133 void GetFaviconForHistoryItem(HistoryMenuBridge::HistoryItem* item) { |
| 134 bridge_->GetFaviconForHistoryItem(item); | 134 bridge_->GetFaviconForHistoryItem(item); |
| 135 } | 135 } |
| (...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 364 image_result.image = gfx::Image::CreateFrom1xBitmap(bitmap); | 364 image_result.image = gfx::Image::CreateFrom1xBitmap(bitmap); |
| 365 GotFaviconData(&item, image_result); | 365 GotFaviconData(&item, image_result); |
| 366 | 366 |
| 367 // Make sure the callback works. | 367 // Make sure the callback works. |
| 368 EXPECT_FALSE(item.icon_requested); | 368 EXPECT_FALSE(item.icon_requested); |
| 369 EXPECT_TRUE(item.icon.get()); | 369 EXPECT_TRUE(item.icon.get()); |
| 370 EXPECT_TRUE([item.menu_item image]); | 370 EXPECT_TRUE([item.menu_item image]); |
| 371 } | 371 } |
| 372 | 372 |
| 373 } // namespace | 373 } // namespace |
| OLD | NEW |