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

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

Issue 2833603003: Log the creation of more dialog box types. (Closed)
Patch Set: Created 3 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 <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.h"
11 #include "base/metrics/user_metrics_action.h" 11 #include "base/metrics/user_metrics_action.h"
12 #include "chrome/browser/extensions/extension_action_manager.h" 12 #include "chrome/browser/extensions/extension_action_manager.h"
13 #include "chrome/browser/ui/browser.h" 13 #include "chrome/browser/ui/browser.h"
14 #include "chrome/browser/ui/browser_dialogs.h"
14 #include "chrome/browser/ui/chrome_pages.h" 15 #include "chrome/browser/ui/chrome_pages.h"
15 #include "chrome/browser/ui/extensions/extension_installed_bubble.h" 16 #include "chrome/browser/ui/extensions/extension_installed_bubble.h"
16 #include "chrome/browser/ui/singleton_tabs.h" 17 #include "chrome/browser/ui/singleton_tabs.h"
17 #include "chrome/browser/ui/sync/bubble_sync_promo_delegate.h" 18 #include "chrome/browser/ui/sync/bubble_sync_promo_delegate.h"
18 #include "chrome/browser/ui/views/frame/browser_view.h" 19 #include "chrome/browser/ui/views/frame/browser_view.h"
19 #include "chrome/browser/ui/views/harmony/chrome_layout_provider.h" 20 #include "chrome/browser/ui/views/harmony/chrome_layout_provider.h"
20 #include "chrome/browser/ui/views/location_bar/location_bar_view.h" 21 #include "chrome/browser/ui/views/location_bar/location_bar_view.h"
21 #include "chrome/browser/ui/views/location_bar/location_icon_view.h" 22 #include "chrome/browser/ui/views/location_bar/location_icon_view.h"
22 #include "chrome/browser/ui/views/sync/bubble_sync_promo_view.h" 23 #include "chrome/browser/ui/views/sync/bubble_sync_promo_view.h"
23 #include "chrome/browser/ui/views/toolbar/app_menu_button.h" 24 #include "chrome/browser/ui/views/toolbar/app_menu_button.h"
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 }; 105 };
105 106
106 ExtensionInstalledBubbleView::ExtensionInstalledBubbleView( 107 ExtensionInstalledBubbleView::ExtensionInstalledBubbleView(
107 ExtensionInstalledBubble* controller) 108 ExtensionInstalledBubble* controller)
108 : BubbleDialogDelegateView(nullptr, 109 : BubbleDialogDelegateView(nullptr,
109 controller->anchor_position() == 110 controller->anchor_position() ==
110 ExtensionInstalledBubble::ANCHOR_OMNIBOX 111 ExtensionInstalledBubble::ANCHOR_OMNIBOX
111 ? views::BubbleBorder::TOP_LEFT 112 ? views::BubbleBorder::TOP_LEFT
112 : views::BubbleBorder::TOP_RIGHT), 113 : views::BubbleBorder::TOP_RIGHT),
113 controller_(controller), 114 controller_(controller),
114 manage_shortcut_(nullptr) {} 115 manage_shortcut_(nullptr) {
116 chrome::RecordDialogCreation(
117 chrome::DialogIdentifier::EXTENSION_INSTALLED_BUBBLE);
118 }
115 119
116 ExtensionInstalledBubbleView::~ExtensionInstalledBubbleView() {} 120 ExtensionInstalledBubbleView::~ExtensionInstalledBubbleView() {}
117 121
118 void ExtensionInstalledBubbleView::UpdateAnchorView() { 122 void ExtensionInstalledBubbleView::UpdateAnchorView() {
119 BrowserView* browser_view = BrowserView::GetBrowserViewForBrowser(browser()); 123 BrowserView* browser_view = BrowserView::GetBrowserViewForBrowser(browser());
120 124
121 views::View* reference_view = nullptr; 125 views::View* reference_view = nullptr;
122 switch (controller_->anchor_position()) { 126 switch (controller_->anchor_position()) {
123 case ExtensionInstalledBubble::ANCHOR_ACTION: { 127 case ExtensionInstalledBubble::ANCHOR_ACTION: {
124 BrowserActionsContainer* container = 128 BrowserActionsContainer* container =
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after
336 ->browser_actions(); 340 ->browser_actions();
337 return !container->animating(); 341 return !container->animating();
338 } 342 }
339 return true; 343 return true;
340 } 344 }
341 345
342 // Implemented here to create the platform specific instance of the BubbleUi. 346 // Implemented here to create the platform specific instance of the BubbleUi.
343 std::unique_ptr<BubbleUi> ExtensionInstalledBubble::BuildBubbleUi() { 347 std::unique_ptr<BubbleUi> ExtensionInstalledBubble::BuildBubbleUi() {
344 return base::WrapUnique(new ExtensionInstalledBubbleUi(this)); 348 return base::WrapUnique(new ExtensionInstalledBubbleUi(this));
345 } 349 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698