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

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, 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 | 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 351 matching lines...) Expand 10 before | Expand all | Expand 10 after
362 if (params->window_action == browser::NavigateParams::SHOW_WINDOW && 362 if (params->window_action == browser::NavigateParams::SHOW_WINDOW &&
363 params->disposition == NEW_POPUP && 363 params->disposition == NEW_POPUP &&
364 params->user_gesture == false) { 364 params->user_gesture == false) {
365 params->window_action = browser::NavigateParams::SHOW_WINDOW_INACTIVE; 365 params->window_action = browser::NavigateParams::SHOW_WINDOW_INACTIVE;
366 } 366 }
367 367
368 // Determine if the navigation was user initiated. If it was, we need to 368 // Determine if the navigation was user initiated. If it was, we need to
369 // inform the target TabContents, and we may need to update the UI. 369 // inform the target TabContents, and we may need to update the UI.
370 PageTransition::Type base_transition = 370 PageTransition::Type base_transition =
371 PageTransition::StripQualifier(params->transition); 371 PageTransition::StripQualifier(params->transition);
372 bool user_initiated = base_transition == PageTransition::TYPED || 372 bool user_initiated = params->transition & PageTransition::FROM_ADDRESS_BAR ||
373 base_transition == PageTransition::AUTO_BOOKMARK; 373 base_transition == PageTransition::TYPED ||
374 base_transition == PageTransition::AUTO_BOOKMARK ||
375 base_transition == PageTransition::GENERATED ||
376 base_transition == PageTransition::START_PAGE ||
377 base_transition == PageTransition::RELOAD ||
378 base_transition == PageTransition::KEYWORD;
374 379
375 // Check if this is a singleton tab that already exists 380 // Check if this is a singleton tab that already exists
376 int singleton_index = GetIndexOfSingletonTab(params); 381 int singleton_index = GetIndexOfSingletonTab(params);
377 382
378 // If no target TabContents was specified, we need to construct one if we are 383 // If no target TabContents was specified, we need to construct one if we are
379 // supposed to target a new tab; unless it's a singleton that already exists. 384 // supposed to target a new tab; unless it's a singleton that already exists.
380 if (!params->target_contents && singleton_index < 0) { 385 if (!params->target_contents && singleton_index < 0) {
381 GURL url = params->url.is_empty() ? params->browser->GetHomePage() 386 GURL url = params->url.is_empty() ? params->browser->GetHomePage()
382 : params->url; 387 : params->url;
383 if (params->disposition != CURRENT_TAB) { 388 if (params->disposition != CURRENT_TAB) {
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
517 rewritten_url, replacements)) { 522 rewritten_url, replacements)) {
518 params->target_contents = tab; 523 params->target_contents = tab;
519 return tab_index; 524 return tab_index;
520 } 525 }
521 } 526 }
522 527
523 return -1; 528 return -1;
524 } 529 }
525 530
526 } // namespace browser 531 } // namespace browser
OLDNEW
« no previous file with comments | « chrome/browser/metrics/metrics_service.cc ('k') | chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698