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

Unified Diff: chrome/browser/ui/views/ash/app_list/search_builder.cc

Issue 10825317: Convert banned calls to use Navigate in ash app list. (Closed) Base URL: svn://svn.chromium.org/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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/views/ash/app_list/extension_app_item.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/ash/app_list/search_builder.cc
diff --git a/chrome/browser/ui/views/ash/app_list/search_builder.cc b/chrome/browser/ui/views/ash/app_list/search_builder.cc
index ce0374f90e8e9455a671e50c8662c51400e6e041..435e2389685cb89652bddf36090816b2b21d58aa 100644
--- a/chrome/browser/ui/views/ash/app_list/search_builder.cc
+++ b/chrome/browser/ui/views/ash/app_list/search_builder.cc
@@ -17,7 +17,7 @@
#include "chrome/browser/extensions/image_loading_tracker.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/browser.h"
-#include "chrome/browser/ui/browser_finder.h"
+#include "chrome/browser/ui/browser_navigator.h"
#include "chrome/browser/ui/browser_tabstrip.h"
#include "chrome/browser/ui/views/ash/extension_utils.h"
#include "chrome/common/extensions/extension.h"
@@ -238,27 +238,12 @@ void SearchBuilder::OpenResult(const app_list::SearchResult& result,
if (extension)
extension_utils::OpenExtension(profile_, extension, event_flags);
} else {
- WindowOpenDisposition disposition =
- chrome::DispositionFromEventFlags(event_flags);
- Browser* browser = browser::FindOrCreateTabbedBrowser(profile_);
-
- if (disposition == CURRENT_TAB) {
- // If current tab is not NTP, change disposition to NEW_FOREGROUND_TAB.
- const GURL& url = chrome::GetActiveWebContents(browser) ?
- chrome::GetActiveWebContents(browser)->GetURL() : GURL();
- if (!url.SchemeIs(chrome::kChromeUIScheme) ||
- url.host() != chrome::kChromeUINewTabHost) {
- disposition = NEW_FOREGROUND_TAB;
- }
- }
-
// TODO(xiyuan): What should we do for alternate url case?
- browser->OpenURL(
- content::OpenURLParams(match.destination_url,
- content::Referrer(),
- disposition,
- match.transition,
- false));
+ chrome::NavigateParams params(NULL,
jennb 2012/08/14 00:33:01 Does it work to pass a NULL browser here? One of t
benwells 2012/08/14 02:46:36 This code from chrome::Navigate() makes it safe:
+ match.destination_url,
+ match.transition);
+ params.disposition = chrome::DispositionFromEventFlags(event_flags);
xiyuan 2012/08/13 16:20:55 Think we still need the special case for dispositi
xiyuan 2012/08/13 17:49:00 One simple work around might be like this: params
benwells 2012/08/14 08:49:03 The navigate function will change disposition from
xiyuan 2012/08/14 16:18:17 Okay. Good to know that NormalizeDisposition will
+ chrome::Navigate(&params);
}
}
« no previous file with comments | « chrome/browser/ui/views/ash/app_list/extension_app_item.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698