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

Side by Side Diff: chrome/browser/ui/views/compact_nav/compact_location_bar_view.cc

Issue 6893046: added CTRL+Click and SHIFT+Click handler for context menu, Back and Forward. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: make this patch applicable to the latest trunk Created 9 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) 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/views/compact_nav/compact_location_bar_view.h" 5 #include "chrome/browser/ui/views/compact_nav/compact_location_bar_view.h"
6 6
7 #if defined(TOOLKIT_USES_GTK) 7 #if defined(TOOLKIT_USES_GTK)
8 #include <gtk/gtk.h> 8 #include <gtk/gtk.h>
9 #endif 9 #endif
10 10
11 #include <algorithm> 11 #include <algorithm>
12 12
13 #include "chrome/app/chrome_command_ids.h" 13 #include "chrome/app/chrome_command_ids.h"
14 #include "chrome/app/chrome_dll_resource.h" 14 #include "chrome/app/chrome_dll_resource.h"
15 #include "chrome/browser/autocomplete/autocomplete_popup_model.h" 15 #include "chrome/browser/autocomplete/autocomplete_popup_model.h"
16 #include "chrome/browser/bookmarks/bookmark_model.h" 16 #include "chrome/browser/bookmarks/bookmark_model.h"
17 #include "chrome/browser/event_disposition.h"
17 #include "chrome/browser/favicon/favicon_tab_helper.h" 18 #include "chrome/browser/favicon/favicon_tab_helper.h"
18 #include "chrome/browser/profiles/profile.h" 19 #include "chrome/browser/profiles/profile.h"
19 #include "chrome/browser/themes/theme_service.h" 20 #include "chrome/browser/themes/theme_service.h"
20 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" 21 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h"
21 #include "chrome/browser/ui/view_ids.h" 22 #include "chrome/browser/ui/view_ids.h"
22 #include "chrome/browser/ui/views/compact_nav/compact_location_bar_view_host.h" 23 #include "chrome/browser/ui/views/compact_nav/compact_location_bar_view_host.h"
23 #include "chrome/browser/ui/views/event_utils.h"
24 #include "chrome/browser/ui/views/frame/browser_view.h" 24 #include "chrome/browser/ui/views/frame/browser_view.h"
25 #include "chrome/browser/ui/views/location_bar/location_bar_view.h" 25 #include "chrome/browser/ui/views/location_bar/location_bar_view.h"
26 #include "chrome/browser/ui/views/reload_button.h" 26 #include "chrome/browser/ui/views/reload_button.h"
27 #include "content/browser/user_metrics.h" 27 #include "content/browser/user_metrics.h"
28 #include "grit/chromium_strings.h" 28 #include "grit/chromium_strings.h"
29 #include "grit/generated_resources.h" 29 #include "grit/generated_resources.h"
30 #include "grit/theme_resources.h" 30 #include "grit/theme_resources.h"
31 #include "grit/theme_resources_standard.h" 31 #include "grit/theme_resources_standard.h"
32 #include "ui/base/accessibility/accessible_view_state.h" 32 #include "ui/base/accessibility/accessible_view_state.h"
33 #include "ui/base/l10n/l10n_util.h" 33 #include "ui/base/l10n/l10n_util.h"
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after
252 // ignore any cached content. 252 // ignore any cached content.
253 // TODO(avayvod): eliminate duplication of this logic in 253 // TODO(avayvod): eliminate duplication of this logic in
254 // CompactLocationBarView. 254 // CompactLocationBarView.
255 if (id == IDC_RELOAD && (event.IsShiftDown() || event.IsControlDown())) { 255 if (id == IDC_RELOAD && (event.IsShiftDown() || event.IsControlDown())) {
256 id = IDC_RELOAD_IGNORING_CACHE; 256 id = IDC_RELOAD_IGNORING_CACHE;
257 // Mask off shift/ctrl so they aren't interpreted as affecting the 257 // Mask off shift/ctrl so they aren't interpreted as affecting the
258 // disposition below. 258 // disposition below.
259 flags &= ~(ui::EF_SHIFT_DOWN | ui::EF_CONTROL_DOWN); 259 flags &= ~(ui::EF_SHIFT_DOWN | ui::EF_CONTROL_DOWN);
260 } 260 }
261 browser()->ExecuteCommandWithDisposition( 261 browser()->ExecuteCommandWithDisposition(
262 id, event_utils::DispositionFromEventFlags(flags)); 262 id, browser::DispositionFromEventFlags(flags));
263 } 263 }
264 264
265 //////////////////////////////////////////////////////////////////////////////// 265 ////////////////////////////////////////////////////////////////////////////////
266 // AutocompleteEditController overrides: 266 // AutocompleteEditController overrides:
267 267
268 void CompactLocationBarView::OnAutocompleteAccept( 268 void CompactLocationBarView::OnAutocompleteAccept(
269 const GURL& url, 269 const GURL& url,
270 WindowOpenDisposition disposition, 270 WindowOpenDisposition disposition,
271 PageTransition::Type transition, 271 PageTransition::Type transition,
272 const GURL& alternate_nav_url) { 272 const GURL& alternate_nav_url) {
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
322 322
323 InstantController* CompactLocationBarView::GetInstant() { 323 InstantController* CompactLocationBarView::GetInstant() {
324 // TODO(stevet): Re-enable instant for compact nav. 324 // TODO(stevet): Re-enable instant for compact nav.
325 // return browser()->instant(); 325 // return browser()->instant();
326 return NULL; 326 return NULL;
327 } 327 }
328 328
329 TabContentsWrapper* CompactLocationBarView::GetTabContentsWrapper() const { 329 TabContentsWrapper* CompactLocationBarView::GetTabContentsWrapper() const {
330 return browser()->GetSelectedTabContentsWrapper(); 330 return browser()->GetSelectedTabContentsWrapper();
331 } 331 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/chrome_views_delegate.cc ('k') | chrome/browser/ui/views/compact_nav/compact_navigation_bar.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698