OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "content/browser/web_contents/web_contents_view_aura.h" | 5 #include "content/browser/web_contents/web_contents_view_aura.h" |
6 | 6 |
7 #include "base/auto_reset.h" | 7 #include "base/auto_reset.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
125 controller.GetEntryAtOffset(1)); | 125 controller.GetEntryAtOffset(1)); |
126 } else if (ShouldNavigateBack(controller, overscroll_mode)) { | 126 } else if (ShouldNavigateBack(controller, overscroll_mode)) { |
127 entry = NavigationEntryImpl::FromNavigationEntry( | 127 entry = NavigationEntryImpl::FromNavigationEntry( |
128 controller.GetEntryAtOffset(-1)); | 128 controller.GetEntryAtOffset(-1)); |
129 } | 129 } |
130 | 130 |
131 gfx::Image image; | 131 gfx::Image image; |
132 if (entry && entry->screenshot().get()) { | 132 if (entry && entry->screenshot().get()) { |
133 std::vector<gfx::ImagePNGRep> image_reps; | 133 std::vector<gfx::ImagePNGRep> image_reps; |
134 image_reps.push_back(gfx::ImagePNGRep(entry->screenshot(), | 134 image_reps.push_back(gfx::ImagePNGRep(entry->screenshot(), |
135 ui::GetImageScale( | 135 ui::GetScaleFactorForNativeView(web_contents_window()))); |
136 ui::GetScaleFactorForNativeView(web_contents_window())))); | |
137 image = gfx::Image(image_reps); | 136 image = gfx::Image(image_reps); |
138 } | 137 } |
139 SetImage(image); | 138 SetImage(image); |
140 } | 139 } |
141 | 140 |
142 void stop_forwarding_events() { forward_events_ = false; } | 141 void stop_forwarding_events() { forward_events_ = false; } |
143 | 142 |
144 private: | 143 private: |
145 virtual ~OverscrollWindowDelegate() {} | 144 virtual ~OverscrollWindowDelegate() {} |
146 | 145 |
(...skipping 1400 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1547 event.location(), | 1546 event.location(), |
1548 gfx::Screen::GetScreenFor(GetNativeView())->GetCursorScreenPoint(), | 1547 gfx::Screen::GetScreenFor(GetNativeView())->GetCursorScreenPoint(), |
1549 ConvertAuraEventFlagsToWebInputEventModifiers(event.flags())); | 1548 ConvertAuraEventFlagsToWebInputEventModifiers(event.flags())); |
1550 if (drag_dest_delegate_) | 1549 if (drag_dest_delegate_) |
1551 drag_dest_delegate_->OnDrop(); | 1550 drag_dest_delegate_->OnDrop(); |
1552 current_drop_data_.reset(); | 1551 current_drop_data_.reset(); |
1553 return ConvertFromWeb(current_drag_op_); | 1552 return ConvertFromWeb(current_drag_op_); |
1554 } | 1553 } |
1555 | 1554 |
1556 } // namespace content | 1555 } // namespace content |
OLD | NEW |