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

Side by Side Diff: chrome/browser/ui/views/frame/browser_root_view.cc

Issue 1865213004: Convert //chrome/browser/ui from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 8 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
OLDNEW
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/frame/browser_root_view.h" 5 #include "chrome/browser/ui/views/frame/browser_root_view.h"
6 6
7 #include <cmath> 7 #include <cmath>
8 8
9 #include "chrome/browser/autocomplete/autocomplete_classifier_factory.h" 9 #include "chrome/browser/autocomplete/autocomplete_classifier_factory.h"
10 #include "chrome/browser/defaults.h" 10 #include "chrome/browser/defaults.h"
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 if (data.HasURL(ui::OSExchangeData::CONVERT_FILENAMES)) 56 if (data.HasURL(ui::OSExchangeData::CONVERT_FILENAMES))
57 return true; 57 return true;
58 58
59 // If there isn't a URL, see if we can 'paste and go'. 59 // If there isn't a URL, see if we can 'paste and go'.
60 return GetPasteAndGoURL(data, nullptr); 60 return GetPasteAndGoURL(data, nullptr);
61 } 61 }
62 62
63 void BrowserRootView::OnDragEntered(const ui::DropTargetEvent& event) { 63 void BrowserRootView::OnDragEntered(const ui::DropTargetEvent& event) {
64 if (ShouldForwardToTabStrip(event)) { 64 if (ShouldForwardToTabStrip(event)) {
65 forwarding_to_tab_strip_ = true; 65 forwarding_to_tab_strip_ = true;
66 scoped_ptr<ui::DropTargetEvent> mapped_event( 66 std::unique_ptr<ui::DropTargetEvent> mapped_event(
67 MapEventToTabStrip(event, event.data())); 67 MapEventToTabStrip(event, event.data()));
68 tabstrip()->OnDragEntered(*mapped_event.get()); 68 tabstrip()->OnDragEntered(*mapped_event.get());
69 } 69 }
70 } 70 }
71 71
72 int BrowserRootView::OnDragUpdated(const ui::DropTargetEvent& event) { 72 int BrowserRootView::OnDragUpdated(const ui::DropTargetEvent& event) {
73 if (ShouldForwardToTabStrip(event)) { 73 if (ShouldForwardToTabStrip(event)) {
74 scoped_ptr<ui::DropTargetEvent> mapped_event( 74 std::unique_ptr<ui::DropTargetEvent> mapped_event(
75 MapEventToTabStrip(event, event.data())); 75 MapEventToTabStrip(event, event.data()));
76 if (!forwarding_to_tab_strip_) { 76 if (!forwarding_to_tab_strip_) {
77 tabstrip()->OnDragEntered(*mapped_event.get()); 77 tabstrip()->OnDragEntered(*mapped_event.get());
78 forwarding_to_tab_strip_ = true; 78 forwarding_to_tab_strip_ = true;
79 } 79 }
80 return tabstrip()->OnDragUpdated(*mapped_event.get()); 80 return tabstrip()->OnDragUpdated(*mapped_event.get());
81 } else if (forwarding_to_tab_strip_) { 81 } else if (forwarding_to_tab_strip_) {
82 forwarding_to_tab_strip_ = false; 82 forwarding_to_tab_strip_ = false;
83 tabstrip()->OnDragExited(); 83 tabstrip()->OnDragExited();
84 } 84 }
(...skipping 23 matching lines...) Expand all
108 // The url isn't valid. Use the paste and go url. 108 // The url isn't valid. Use the paste and go url.
109 if (GetPasteAndGoURL(event.data(), &url)) 109 if (GetPasteAndGoURL(event.data(), &url))
110 mapped_data.SetURL(url, base::string16()); 110 mapped_data.SetURL(url, base::string16());
111 // else case: couldn't extract a url or 'paste and go' url. This ends up 111 // else case: couldn't extract a url or 'paste and go' url. This ends up
112 // passing through an ui::OSExchangeData with nothing in it. We need to do 112 // passing through an ui::OSExchangeData with nothing in it. We need to do
113 // this so that the tab strip cleans up properly. 113 // this so that the tab strip cleans up properly.
114 } else { 114 } else {
115 mapped_data.SetURL(url, base::string16()); 115 mapped_data.SetURL(url, base::string16());
116 } 116 }
117 forwarding_to_tab_strip_ = false; 117 forwarding_to_tab_strip_ = false;
118 scoped_ptr<ui::DropTargetEvent> mapped_event( 118 std::unique_ptr<ui::DropTargetEvent> mapped_event(
119 MapEventToTabStrip(event, mapped_data)); 119 MapEventToTabStrip(event, mapped_data));
120 return tabstrip()->OnPerformDrop(*mapped_event); 120 return tabstrip()->OnPerformDrop(*mapped_event);
121 } 121 }
122 122
123 const char* BrowserRootView::GetClassName() const { 123 const char* BrowserRootView::GetClassName() const {
124 return kViewClassName; 124 return kViewClassName;
125 } 125 }
126 126
127 bool BrowserRootView::OnMouseWheel(const ui::MouseWheelEvent& event) { 127 bool BrowserRootView::OnMouseWheel(const ui::MouseWheelEvent& event) {
128 if (browser_defaults::kScrollEventChangesTab) { 128 if (browser_defaults::kScrollEventChangesTab) {
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
235 browser_view_->browser()->profile())->Classify( 235 browser_view_->browser()->profile())->Classify(
236 text, false, false, metrics::OmniboxEventProto::INVALID_SPEC, &match, 236 text, false, false, metrics::OmniboxEventProto::INVALID_SPEC, &match,
237 nullptr); 237 nullptr);
238 if (!match.destination_url.is_valid()) 238 if (!match.destination_url.is_valid())
239 return false; 239 return false;
240 240
241 if (url) 241 if (url)
242 *url = match.destination_url; 242 *url = match.destination_url;
243 return true; 243 return true;
244 } 244 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/frame/browser_non_client_frame_view_mus.h ('k') | chrome/browser/ui/views/frame/browser_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698