| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |