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

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

Issue 662073002: 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"
20 #include "chrome/browser/profiles/profile.h" 21 #include "chrome/browser/profiles/profile.h"
21 #include "chrome/browser/profiles/profile_manager.h" 22 #include "chrome/browser/profiles/profile_manager.h"
22 #include "chrome/browser/ui/browser.h" 23 #include "chrome/browser/ui/browser.h"
23 #include "chrome/browser/ui/scoped_tabbed_browser_displayer.h" 24 #include "chrome/browser/ui/scoped_tabbed_browser_displayer.h"
24 #include "chrome/common/extensions/extension_constants.h" 25 #include "chrome/common/extensions/extension_constants.h"
25 #include "chrome/grit/generated_resources.h" 26 #include "chrome/grit/generated_resources.h"
26 #include "chrome/installer/util/browser_distribution.h" 27 #include "chrome/installer/util/browser_distribution.h"
27 #include "components/constrained_window/constrained_window_views.h" 28 #include "components/constrained_window/constrained_window_views.h"
28 #include "content/public/browser/page_navigator.h" 29 #include "content/public/browser/page_navigator.h"
29 #include "content/public/browser/web_contents.h" 30 #include "content/public/browser/web_contents.h"
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 checkbox->set_listener(listener); 162 checkbox->set_listener(listener);
162 // Alignment needs to be explicitly set again here, otherwise the views are 163 // Alignment needs to be explicitly set again here, otherwise the views are
163 // not vertically centered. 164 // not vertically centered.
164 layout->AddView(checkbox, 1, 1, 165 layout->AddView(checkbox, 1, 1,
165 views::GridLayout::LEADING, views::GridLayout::CENTER); 166 views::GridLayout::LEADING, views::GridLayout::CENTER);
166 layout->AddView(view, 1, 1, 167 layout->AddView(view, 1, 1,
167 views::GridLayout::LEADING, views::GridLayout::CENTER); 168 views::GridLayout::LEADING, views::GridLayout::CENTER);
168 } 169 }
169 170
170 void ShowExtensionInstallDialogImpl( 171 void ShowExtensionInstallDialogImpl(
171 const ExtensionInstallPrompt::ShowParams& show_params, 172 ExtensionInstallPromptShowParams* show_params,
172 ExtensionInstallPrompt::Delegate* delegate, 173 ExtensionInstallPrompt::Delegate* delegate,
173 scoped_refptr<ExtensionInstallPrompt::Prompt> prompt) { 174 scoped_refptr<ExtensionInstallPrompt::Prompt> prompt) {
174 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); 175 DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
175 ExtensionInstallDialogView* dialog = 176 ExtensionInstallDialogView* dialog =
176 new ExtensionInstallDialogView(show_params.profile, 177 new ExtensionInstallDialogView(show_params->profile(),
177 show_params.parent_web_contents, 178 show_params->GetParentWebContents(),
178 delegate, 179 delegate,
179 prompt); 180 prompt);
180 CreateBrowserModalDialogViews(dialog, show_params.parent_window)->Show(); 181 CreateBrowserModalDialogViews(dialog, show_params->GetParentWindow())->Show();
181 } 182 }
182 183
183 CustomScrollableView::CustomScrollableView() {} 184 CustomScrollableView::CustomScrollableView() {}
184 CustomScrollableView::~CustomScrollableView() {} 185 CustomScrollableView::~CustomScrollableView() {}
185 186
186 void CustomScrollableView::Layout() { 187 void CustomScrollableView::Layout() {
187 SetBounds(x(), y(), width(), GetHeightForWidth(width())); 188 SetBounds(x(), y(), width(), GetHeightForWidth(width()));
188 views::View::Layout(); 189 views::View::Layout();
189 } 190 }
190 191
(...skipping 977 matching lines...) Expand 10 before | Expand all | Expand 10 after
1168 void ExpandableContainerView::ExpandWithoutAnimation() { 1169 void ExpandableContainerView::ExpandWithoutAnimation() {
1169 expanded_ = true; 1170 expanded_ = true;
1170 details_view_->AnimateToState(1.0); 1171 details_view_->AnimateToState(1.0);
1171 } 1172 }
1172 1173
1173 // static 1174 // static
1174 ExtensionInstallPrompt::ShowDialogCallback 1175 ExtensionInstallPrompt::ShowDialogCallback
1175 ExtensionInstallPrompt::GetDefaultShowDialogCallback() { 1176 ExtensionInstallPrompt::GetDefaultShowDialogCallback() {
1176 return base::Bind(&ShowExtensionInstallDialogImpl); 1177 return base::Bind(&ShowExtensionInstallDialogImpl);
1177 } 1178 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698