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

Side by Side Diff: chrome/browser/ui/omnibox/omnibox_view_browsertest.cc

Issue 10806022: Removing usage of profile_->GetHistory() from the codebase in order to remove that function. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 5 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
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 <stdio.h> 5 #include <stdio.h>
6 6
7 #include "base/message_loop.h" 7 #include "base/message_loop.h"
8 #include "base/string16.h" 8 #include "base/string16.h"
9 #include "base/string_util.h" 9 #include "base/string_util.h"
10 #include "base/time.h" 10 #include "base/time.h"
11 #include "base/utf_string_conversions.h" 11 #include "base/utf_string_conversions.h"
12 #include "chrome/app/chrome_command_ids.h" 12 #include "chrome/app/chrome_command_ids.h"
13 #include "chrome/browser/autocomplete/autocomplete_match.h" 13 #include "chrome/browser/autocomplete/autocomplete_match.h"
14 #include "chrome/browser/autocomplete/history_quick_provider.h" 14 #include "chrome/browser/autocomplete/history_quick_provider.h"
15 #include "chrome/browser/bookmarks/bookmark_model.h" 15 #include "chrome/browser/bookmarks/bookmark_model.h"
16 #include "chrome/browser/bookmarks/bookmark_utils.h" 16 #include "chrome/browser/bookmarks/bookmark_utils.h"
17 #include "chrome/browser/history/history.h" 17 #include "chrome/browser/history/history.h"
18 #include "chrome/browser/history/history_service_factory.h"
18 #include "chrome/browser/profiles/profile.h" 19 #include "chrome/browser/profiles/profile.h"
19 #include "chrome/browser/search_engines/template_url.h" 20 #include "chrome/browser/search_engines/template_url.h"
20 #include "chrome/browser/search_engines/template_url_service.h" 21 #include "chrome/browser/search_engines/template_url_service.h"
21 #include "chrome/browser/search_engines/template_url_service_factory.h" 22 #include "chrome/browser/search_engines/template_url_service_factory.h"
22 #include "chrome/browser/ui/browser.h" 23 #include "chrome/browser/ui/browser.h"
23 #include "chrome/browser/ui/browser_commands.h" 24 #include "chrome/browser/ui/browser_commands.h"
24 #include "chrome/browser/ui/browser_tabstrip.h" 25 #include "chrome/browser/ui/browser_tabstrip.h"
25 #include "chrome/browser/ui/browser_window.h" 26 #include "chrome/browser/ui/browser_window.h"
26 #include "chrome/browser/ui/omnibox/location_bar.h" 27 #include "chrome/browser/ui/omnibox/location_bar.h"
27 #include "chrome/browser/ui/omnibox/omnibox_popup_model.h" 28 #include "chrome/browser/ui/omnibox/omnibox_popup_model.h"
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after
291 TemplateURL* template_url = new TemplateURL(profile, data); 292 TemplateURL* template_url = new TemplateURL(profile, data);
292 model->Add(template_url); 293 model->Add(template_url);
293 model->SetDefaultSearchProvider(template_url); 294 model->SetDefaultSearchProvider(template_url);
294 295
295 data.SetKeyword(ASCIIToUTF16(kSearchKeyword2)); 296 data.SetKeyword(ASCIIToUTF16(kSearchKeyword2));
296 model->Add(new TemplateURL(profile, data)); 297 model->Add(new TemplateURL(profile, data));
297 } 298 }
298 299
299 void AddHistoryEntry(const TestHistoryEntry& entry, const Time& time) { 300 void AddHistoryEntry(const TestHistoryEntry& entry, const Time& time) {
300 Profile* profile = browser()->profile(); 301 Profile* profile = browser()->profile();
301 HistoryService* history_service = 302 HistoryService* history_service = HistoryServiceFactory::GetForProfile(
302 profile->GetHistoryService(Profile::EXPLICIT_ACCESS); 303 profile, Profile::EXPLICIT_ACCESS);
303 ASSERT_TRUE(history_service); 304 ASSERT_TRUE(history_service);
304 305
305 if (!history_service->BackendLoaded()) { 306 if (!history_service->BackendLoaded()) {
306 content::NotificationRegistrar registrar; 307 content::NotificationRegistrar registrar;
307 registrar.Add(this, chrome::NOTIFICATION_HISTORY_LOADED, 308 registrar.Add(this, chrome::NOTIFICATION_HISTORY_LOADED,
308 content::Source<Profile>(profile)); 309 content::Source<Profile>(profile));
309 ui_test_utils::RunMessageLoop(); 310 ui_test_utils::RunMessageLoop();
310 } 311 }
311 312
312 BookmarkModel* bookmark_model = profile->GetBookmarkModel(); 313 BookmarkModel* bookmark_model = profile->GetBookmarkModel();
(...skipping 1352 matching lines...) Expand 10 before | Expand all | Expand 10 after
1665 1666
1666 // Middle-clicking shouldn't select all the text either. 1667 // Middle-clicking shouldn't select all the text either.
1667 ASSERT_NO_FATAL_FAILURE( 1668 ASSERT_NO_FATAL_FAILURE(
1668 ClickFocusViewOrigin(ui_controls::LEFT, kClickOffset, kClickOffset)); 1669 ClickFocusViewOrigin(ui_controls::LEFT, kClickOffset, kClickOffset));
1669 ASSERT_NO_FATAL_FAILURE(ClickBrowserWindowCenter()); 1670 ASSERT_NO_FATAL_FAILURE(ClickBrowserWindowCenter());
1670 ASSERT_NO_FATAL_FAILURE( 1671 ASSERT_NO_FATAL_FAILURE(
1671 ClickFocusViewOrigin(ui_controls::MIDDLE, kClickOffset, kClickOffset)); 1672 ClickFocusViewOrigin(ui_controls::MIDDLE, kClickOffset, kClickOffset));
1672 EXPECT_FALSE(omnibox_view->IsSelectAll()); 1673 EXPECT_FALSE(omnibox_view->IsSelectAll());
1673 } 1674 }
1674 #endif // defined(USE_AURA) 1675 #endif // defined(USE_AURA)
OLDNEW
« no previous file with comments | « chrome/browser/ui/cocoa/history_menu_bridge.mm ('k') | chrome/browser/ui/toolbar/back_forward_menu_model_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698