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

Side by Side Diff: chrome/browser/ui/views/autofill/tooltip_icon.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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/autofill/tooltip_icon.h" 5 #include "chrome/browser/ui/views/autofill/tooltip_icon.h"
6 6
7 #include "base/macros.h" 7 #include "base/macros.h"
8 #include "base/timer/timer.h" 8 #include "base/timer/timer.h"
9 #include "chrome/browser/ui/views/autofill/info_bubble.h" 9 #include "chrome/browser/ui/views/autofill/info_bubble.h"
10 #include "ui/accessibility/ax_view_state.h" 10 #include "ui/accessibility/ax_view_state.h"
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 bubble_->set_arrow(bubble_arrow_); 118 bubble_->set_arrow(bubble_arrow_);
119 // When shown due to a gesture event, close on deactivate (i.e. don't use 119 // When shown due to a gesture event, close on deactivate (i.e. don't use
120 // "focusless"). 120 // "focusless").
121 bubble_->set_can_activate(!mouse_inside_); 121 bubble_->set_can_activate(!mouse_inside_);
122 122
123 bubble_->Show(); 123 bubble_->Show();
124 observer_.Add(bubble_->GetWidget()); 124 observer_.Add(bubble_->GetWidget());
125 125
126 if (mouse_inside_) { 126 if (mouse_inside_) {
127 views::View* frame = bubble_->GetWidget()->non_client_view()->frame_view(); 127 views::View* frame = bubble_->GetWidget()->non_client_view()->frame_view();
128 scoped_ptr<views::MouseWatcherHost> host( 128 std::unique_ptr<views::MouseWatcherHost> host(
129 new views::MouseWatcherViewHost(frame, gfx::Insets())); 129 new views::MouseWatcherViewHost(frame, gfx::Insets()));
130 mouse_watcher_.reset(new views::MouseWatcher(host.release(), this)); 130 mouse_watcher_.reset(new views::MouseWatcher(host.release(), this));
131 mouse_watcher_->Start(); 131 mouse_watcher_->Start();
132 } 132 }
133 } 133 }
134 134
135 void TooltipIcon::HideBubble() { 135 void TooltipIcon::HideBubble() {
136 if (bubble_) 136 if (bubble_)
137 bubble_->Hide(); 137 bubble_->Hide();
138 } 138 }
139 139
140 void TooltipIcon::OnWidgetDestroyed(views::Widget* widget) { 140 void TooltipIcon::OnWidgetDestroyed(views::Widget* widget) {
141 observer_.Remove(widget); 141 observer_.Remove(widget);
142 142
143 SetDrawAsHovered(false); 143 SetDrawAsHovered(false);
144 mouse_watcher_.reset(); 144 mouse_watcher_.reset();
145 bubble_ = NULL; 145 bubble_ = NULL;
146 } 146 }
147 147
148 } // namespace autofill 148 } // namespace autofill
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/autofill/tooltip_icon.h ('k') | chrome/browser/ui/views/bar_control_button.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698