OLD | NEW |
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 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
253 // ignore any cached content. | 253 // ignore any cached content. |
254 // TODO(avayvod): eliminate duplication of this logic in | 254 // TODO(avayvod): eliminate duplication of this logic in |
255 // CompactLocationBarView. | 255 // CompactLocationBarView. |
256 if (id == IDC_RELOAD && (event.IsShiftDown() || event.IsControlDown())) { | 256 if (id == IDC_RELOAD && (event.IsShiftDown() || event.IsControlDown())) { |
257 id = IDC_RELOAD_IGNORING_CACHE; | 257 id = IDC_RELOAD_IGNORING_CACHE; |
258 // Mask off shift/ctrl so they aren't interpreted as affecting the | 258 // Mask off shift/ctrl so they aren't interpreted as affecting the |
259 // disposition below. | 259 // disposition below. |
260 flags &= ~(ui::EF_SHIFT_DOWN | ui::EF_CONTROL_DOWN); | 260 flags &= ~(ui::EF_SHIFT_DOWN | ui::EF_CONTROL_DOWN); |
261 } | 261 } |
262 browser()->ExecuteCommandWithDisposition( | 262 browser()->ExecuteCommandWithDisposition( |
263 id, event_utils::DispositionFromEventFlags(flags)); | 263 id, browser::DispositionFromEventFlags(flags)); |
264 } | 264 } |
265 | 265 |
266 //////////////////////////////////////////////////////////////////////////////// | 266 //////////////////////////////////////////////////////////////////////////////// |
267 // AutocompleteEditController overrides: | 267 // AutocompleteEditController overrides: |
268 | 268 |
269 void CompactLocationBarView::OnAutocompleteAccept( | 269 void CompactLocationBarView::OnAutocompleteAccept( |
270 const GURL& url, | 270 const GURL& url, |
271 WindowOpenDisposition disposition, | 271 WindowOpenDisposition disposition, |
272 PageTransition::Type transition, | 272 PageTransition::Type transition, |
273 const GURL& alternate_nav_url) { | 273 const GURL& alternate_nav_url) { |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
323 | 323 |
324 InstantController* CompactLocationBarView::GetInstant() { | 324 InstantController* CompactLocationBarView::GetInstant() { |
325 // TODO(stevet): Re-enable instant for compact nav. | 325 // TODO(stevet): Re-enable instant for compact nav. |
326 // return browser()->instant(); | 326 // return browser()->instant(); |
327 return NULL; | 327 return NULL; |
328 } | 328 } |
329 | 329 |
330 TabContentsWrapper* CompactLocationBarView::GetTabContentsWrapper() const { | 330 TabContentsWrapper* CompactLocationBarView::GetTabContentsWrapper() const { |
331 return browser()->GetSelectedTabContentsWrapper(); | 331 return browser()->GetSelectedTabContentsWrapper(); |
332 } | 332 } |
OLD | NEW |