Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(439)

Side by Side Diff: chrome/browser/extensions/api/top_sites/top_sites_api.cc

Issue 11522007: Move TopSites api from c/b/history to c/b/e/api (Closed) Base URL: http://git.chromium.org/chromium/src.git@dc_ungoop_history
Patch Set: Created 8 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/history/top_sites_extension_api.h" 5 #include "chrome/browser/extensions/api/top_sites/top_sites_api.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/values.h" 8 #include "base/values.h"
9 #include "chrome/browser/history/top_sites.h" 9 #include "chrome/browser/history/top_sites.h"
10 #include "chrome/browser/profiles/profile.h" 10 #include "chrome/browser/profiles/profile.h"
11 #include "chrome/browser/ui/webui/ntp/new_tab_ui.h" 11 #include "chrome/browser/ui/webui/ntp/new_tab_ui.h"
12 12
13 namespace extensions {
14
13 GetTopSitesFunction::GetTopSitesFunction() 15 GetTopSitesFunction::GetTopSitesFunction()
14 : ALLOW_THIS_IN_INITIALIZER_LIST(weak_ptr_factory_(this)) {} 16 : ALLOW_THIS_IN_INITIALIZER_LIST(weak_ptr_factory_(this)) {}
15 17
16 GetTopSitesFunction::~GetTopSitesFunction() {} 18 GetTopSitesFunction::~GetTopSitesFunction() {}
17 19
18 bool GetTopSitesFunction::RunImpl() { 20 bool GetTopSitesFunction::RunImpl() {
19 history::TopSites* ts = profile()->GetTopSites(); 21 history::TopSites* ts = profile()->GetTopSites();
20 if (!ts) 22 if (!ts)
21 return false; 23 return false;
22 24
(...skipping 15 matching lines...) Expand all
38 page_value->SetString("title", url.url.spec()); 40 page_value->SetString("title", url.url.spec());
39 else 41 else
40 page_value->SetString("title", url.title); 42 page_value->SetString("title", url.title);
41 pages_value->Append(page_value); 43 pages_value->Append(page_value);
42 } 44 }
43 } 45 }
44 46
45 SetResult(pages_value.release()); 47 SetResult(pages_value.release());
46 SendResponse(true); 48 SendResponse(true);
47 } 49 }
50
51 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/api/top_sites/top_sites_api.h ('k') | chrome/browser/extensions/api/top_sites/top_sites_apitest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698