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 "chrome/browser/ui/views/omnibox/omnibox_view_win.h" | 5 #include "chrome/browser/ui/views/omnibox/omnibox_view_win.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <locale> | 8 #include <locale> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 #include "ui/base/dragdrop/drop_target.h" | 47 #include "ui/base/dragdrop/drop_target.h" |
48 #include "ui/base/dragdrop/os_exchange_data.h" | 48 #include "ui/base/dragdrop/os_exchange_data.h" |
49 #include "ui/base/dragdrop/os_exchange_data_provider_win.h" | 49 #include "ui/base/dragdrop/os_exchange_data_provider_win.h" |
50 #include "ui/base/events.h" | 50 #include "ui/base/events.h" |
51 #include "ui/base/keycodes/keyboard_codes.h" | 51 #include "ui/base/keycodes/keyboard_codes.h" |
52 #include "ui/base/l10n/l10n_util.h" | 52 #include "ui/base/l10n/l10n_util.h" |
53 #include "ui/base/l10n/l10n_util_win.h" | 53 #include "ui/base/l10n/l10n_util_win.h" |
54 #include "ui/base/win/mouse_wheel_util.h" | 54 #include "ui/base/win/mouse_wheel_util.h" |
55 #include "ui/gfx/canvas.h" | 55 #include "ui/gfx/canvas.h" |
56 #include "ui/gfx/canvas_skia.h" | 56 #include "ui/gfx/canvas_skia.h" |
| 57 #include "ui/views/button_drag_utils.h" |
57 #include "ui/views/controls/textfield/native_textfield_win.h" | 58 #include "ui/views/controls/textfield/native_textfield_win.h" |
58 #include "ui/views/drag_utils.h" | |
59 #include "ui/views/widget/widget.h" | 59 #include "ui/views/widget/widget.h" |
60 | 60 |
61 #pragma comment(lib, "oleacc.lib") // Needed for accessibility support. | 61 #pragma comment(lib, "oleacc.lib") // Needed for accessibility support. |
62 #pragma comment(lib, "riched20.lib") // Needed for the richedit control. | 62 #pragma comment(lib, "riched20.lib") // Needed for the richedit control. |
63 | 63 |
64 using content::UserMetricsAction; | 64 using content::UserMetricsAction; |
65 using content::WebContents; | 65 using content::WebContents; |
66 | 66 |
67 /////////////////////////////////////////////////////////////////////////////// | 67 /////////////////////////////////////////////////////////////////////////////// |
68 // AutocompleteEditModel | 68 // AutocompleteEditModel |
(...skipping 2472 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2541 // |sel| was set by GetSelection(), which preserves selection direction, so | 2541 // |sel| was set by GetSelection(), which preserves selection direction, so |
2542 // sel.cpMin may not be the smaller value. | 2542 // sel.cpMin may not be the smaller value. |
2543 model()->AdjustTextForCopy(std::min(sel.cpMin, sel.cpMax), is_all_selected, | 2543 model()->AdjustTextForCopy(std::min(sel.cpMin, sel.cpMax), is_all_selected, |
2544 &text_to_write, &url, &write_url); | 2544 &text_to_write, &url, &write_url); |
2545 | 2545 |
2546 if (write_url) { | 2546 if (write_url) { |
2547 string16 title; | 2547 string16 title; |
2548 SkBitmap favicon; | 2548 SkBitmap favicon; |
2549 if (is_all_selected) | 2549 if (is_all_selected) |
2550 model_->GetDataForURLExport(&url, &title, &favicon); | 2550 model_->GetDataForURLExport(&url, &title, &favicon); |
2551 drag_utils::SetURLAndDragImage(url, title, favicon, &data); | 2551 button_drag_utils::SetURLAndDragImage(url, title, favicon, &data); |
2552 supported_modes |= DROPEFFECT_LINK; | 2552 supported_modes |= DROPEFFECT_LINK; |
2553 content::RecordAction(UserMetricsAction("Omnibox_DragURL")); | 2553 content::RecordAction(UserMetricsAction("Omnibox_DragURL")); |
2554 } else { | 2554 } else { |
2555 supported_modes |= DROPEFFECT_MOVE; | 2555 supported_modes |= DROPEFFECT_MOVE; |
2556 content::RecordAction(UserMetricsAction("Omnibox_DragString")); | 2556 content::RecordAction(UserMetricsAction("Omnibox_DragString")); |
2557 } | 2557 } |
2558 | 2558 |
2559 data.SetString(text_to_write); | 2559 data.SetString(text_to_write); |
2560 | 2560 |
2561 scoped_refptr<ui::DragSource> drag_source(new ui::DragSource); | 2561 scoped_refptr<ui::DragSource> drag_source(new ui::DragSource); |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2725 return omnibox_view; | 2725 return omnibox_view; |
2726 } | 2726 } |
2727 return new OmniboxViewWin(controller, | 2727 return new OmniboxViewWin(controller, |
2728 toolbar_model, | 2728 toolbar_model, |
2729 location_bar, | 2729 location_bar, |
2730 command_updater, | 2730 command_updater, |
2731 popup_window_mode, | 2731 popup_window_mode, |
2732 location_bar); | 2732 location_bar); |
2733 } | 2733 } |
2734 #endif | 2734 #endif |
OLD | NEW |