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

Side by Side Diff: chrome/browser/ui/gtk/location_bar_view_gtk.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/gtk/location_bar_view_gtk.h" 5 #include "chrome/browser/ui/gtk/location_bar_view_gtk.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 tab_to_search_full_label_(NULL), 158 tab_to_search_full_label_(NULL),
159 tab_to_search_partial_label_(NULL), 159 tab_to_search_partial_label_(NULL),
160 tab_to_search_hint_(NULL), 160 tab_to_search_hint_(NULL),
161 tab_to_search_hint_leading_label_(NULL), 161 tab_to_search_hint_leading_label_(NULL),
162 tab_to_search_hint_icon_(NULL), 162 tab_to_search_hint_icon_(NULL),
163 tab_to_search_hint_trailing_label_(NULL), 163 tab_to_search_hint_trailing_label_(NULL),
164 command_updater_(browser->command_updater()), 164 command_updater_(browser->command_updater()),
165 toolbar_model_(browser->toolbar_model()), 165 toolbar_model_(browser->toolbar_model()),
166 browser_(browser), 166 browser_(browser),
167 disposition_(CURRENT_TAB), 167 disposition_(CURRENT_TAB),
168 transition_(PageTransition::TYPED), 168 transition_(PageTransition::TYPED | PageTransition::FROM_ADDRESS_BAR),
169 first_run_bubble_(this), 169 first_run_bubble_(this),
170 popup_window_mode_(false), 170 popup_window_mode_(false),
171 theme_service_(NULL), 171 theme_service_(NULL),
172 hbox_width_(0), 172 hbox_width_(0),
173 entry_box_width_(0), 173 entry_box_width_(0),
174 show_selected_keyword_(false), 174 show_selected_keyword_(false),
175 show_keyword_hint_(false) { 175 show_keyword_hint_(false) {
176 } 176 }
177 177
178 LocationBarViewGtk::~LocationBarViewGtk() { 178 LocationBarViewGtk::~LocationBarViewGtk() {
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after
459 } 459 }
460 } 460 }
461 461
462 void LocationBarViewGtk::OnAutocompleteAccept(const GURL& url, 462 void LocationBarViewGtk::OnAutocompleteAccept(const GURL& url,
463 WindowOpenDisposition disposition, 463 WindowOpenDisposition disposition,
464 PageTransition::Type transition, 464 PageTransition::Type transition,
465 const GURL& alternate_nav_url) { 465 const GURL& alternate_nav_url) {
466 if (url.is_valid()) { 466 if (url.is_valid()) {
467 location_input_ = UTF8ToUTF16(url.spec()); 467 location_input_ = UTF8ToUTF16(url.spec());
468 disposition_ = disposition; 468 disposition_ = disposition;
469 transition_ = transition; 469 transition_ = transition | PageTransition::FROM_ADDRESS_BAR;
470 470
471 if (command_updater_) { 471 if (command_updater_) {
472 if (!alternate_nav_url.is_valid()) { 472 if (!alternate_nav_url.is_valid()) {
473 command_updater_->ExecuteCommand(IDC_OPEN_CURRENT_URL); 473 command_updater_->ExecuteCommand(IDC_OPEN_CURRENT_URL);
474 } else { 474 } else {
475 AlternateNavURLFetcher* fetcher = 475 AlternateNavURLFetcher* fetcher =
476 new AlternateNavURLFetcher(alternate_nav_url); 476 new AlternateNavURLFetcher(alternate_nav_url);
477 // The AlternateNavURLFetcher will listen for the pending navigation 477 // The AlternateNavURLFetcher will listen for the pending navigation
478 // notification that will be issued as a result of the "open URL." It 478 // notification that will be issued as a result of the "open URL." It
479 // will automatically install itself into that navigation controller. 479 // will automatically install itself into that navigation controller.
(...skipping 1142 matching lines...) Expand 10 before | Expand all | Expand 10 after
1622 1622
1623 std::string badge_text = page_action_->GetBadgeText(tab_id); 1623 std::string badge_text = page_action_->GetBadgeText(tab_id);
1624 if (badge_text.empty()) 1624 if (badge_text.empty())
1625 return FALSE; 1625 return FALSE;
1626 1626
1627 gfx::CanvasSkiaPaint canvas(event, false); 1627 gfx::CanvasSkiaPaint canvas(event, false);
1628 gfx::Rect bounding_rect(widget->allocation); 1628 gfx::Rect bounding_rect(widget->allocation);
1629 page_action_->PaintBadge(&canvas, bounding_rect, tab_id); 1629 page_action_->PaintBadge(&canvas, bounding_rect, tab_id);
1630 return FALSE; 1630 return FALSE;
1631 } 1631 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698