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 "base/bind.h" | 5 #include "base/bind.h" |
6 #include "base/memory/weak_ptr.h" | 6 #include "base/memory/weak_ptr.h" |
7 #include "base/message_loop/message_loop.h" | 7 #include "base/message_loop/message_loop.h" |
8 #include "base/path_service.h" | 8 #include "base/path_service.h" |
9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
10 #include "base/task/cancelable_task_tracker.h" | 10 #include "base/task/cancelable_task_tracker.h" |
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
230 // message loop. | 230 // message loop. |
231 void QuitCallback() { | 231 void QuitCallback() { |
232 base::MessageLoop::current()->Quit(); | 232 base::MessageLoop::current()->Quit(); |
233 } | 233 } |
234 | 234 |
235 // Adds a page to history. | 235 // Adds a page to history. |
236 void AddPageToHistory(const GURL& url) { | 236 void AddPageToHistory(const GURL& url) { |
237 RedirectList redirects; | 237 RedirectList redirects; |
238 redirects.push_back(url); | 238 redirects.push_back(url); |
239 history_service()->AddPage( | 239 history_service()->AddPage( |
240 url, base::Time::Now(), static_cast<void*>(this), 0, GURL(), | 240 url, base::Time::Now(), static_cast<ContextID>(this), 0, GURL(), |
241 redirects, content::PAGE_TRANSITION_TYPED, history::SOURCE_BROWSED, | 241 redirects, content::PAGE_TRANSITION_TYPED, history::SOURCE_BROWSED, |
242 false); | 242 false); |
243 } | 243 } |
244 | 244 |
245 // Adds a page to history. | 245 // Adds a page to history. |
246 void AddPageToHistory(const GURL& url, const base::string16& title) { | 246 void AddPageToHistory(const GURL& url, const base::string16& title) { |
247 RedirectList redirects; | 247 RedirectList redirects; |
248 redirects.push_back(url); | 248 redirects.push_back(url); |
249 history_service()->AddPage( | 249 history_service()->AddPage( |
250 url, base::Time::Now(), static_cast<void*>(this), 0, GURL(), | 250 url, base::Time::Now(), static_cast<ContextID>(this), 0, GURL(), |
251 redirects, content::PAGE_TRANSITION_TYPED, history::SOURCE_BROWSED, | 251 redirects, content::PAGE_TRANSITION_TYPED, history::SOURCE_BROWSED, |
252 false); | 252 false); |
253 history_service()->SetPageTitle(url, title); | 253 history_service()->SetPageTitle(url, title); |
254 } | 254 } |
255 | 255 |
256 // Adds a page to history. | 256 // Adds a page to history. |
257 void AddPageToHistory(const GURL& url, | 257 void AddPageToHistory(const GURL& url, |
258 const base::string16& title, | 258 const base::string16& title, |
259 const history::RedirectList& redirects, | 259 const history::RedirectList& redirects, |
260 base::Time time) { | 260 base::Time time) { |
261 history_service()->AddPage( | 261 history_service()->AddPage( |
262 url, time, static_cast<void*>(this), 0, GURL(), | 262 url, time, static_cast<ContextID>(this), 0, GURL(), |
263 redirects, content::PAGE_TRANSITION_TYPED, history::SOURCE_BROWSED, | 263 redirects, content::PAGE_TRANSITION_TYPED, history::SOURCE_BROWSED, |
264 false); | 264 false); |
265 history_service()->SetPageTitle(url, title); | 265 history_service()->SetPageTitle(url, title); |
266 } | 266 } |
267 | 267 |
268 // Delets a url. | 268 // Delets a url. |
269 void DeleteURL(const GURL& url) { | 269 void DeleteURL(const GURL& url) { |
270 history_service()->DeleteURL(url); | 270 history_service()->DeleteURL(url); |
271 } | 271 } |
272 | 272 |
(...skipping 1294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1567 ASSERT_EQ(orig_thumbnail.getSize(), thumbnail.getSize()); | 1567 ASSERT_EQ(orig_thumbnail.getSize(), thumbnail.getSize()); |
1568 orig_thumbnail.lockPixels(); | 1568 orig_thumbnail.lockPixels(); |
1569 thumbnail.lockPixels(); | 1569 thumbnail.lockPixels(); |
1570 EXPECT_EQ(0, memcmp(orig_thumbnail.getPixels(), thumbnail.getPixels(), | 1570 EXPECT_EQ(0, memcmp(orig_thumbnail.getPixels(), thumbnail.getPixels(), |
1571 orig_thumbnail.getSize())); | 1571 orig_thumbnail.getSize())); |
1572 thumbnail.unlockPixels(); | 1572 thumbnail.unlockPixels(); |
1573 orig_thumbnail.unlockPixels(); | 1573 orig_thumbnail.unlockPixels(); |
1574 } | 1574 } |
1575 | 1575 |
1576 } // namespace history | 1576 } // namespace history |
OLD | NEW |