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

Side by Side Diff: chrome/browser/automation/automation_provider_observers.cc

Issue 10834099: Removing instances of profile_->GetBookmarkModel() as part of converting BookmarkModel to a PKS. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 4 months 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/automation/testing_automation_provider.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/automation/automation_provider_observers.h" 5 #include "chrome/browser/automation/automation_provider_observers.h"
6 6
7 #include <deque> 7 #include <deque>
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
11 #include "base/basictypes.h" 11 #include "base/basictypes.h"
12 #include "base/bind.h" 12 #include "base/bind.h"
13 #include "base/bind_helpers.h" 13 #include "base/bind_helpers.h"
14 #include "base/callback.h" 14 #include "base/callback.h"
15 #include "base/file_util.h" 15 #include "base/file_util.h"
16 #include "base/json/json_writer.h" 16 #include "base/json/json_writer.h"
17 #include "base/memory/scoped_ptr.h" 17 #include "base/memory/scoped_ptr.h"
18 #include "base/stl_util.h" 18 #include "base/stl_util.h"
19 #include "base/string_number_conversions.h" 19 #include "base/string_number_conversions.h"
20 #include "base/string_util.h" 20 #include "base/string_util.h"
21 #include "base/stringprintf.h" 21 #include "base/stringprintf.h"
22 #include "base/threading/thread_restrictions.h" 22 #include "base/threading/thread_restrictions.h"
23 #include "base/utf_string_conversions.h" 23 #include "base/utf_string_conversions.h"
24 #include "base/values.h" 24 #include "base/values.h"
25 #include "chrome/app/chrome_command_ids.h" 25 #include "chrome/app/chrome_command_ids.h"
26 #include "chrome/browser/automation/automation_provider.h" 26 #include "chrome/browser/automation/automation_provider.h"
27 #include "chrome/browser/automation/automation_provider_json.h" 27 #include "chrome/browser/automation/automation_provider_json.h"
28 #include "chrome/browser/bookmarks/bookmark_model.h" 28 #include "chrome/browser/bookmarks/bookmark_model.h"
29 #include "chrome/browser/bookmarks/bookmark_model_factory.h"
29 #include "chrome/browser/browser_process.h" 30 #include "chrome/browser/browser_process.h"
30 #include "chrome/browser/content_settings/tab_specific_content_settings.h" 31 #include "chrome/browser/content_settings/tab_specific_content_settings.h"
31 #include "chrome/browser/extensions/crx_installer.h" 32 #include "chrome/browser/extensions/crx_installer.h"
32 #include "chrome/browser/extensions/extension_host.h" 33 #include "chrome/browser/extensions/extension_host.h"
33 #include "chrome/browser/extensions/extension_process_manager.h" 34 #include "chrome/browser/extensions/extension_process_manager.h"
34 #include "chrome/browser/extensions/extension_service.h" 35 #include "chrome/browser/extensions/extension_service.h"
35 #include "chrome/browser/extensions/extension_tab_util.h" 36 #include "chrome/browser/extensions/extension_tab_util.h"
36 #include "chrome/browser/history/history_types.h" 37 #include "chrome/browser/history/history_types.h"
37 #include "chrome/browser/history/top_sites.h" 38 #include "chrome/browser/history/top_sites.h"
38 #include "chrome/browser/infobars/infobar_tab_helper.h" 39 #include "chrome/browser/infobars/infobar_tab_helper.h"
(...skipping 1569 matching lines...) Expand 10 before | Expand all | Expand 10 after
1608 for (size_t i = 0; i < results->size(); ++i) { 1609 for (size_t i = 0; i < results->size(); ++i) {
1609 DictionaryValue* page_value = new DictionaryValue; 1610 DictionaryValue* page_value = new DictionaryValue;
1610 history::URLResult const &page = (*results)[i]; 1611 history::URLResult const &page = (*results)[i];
1611 page_value->SetString("title", page.title()); 1612 page_value->SetString("title", page.title());
1612 page_value->SetString("url", page.url().spec()); 1613 page_value->SetString("url", page.url().spec());
1613 page_value->SetDouble("time", 1614 page_value->SetDouble("time",
1614 static_cast<double>(page.visit_time().ToDoubleT())); 1615 static_cast<double>(page.visit_time().ToDoubleT()));
1615 page_value->SetString("snippet", page.snippet().text()); 1616 page_value->SetString("snippet", page.snippet().text());
1616 page_value->SetBoolean( 1617 page_value->SetBoolean(
1617 "starred", 1618 "starred",
1618 provider_->profile()->GetBookmarkModel()->IsBookmarked(page.url())); 1619 BookmarkModelFactory::GetForProfile(
1620 provider_->profile())->IsBookmarked(page.url()));
1619 history_list->Append(page_value); 1621 history_list->Append(page_value);
1620 } 1622 }
1621 1623
1622 return_value->Set("history", history_list); 1624 return_value->Set("history", history_list);
1623 // Return history info. 1625 // Return history info.
1624 AutomationJSONReply reply(provider_, reply_message_.release()); 1626 AutomationJSONReply reply(provider_, reply_message_.release());
1625 reply.SendSuccess(return_value.get()); 1627 reply.SendSuccess(return_value.get());
1626 delete this; 1628 delete this;
1627 } 1629 }
1628 1630
(...skipping 1525 matching lines...) Expand 10 before | Expand all | Expand 10 after
3154 if (automation_) { 3156 if (automation_) {
3155 AutomationJSONReply(automation_, reply_message_.release()) 3157 AutomationJSONReply(automation_, reply_message_.release())
3156 .SendSuccess(NULL); 3158 .SendSuccess(NULL);
3157 } 3159 }
3158 delete this; 3160 delete this;
3159 } 3161 }
3160 } else { 3162 } else {
3161 NOTREACHED(); 3163 NOTREACHED();
3162 } 3164 }
3163 } 3165 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/automation/testing_automation_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698