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

Side by Side Diff: chrome/browser/ui/browser_instant_controller.cc

Issue 2248873002: Convert WindowOpenDisposition to an enum class. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 4 years, 3 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
« no previous file with comments | « chrome/browser/ui/browser_focus_uitest.cc ('k') | chrome/browser/ui/browser_navigator.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 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/browser_instant_controller.h" 5 #include "chrome/browser/ui/browser_instant_controller.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "chrome/browser/infobars/infobar_service.h" 8 #include "chrome/browser/infobars/infobar_service.h"
9 #include "chrome/browser/profiles/profile.h" 9 #include "chrome/browser/profiles/profile.h"
10 #include "chrome/browser/search/instant_service.h" 10 #include "chrome/browser/search/instant_service.h"
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 browser_->search_model()->RemoveObserver(this); 99 browser_->search_model()->RemoveObserver(this);
100 100
101 InstantService* instant_service = 101 InstantService* instant_service =
102 InstantServiceFactory::GetForProfile(profile()); 102 InstantServiceFactory::GetForProfile(profile());
103 instant_service->RemoveObserver(this); 103 instant_service->RemoveObserver(this);
104 } 104 }
105 105
106 bool BrowserInstantController::OpenInstant(WindowOpenDisposition disposition, 106 bool BrowserInstantController::OpenInstant(WindowOpenDisposition disposition,
107 const GURL& url) { 107 const GURL& url) {
108 // Unsupported dispositions. 108 // Unsupported dispositions.
109 if (disposition == NEW_BACKGROUND_TAB || disposition == NEW_WINDOW || 109 if (disposition == WindowOpenDisposition::NEW_BACKGROUND_TAB ||
110 disposition == NEW_FOREGROUND_TAB) 110 disposition == WindowOpenDisposition::NEW_WINDOW ||
111 disposition == WindowOpenDisposition::NEW_FOREGROUND_TAB)
111 return false; 112 return false;
112 113
113 // The omnibox currently doesn't use other dispositions, so we don't attempt 114 // The omnibox currently doesn't use other dispositions, so we don't attempt
114 // to handle them. If you hit this DCHECK file a bug and I'll (sky) add 115 // to handle them. If you hit this DCHECK file a bug and I'll (sky) add
115 // support for the new disposition. 116 // support for the new disposition.
116 DCHECK(disposition == CURRENT_TAB) << disposition; 117 DCHECK(disposition == WindowOpenDisposition::CURRENT_TAB)
118 << static_cast<int>(disposition);
117 119
118 const base::string16& search_terms = 120 const base::string16& search_terms =
119 search::ExtractSearchTermsFromURL(profile(), url); 121 search::ExtractSearchTermsFromURL(profile(), url);
120 EmbeddedSearchRequestParams request_params(url); 122 EmbeddedSearchRequestParams request_params(url);
121 if (search_terms.empty()) 123 if (search_terms.empty())
122 return false; 124 return false;
123 125
124 InstantSearchPrerenderer* prerenderer = 126 InstantSearchPrerenderer* prerenderer =
125 GetInstantSearchPrerenderer(profile()); 127 GetInstantSearchPrerenderer(profile());
126 if (prerenderer) { 128 if (prerenderer) {
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
211 params.referrer = content::Referrer(); 213 params.referrer = content::Referrer();
212 params.transition_type = ui::PAGE_TRANSITION_RELOAD; 214 params.transition_type = ui::PAGE_TRANSITION_RELOAD;
213 contents->GetController().LoadURLWithParams(params); 215 contents->GetController().LoadURLWithParams(params);
214 } else { 216 } else {
215 // Reload the contents to ensure that it gets assigned to a 217 // Reload the contents to ensure that it gets assigned to a
216 // non-privileged renderer. 218 // non-privileged renderer.
217 TabReloader::Reload(contents); 219 TabReloader::Reload(contents);
218 } 220 }
219 } 221 }
220 } 222 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/browser_focus_uitest.cc ('k') | chrome/browser/ui/browser_navigator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698