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

Side by Side Diff: chrome/browser/ui/views/extensions/extension_message_bubble_view.cc

Issue 577523002: Refactoring the WeakPtrFactory initialization in chrome/browser/ui/views (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Resolved Rebase issues Created 6 years, 3 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) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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/extensions/extension_message_bubble_view.h" 5 #include "chrome/browser/ui/views/extensions/extension_message_bubble_view.h"
6 6
7 #include "base/strings/string_number_conversions.h" 7 #include "base/strings/string_number_conversions.h"
8 #include "base/strings/string_util.h" 8 #include "base/strings/string_util.h"
9 #include "base/strings/utf_string_conversions.h" 9 #include "base/strings/utf_string_conversions.h"
10 #include "chrome/browser/extensions/dev_mode_bubble_controller.h" 10 #include "chrome/browser/extensions/dev_mode_bubble_controller.h"
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 55
56 } // namespace 56 } // namespace
57 57
58 namespace extensions { 58 namespace extensions {
59 59
60 ExtensionMessageBubbleView::ExtensionMessageBubbleView( 60 ExtensionMessageBubbleView::ExtensionMessageBubbleView(
61 views::View* anchor_view, 61 views::View* anchor_view,
62 views::BubbleBorder::Arrow arrow_location, 62 views::BubbleBorder::Arrow arrow_location,
63 scoped_ptr<extensions::ExtensionMessageBubbleController> controller) 63 scoped_ptr<extensions::ExtensionMessageBubbleController> controller)
64 : BubbleDelegateView(anchor_view, arrow_location), 64 : BubbleDelegateView(anchor_view, arrow_location),
65 weak_factory_(this),
66 controller_(controller.Pass()), 65 controller_(controller.Pass()),
67 anchor_view_(anchor_view), 66 anchor_view_(anchor_view),
68 headline_(NULL), 67 headline_(NULL),
69 learn_more_(NULL), 68 learn_more_(NULL),
70 dismiss_button_(NULL), 69 dismiss_button_(NULL),
71 link_clicked_(false), 70 link_clicked_(false),
72 action_taken_(false) { 71 action_taken_(false),
72 weak_factory_(this) {
73 DCHECK(anchor_view->GetWidget()); 73 DCHECK(anchor_view->GetWidget());
74 set_close_on_deactivate(controller_->CloseOnDeactivate()); 74 set_close_on_deactivate(controller_->CloseOnDeactivate());
75 set_close_on_esc(true); 75 set_close_on_esc(true);
76 76
77 // Compensate for built-in vertical padding in the anchor view's image. 77 // Compensate for built-in vertical padding in the anchor view's image.
78 set_anchor_view_insets(gfx::Insets(5, 0, 5, 0)); 78 set_anchor_view_insets(gfx::Insets(5, 0, 5, 0));
79 } 79 }
80 80
81 void ExtensionMessageBubbleView::OnActionButtonClicked( 81 void ExtensionMessageBubbleView::OnActionButtonClicked(
82 const base::Closure& callback) { 82 const base::Closure& callback) {
(...skipping 421 matching lines...) Expand 10 before | Expand all | Expand 10 after
504 } 504 }
505 505
506 void ExtensionMessageBubbleFactory::Finish() { 506 void ExtensionMessageBubbleFactory::Finish() {
507 MaybeStopObserving(); 507 MaybeStopObserving();
508 controller_.reset(); 508 controller_.reset();
509 anchor_view_ = NULL; 509 anchor_view_ = NULL;
510 container_ = NULL; 510 container_ = NULL;
511 } 511 }
512 512
513 } // namespace extensions 513 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698