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

Side by Side Diff: chrome/browser/chromeos/compact_location_bar_view.cc

Issue 2779011: Make the reload button respond to middle-clicks like back/forward/home alread... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 6 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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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/chromeos/compact_location_bar_view.h" 5 #include "chrome/browser/chromeos/compact_location_bar_view.h"
6 6
7 #include <gtk/gtk.h> 7 #include <gtk/gtk.h>
8 #include <algorithm> 8 #include <algorithm>
9 9
10 #include "app/l10n_util.h" 10 #include "app/l10n_util.h"
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
188 void CompactLocationBarView::Focus() { 188 void CompactLocationBarView::Focus() {
189 location_entry_->SetFocus(); 189 location_entry_->SetFocus();
190 } 190 }
191 191
192 //////////////////////////////////////////////////////////////////////////////// 192 ////////////////////////////////////////////////////////////////////////////////
193 // views::ButtonListener overrides: 193 // views::ButtonListener overrides:
194 194
195 void CompactLocationBarView::ButtonPressed(views::Button* sender, 195 void CompactLocationBarView::ButtonPressed(views::Button* sender,
196 const views::Event& event) { 196 const views::Event& event) {
197 int id = sender->tag(); 197 int id = sender->tag();
198 // Shift-clicking or Ctrl-clicking the reload button means we should 198 int flags = sender->mouse_event_flags();
199 // Shift-clicking or ctrl-clicking the reload button means we should
199 // ignore any cached content. 200 // ignore any cached content.
200 // TODO(avayvod): eliminate duplication of this logic in 201 // TODO(avayvod): eliminate duplication of this logic in
201 // CompactLocationBarView. 202 // CompactLocationBarView.
202 if (id == IDC_RELOAD && (event.IsShiftDown() || event.IsControlDown())) 203 if (id == IDC_RELOAD && (event.IsShiftDown() || event.IsControlDown())) {
203 id = IDC_RELOAD_IGNORING_CACHE; 204 id = IDC_RELOAD_IGNORING_CACHE;
205 // Mask off shift/ctrl so they aren't interpreted as affecting the
206 // disposition below.
207 flags &= ~(views::Event::EF_SHIFT_DOWN | views::Event::EF_CONTROL_DOWN);
208 }
204 browser()->ExecuteCommandWithDisposition( 209 browser()->ExecuteCommandWithDisposition(
205 id, event_utils::DispositionFromEventFlags(sender->mouse_event_flags())); 210 id, event_utils::DispositionFromEventFlags(flags));
206 } 211 }
207 212
208 //////////////////////////////////////////////////////////////////////////////// 213 ////////////////////////////////////////////////////////////////////////////////
209 // AutocompleteEditController overrides: 214 // AutocompleteEditController overrides:
210 215
211 void CompactLocationBarView::OnAutocompleteAccept( 216 void CompactLocationBarView::OnAutocompleteAccept(
212 const GURL& url, 217 const GURL& url,
213 WindowOpenDisposition disposition, 218 WindowOpenDisposition disposition,
214 PageTransition::Type transition, 219 PageTransition::Type transition,
215 const GURL& alternate_nav_url) { 220 const GURL& alternate_nav_url) {
(...skipping 24 matching lines...) Expand all
240 245
241 SkBitmap CompactLocationBarView::GetFavIcon() const { 246 SkBitmap CompactLocationBarView::GetFavIcon() const {
242 return SkBitmap(); 247 return SkBitmap();
243 } 248 }
244 249
245 std::wstring CompactLocationBarView::GetTitle() const { 250 std::wstring CompactLocationBarView::GetTitle() const {
246 return std::wstring(); 251 return std::wstring();
247 } 252 }
248 253
249 } // namespace chromeos 254 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/browser_focus_uitest.cc ('k') | chrome/browser/cocoa/browser_window_controller.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698