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

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

Issue 7624031: Treat files downloaded from the address bar as "always safe" (including extensions per discussion... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 9 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
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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_navigator.h" 5 #include "chrome/browser/ui/browser_navigator.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "chrome/browser/browser_about_handler.h" 10 #include "chrome/browser/browser_about_handler.h"
(...skipping 349 matching lines...) Expand 10 before | Expand all | Expand 10 after
360 if (params->window_action == browser::NavigateParams::SHOW_WINDOW && 360 if (params->window_action == browser::NavigateParams::SHOW_WINDOW &&
361 params->disposition == NEW_POPUP && 361 params->disposition == NEW_POPUP &&
362 params->user_gesture == false) { 362 params->user_gesture == false) {
363 params->window_action = browser::NavigateParams::SHOW_WINDOW_INACTIVE; 363 params->window_action = browser::NavigateParams::SHOW_WINDOW_INACTIVE;
364 } 364 }
365 365
366 // Determine if the navigation was user initiated. If it was, we need to 366 // Determine if the navigation was user initiated. If it was, we need to
367 // inform the target TabContents, and we may need to update the UI. 367 // inform the target TabContents, and we may need to update the UI.
368 PageTransition::Type base_transition = 368 PageTransition::Type base_transition =
369 PageTransition::StripQualifier(params->transition); 369 PageTransition::StripQualifier(params->transition);
370 bool user_initiated = base_transition == PageTransition::TYPED || 370 bool user_initiated = params->transition & PageTransition::FROM_ADDRESS_BAR ||
sky 2011/08/18 00:13:00 How unlike you not to use () around all these.
371 base_transition == PageTransition::AUTO_BOOKMARK; 371 base_transition == PageTransition::TYPED ||
372 base_transition == PageTransition::AUTO_BOOKMARK ||
373 base_transition == PageTransition::GENERATED ||
374 base_transition == PageTransition::START_PAGE ||
sky 2011/08/18 00:13:00 How come you're adding START_PAGE here?
Peter Kasting 2011/08/18 00:53:39 It seemed like starting the browser ought to quali
sky 2011/08/19 17:34:35 Peter stopped by and we talked about START_PAGE. S
375 base_transition == PageTransition::RELOAD ||
376 base_transition == PageTransition::KEYWORD;
372 377
373 // Check if this is a singleton tab that already exists 378 // Check if this is a singleton tab that already exists
374 int singleton_index = GetIndexOfSingletonTab(params); 379 int singleton_index = GetIndexOfSingletonTab(params);
375 380
376 // If no target TabContents was specified, we need to construct one if we are 381 // If no target TabContents was specified, we need to construct one if we are
377 // supposed to target a new tab; unless it's a singleton that already exists. 382 // supposed to target a new tab; unless it's a singleton that already exists.
378 if (!params->target_contents && singleton_index < 0) { 383 if (!params->target_contents && singleton_index < 0) {
379 GURL url = params->url.is_empty() ? params->browser->GetHomePage() 384 GURL url = params->url.is_empty() ? params->browser->GetHomePage()
380 : params->url; 385 : params->url;
381 if (params->disposition != CURRENT_TAB) { 386 if (params->disposition != CURRENT_TAB) {
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
514 rewritten_url, replacements)) { 519 rewritten_url, replacements)) {
515 params->target_contents = tab; 520 params->target_contents = tab;
516 return tab_index; 521 return tab_index;
517 } 522 }
518 } 523 }
519 524
520 return -1; 525 return -1;
521 } 526 }
522 527
523 } // namespace browser 528 } // namespace browser
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698