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

Side by Side Diff: chrome/browser/ui/search/instant_controller.cc

Issue 13162003: Instant: Don't use the local overlay's URL for the NTP. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 7 years, 8 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 2012 The Chromium Authors. All rights reserved. 1 // Copyright 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/search/instant_controller.h" 5 #include "chrome/browser/ui/search/instant_controller.h"
6 6
7 #include "base/metrics/histogram.h" 7 #include "base/metrics/histogram.h"
8 #include "base/string_util.h" 8 #include "base/string_util.h"
9 #include "base/stringprintf.h" 9 #include "base/stringprintf.h"
10 #include "base/utf_string_conversions.h" 10 #include "base/utf_string_conversions.h"
(...skipping 1412 matching lines...) Expand 10 before | Expand all | Expand 10 after
1423 DCHECK_LE(0, intersection.x()); 1423 DCHECK_LE(0, intersection.x());
1424 DCHECK_LE(0, intersection.width()); 1424 DCHECK_LE(0, intersection.width());
1425 DCHECK_LE(0, intersection.height()); 1425 DCHECK_LE(0, intersection.height());
1426 1426
1427 overlay_->SetPopupBounds(intersection); 1427 overlay_->SetPopupBounds(intersection);
1428 } 1428 }
1429 1429
1430 bool InstantController::GetInstantURL(Profile* profile, 1430 bool InstantController::GetInstantURL(Profile* profile,
1431 bool ignore_blacklist, 1431 bool ignore_blacklist,
1432 std::string* instant_url) const { 1432 std::string* instant_url) const {
1433 DCHECK(profile); 1433 if (extended_enabled_ && use_local_overlay_only_)
1434 instant_url->clear(); 1434 return false;
1435
1436 if (extended_enabled_ && use_local_overlay_only_) {
1437 *instant_url = chrome::kChromeSearchLocalOmniboxPopupURL;
1438 return true;
1439 }
1440 1435
1441 const GURL instant_url_obj = chrome::GetInstantURL(profile, 1436 const GURL instant_url_obj = chrome::GetInstantURL(profile,
1442 omnibox_bounds_.x()); 1437 omnibox_bounds_.x());
1443 if (!instant_url_obj.is_valid()) 1438 if (!instant_url_obj.is_valid())
1444 return false; 1439 return false;
1445 1440
1446 *instant_url = instant_url_obj.spec(); 1441 *instant_url = instant_url_obj.spec();
1447 1442
1448 if (!ignore_blacklist) { 1443 if (!ignore_blacklist) {
1449 std::map<std::string, int>::const_iterator iter = 1444 std::map<std::string, int>::const_iterator iter =
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after
1622 1617
1623 // If this is not window startup, switch. 1618 // If this is not window startup, switch.
1624 // TODO(shishir): This is not completely reliable. Find a better way to detect 1619 // TODO(shishir): This is not completely reliable. Find a better way to detect
1625 // startup time. 1620 // startup time.
1626 if (browser_->GetActiveWebContents()) 1621 if (browser_->GetActiveWebContents())
1627 return true; 1622 return true;
1628 1623
1629 return chrome::IsAggressiveLocalNTPFallbackEnabled(); 1624 return chrome::IsAggressiveLocalNTPFallbackEnabled();
1630 } 1625 }
1631 1626
OLDNEW
« no previous file with comments | « chrome/browser/ui/search/instant_controller.h ('k') | chrome/browser/ui/search/instant_extended_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698