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

Side by Side Diff: components/app_modal/javascript_dialog_manager.cc

Issue 2846363004: Make extension callbacks with auto-dismissing dialogs (Closed)
Patch Set: reupload; no code change Created 3 years, 7 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
« no previous file with comments | « components/app_modal/javascript_dialog_manager.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "components/app_modal/javascript_dialog_manager.h" 5 #include "components/app_modal/javascript_dialog_manager.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 void JavaScriptDialogManager::SetNativeDialogFactory( 78 void JavaScriptDialogManager::SetNativeDialogFactory(
79 std::unique_ptr<JavaScriptNativeDialogFactory> factory) { 79 std::unique_ptr<JavaScriptNativeDialogFactory> factory) {
80 native_dialog_factory_ = std::move(factory); 80 native_dialog_factory_ = std::move(factory);
81 } 81 }
82 82
83 void JavaScriptDialogManager::SetExtensionsClient( 83 void JavaScriptDialogManager::SetExtensionsClient(
84 std::unique_ptr<JavaScriptDialogExtensionsClient> extensions_client) { 84 std::unique_ptr<JavaScriptDialogExtensionsClient> extensions_client) {
85 extensions_client_ = std::move(extensions_client); 85 extensions_client_ = std::move(extensions_client);
86 } 86 }
87 87
88 JavaScriptDialogExtensionsClient*
89 JavaScriptDialogManager::GetExtensionsClient() {
90 return extensions_client_.get();
91 }
92
88 JavaScriptDialogManager::JavaScriptDialogManager() 93 JavaScriptDialogManager::JavaScriptDialogManager()
89 : extensions_client_(new DefaultExtensionsClient) { 94 : extensions_client_(new DefaultExtensionsClient) {
90 } 95 }
91 96
92 JavaScriptDialogManager::~JavaScriptDialogManager() { 97 JavaScriptDialogManager::~JavaScriptDialogManager() {
93 } 98 }
94 99
95 base::string16 JavaScriptDialogManager::GetTitle( 100 base::string16 JavaScriptDialogManager::GetTitle(
96 content::WebContents* web_contents, 101 content::WebContents* web_contents,
97 const GURL& origin_url) { 102 const GURL& origin_url) {
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after
316 // lazy background page after the dialog closes. (Dialogs are closed before 321 // lazy background page after the dialog closes. (Dialogs are closed before
317 // their WebContents is destroyed so |web_contents| is still valid here.) 322 // their WebContents is destroyed so |web_contents| is still valid here.)
318 extensions_client_->OnDialogClosed(web_contents); 323 extensions_client_->OnDialogClosed(web_contents);
319 324
320 last_close_time_ = base::TimeTicks::Now(); 325 last_close_time_ = base::TimeTicks::Now();
321 326
322 callback.Run(success, user_input); 327 callback.Run(success, user_input);
323 } 328 }
324 329
325 } // namespace app_modal 330 } // namespace app_modal
OLDNEW
« no previous file with comments | « components/app_modal/javascript_dialog_manager.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698