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

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

Issue 683993002: Revert of Fix crash when user closes window prior to the "Confirm Install" prompt showing (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git/+/install_prompt_navigator
Patch Set: Created 6 years, 1 month 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/extensions/extension_install_dialog_view.h" 5 #include "chrome/browser/ui/views/extensions/extension_install_dialog_view.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
11 #include "base/compiler_specific.h" 11 #include "base/compiler_specific.h"
12 #include "base/i18n/rtl.h" 12 #include "base/i18n/rtl.h"
13 #include "base/metrics/histogram.h" 13 #include "base/metrics/histogram.h"
14 #include "base/strings/string_util.h" 14 #include "base/strings/string_util.h"
15 #include "base/strings/utf_string_conversions.h" 15 #include "base/strings/utf_string_conversions.h"
16 #include "chrome/browser/browser_process.h" 16 #include "chrome/browser/browser_process.h"
17 #include "chrome/browser/extensions/api/experience_sampling_private/experience_s ampling.h" 17 #include "chrome/browser/extensions/api/experience_sampling_private/experience_s ampling.h"
18 #include "chrome/browser/extensions/bundle_installer.h" 18 #include "chrome/browser/extensions/bundle_installer.h"
19 #include "chrome/browser/extensions/extension_install_prompt_experiment.h" 19 #include "chrome/browser/extensions/extension_install_prompt_experiment.h"
20 #include "chrome/browser/extensions/extension_install_prompt_show_params.h"
21 #include "chrome/browser/profiles/profile.h" 20 #include "chrome/browser/profiles/profile.h"
22 #include "chrome/browser/profiles/profile_manager.h" 21 #include "chrome/browser/profiles/profile_manager.h"
23 #include "chrome/browser/ui/browser.h" 22 #include "chrome/browser/ui/browser.h"
24 #include "chrome/browser/ui/scoped_tabbed_browser_displayer.h" 23 #include "chrome/browser/ui/scoped_tabbed_browser_displayer.h"
25 #include "chrome/common/extensions/extension_constants.h" 24 #include "chrome/common/extensions/extension_constants.h"
26 #include "chrome/grit/generated_resources.h" 25 #include "chrome/grit/generated_resources.h"
27 #include "chrome/installer/util/browser_distribution.h" 26 #include "chrome/installer/util/browser_distribution.h"
28 #include "components/constrained_window/constrained_window_views.h" 27 #include "components/constrained_window/constrained_window_views.h"
29 #include "content/public/browser/page_navigator.h" 28 #include "content/public/browser/page_navigator.h"
30 #include "content/public/browser/web_contents.h" 29 #include "content/public/browser/web_contents.h"
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 checkbox->set_listener(listener); 161 checkbox->set_listener(listener);
163 // Alignment needs to be explicitly set again here, otherwise the views are 162 // Alignment needs to be explicitly set again here, otherwise the views are
164 // not vertically centered. 163 // not vertically centered.
165 layout->AddView(checkbox, 1, 1, 164 layout->AddView(checkbox, 1, 1,
166 views::GridLayout::LEADING, views::GridLayout::CENTER); 165 views::GridLayout::LEADING, views::GridLayout::CENTER);
167 layout->AddView(view, 1, 1, 166 layout->AddView(view, 1, 1,
168 views::GridLayout::LEADING, views::GridLayout::CENTER); 167 views::GridLayout::LEADING, views::GridLayout::CENTER);
169 } 168 }
170 169
171 void ShowExtensionInstallDialogImpl( 170 void ShowExtensionInstallDialogImpl(
172 ExtensionInstallPromptShowParams* show_params, 171 const ExtensionInstallPrompt::ShowParams& show_params,
173 ExtensionInstallPrompt::Delegate* delegate, 172 ExtensionInstallPrompt::Delegate* delegate,
174 scoped_refptr<ExtensionInstallPrompt::Prompt> prompt) { 173 scoped_refptr<ExtensionInstallPrompt::Prompt> prompt) {
175 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); 174 DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
176 ExtensionInstallDialogView* dialog = 175 ExtensionInstallDialogView* dialog =
177 new ExtensionInstallDialogView(show_params->profile(), 176 new ExtensionInstallDialogView(show_params.profile,
178 show_params->GetParentWebContents(), 177 show_params.parent_web_contents,
179 delegate, 178 delegate,
180 prompt); 179 prompt);
181 CreateBrowserModalDialogViews(dialog, show_params->GetParentWindow())->Show(); 180 CreateBrowserModalDialogViews(dialog, show_params.parent_window)->Show();
182 } 181 }
183 182
184 CustomScrollableView::CustomScrollableView() {} 183 CustomScrollableView::CustomScrollableView() {}
185 CustomScrollableView::~CustomScrollableView() {} 184 CustomScrollableView::~CustomScrollableView() {}
186 185
187 void CustomScrollableView::Layout() { 186 void CustomScrollableView::Layout() {
188 SetBounds(x(), y(), width(), GetHeightForWidth(width())); 187 SetBounds(x(), y(), width(), GetHeightForWidth(width()));
189 views::View::Layout(); 188 views::View::Layout();
190 } 189 }
191 190
(...skipping 977 matching lines...) Expand 10 before | Expand all | Expand 10 after
1169 void ExpandableContainerView::ExpandWithoutAnimation() { 1168 void ExpandableContainerView::ExpandWithoutAnimation() {
1170 expanded_ = true; 1169 expanded_ = true;
1171 details_view_->AnimateToState(1.0); 1170 details_view_->AnimateToState(1.0);
1172 } 1171 }
1173 1172
1174 // static 1173 // static
1175 ExtensionInstallPrompt::ShowDialogCallback 1174 ExtensionInstallPrompt::ShowDialogCallback
1176 ExtensionInstallPrompt::GetDefaultShowDialogCallback() { 1175 ExtensionInstallPrompt::GetDefaultShowDialogCallback() {
1177 return base::Bind(&ShowExtensionInstallDialogImpl); 1176 return base::Bind(&ShowExtensionInstallDialogImpl);
1178 } 1177 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698