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

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

Issue 2771233002: Remove the wrapper functions content::RecordAction et al (Closed)
Patch Set: Rebased Created 3 years, 9 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 <algorithm> 5 #include <algorithm>
6 #include <string> 6 #include <string>
7 7
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "base/memory/ptr_util.h" 9 #include "base/memory/ptr_util.h"
10 #include "base/metrics/user_metrics.h"
10 #include "base/metrics/user_metrics_action.h" 11 #include "base/metrics/user_metrics_action.h"
11 #include "chrome/browser/extensions/extension_action_manager.h" 12 #include "chrome/browser/extensions/extension_action_manager.h"
12 #include "chrome/browser/ui/browser.h" 13 #include "chrome/browser/ui/browser.h"
13 #include "chrome/browser/ui/chrome_pages.h" 14 #include "chrome/browser/ui/chrome_pages.h"
14 #include "chrome/browser/ui/extensions/extension_installed_bubble.h" 15 #include "chrome/browser/ui/extensions/extension_installed_bubble.h"
15 #include "chrome/browser/ui/singleton_tabs.h" 16 #include "chrome/browser/ui/singleton_tabs.h"
16 #include "chrome/browser/ui/sync/bubble_sync_promo_delegate.h" 17 #include "chrome/browser/ui/sync/bubble_sync_promo_delegate.h"
17 #include "chrome/browser/ui/views/frame/browser_view.h" 18 #include "chrome/browser/ui/views/frame/browser_view.h"
18 #include "chrome/browser/ui/views/harmony/layout_delegate.h" 19 #include "chrome/browser/ui/views/harmony/layout_delegate.h"
19 #include "chrome/browser/ui/views/location_bar/location_bar_view.h" 20 #include "chrome/browser/ui/views/location_bar/location_bar_view.h"
20 #include "chrome/browser/ui/views/location_bar/location_icon_view.h" 21 #include "chrome/browser/ui/views/location_bar/location_icon_view.h"
21 #include "chrome/browser/ui/views/sync/bubble_sync_promo_view.h" 22 #include "chrome/browser/ui/views/sync/bubble_sync_promo_view.h"
22 #include "chrome/browser/ui/views/toolbar/app_menu_button.h" 23 #include "chrome/browser/ui/views/toolbar/app_menu_button.h"
23 #include "chrome/browser/ui/views/toolbar/browser_actions_container.h" 24 #include "chrome/browser/ui/views/toolbar/browser_actions_container.h"
24 #include "chrome/browser/ui/views/toolbar/toolbar_view.h" 25 #include "chrome/browser/ui/views/toolbar/toolbar_view.h"
25 #include "chrome/common/url_constants.h" 26 #include "chrome/common/url_constants.h"
26 #include "chrome/grit/chromium_strings.h" 27 #include "chrome/grit/chromium_strings.h"
27 #include "chrome/grit/generated_resources.h" 28 #include "chrome/grit/generated_resources.h"
28 #include "components/bubble/bubble_controller.h" 29 #include "components/bubble/bubble_controller.h"
29 #include "components/bubble/bubble_ui.h" 30 #include "components/bubble/bubble_ui.h"
30 #include "content/public/browser/user_metrics.h"
31 #include "extensions/common/extension.h" 31 #include "extensions/common/extension.h"
32 #include "ui/base/l10n/l10n_util.h" 32 #include "ui/base/l10n/l10n_util.h"
33 #include "ui/gfx/image/image_skia_operations.h" 33 #include "ui/gfx/image/image_skia_operations.h"
34 #include "ui/views/bubble/bubble_dialog_delegate.h" 34 #include "ui/views/bubble/bubble_dialog_delegate.h"
35 #include "ui/views/controls/label.h" 35 #include "ui/views/controls/label.h"
36 #include "ui/views/controls/link.h" 36 #include "ui/views/controls/link.h"
37 #include "ui/views/controls/link_listener.h" 37 #include "ui/views/controls/link_listener.h"
38 #include "ui/views/layout/box_layout.h" 38 #include "ui/views/layout/box_layout.h"
39 39
40 using extensions::Extension; 40 using extensions::Extension;
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after
301 ExtensionInstalledBubbleUi::~ExtensionInstalledBubbleUi() { 301 ExtensionInstalledBubbleUi::~ExtensionInstalledBubbleUi() {
302 if (bubble_view_) 302 if (bubble_view_)
303 bubble_view_->GetWidget()->RemoveObserver(this); 303 bubble_view_->GetWidget()->RemoveObserver(this);
304 } 304 }
305 305
306 void ExtensionInstalledBubbleUi::Show(BubbleReference /*bubble_reference*/) { 306 void ExtensionInstalledBubbleUi::Show(BubbleReference /*bubble_reference*/) {
307 bubble_view_ = new ExtensionInstalledBubbleView(bubble_); 307 bubble_view_ = new ExtensionInstalledBubbleView(bubble_);
308 308
309 views::BubbleDialogDelegateView::CreateBubble(bubble_view_)->Show(); 309 views::BubbleDialogDelegateView::CreateBubble(bubble_view_)->Show();
310 bubble_view_->GetWidget()->AddObserver(this); 310 bubble_view_->GetWidget()->AddObserver(this);
311 content::RecordAction( 311 base::RecordAction(
312 base::UserMetricsAction("Signin_Impression_FromExtensionInstallBubble")); 312 base::UserMetricsAction("Signin_Impression_FromExtensionInstallBubble"));
313 } 313 }
314 314
315 void ExtensionInstalledBubbleUi::Close() { 315 void ExtensionInstalledBubbleUi::Close() {
316 if (bubble_view_) 316 if (bubble_view_)
317 bubble_view_->CloseBubble(); 317 bubble_view_->CloseBubble();
318 } 318 }
319 319
320 void ExtensionInstalledBubbleUi::UpdateAnchorPosition() { 320 void ExtensionInstalledBubbleUi::UpdateAnchorPosition() {
321 DCHECK(bubble_view_); 321 DCHECK(bubble_view_);
(...skipping 16 matching lines...) Expand all
338 ->browser_actions(); 338 ->browser_actions();
339 return !container->animating(); 339 return !container->animating();
340 } 340 }
341 return true; 341 return true;
342 } 342 }
343 343
344 // Implemented here to create the platform specific instance of the BubbleUi. 344 // Implemented here to create the platform specific instance of the BubbleUi.
345 std::unique_ptr<BubbleUi> ExtensionInstalledBubble::BuildBubbleUi() { 345 std::unique_ptr<BubbleUi> ExtensionInstalledBubble::BuildBubbleUi() {
346 return base::WrapUnique(new ExtensionInstalledBubbleUi(this)); 346 return base::WrapUnique(new ExtensionInstalledBubbleUi(this));
347 } 347 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/critical_notification_bubble_view.cc ('k') | chrome/browser/ui/views/frame/browser_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698