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

Side by Side Diff: chrome/browser/chromeos/first_run/drive_first_run_controller.cc

Issue 1194383003: Add a flag showing whether the current request was ignored by a handler (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix trybot failures (DidFailProvisionalLoad calls in unit tests) Created 5 years, 6 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 "chrome/browser/chromeos/first_run/drive_first_run_controller.h" 5 #include "chrome/browser/chromeos/first_run/drive_first_run_controller.h"
6 6
7 #include "ash/shell.h" 7 #include "ash/shell.h"
8 #include "ash/system/tray/system_tray_delegate.h" 8 #include "ash/system/tray/system_tray_delegate.h"
9 #include "base/callback.h" 9 #include "base/callback.h"
10 #include "base/memory/weak_ptr.h" 10 #include "base/memory/weak_ptr.h"
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 DriveFirstRunController::UMAOutcome outcome); 144 DriveFirstRunController::UMAOutcome outcome);
145 145
146 // Runs |completion_callback|. 146 // Runs |completion_callback|.
147 void RunCompletionCallback(bool success, 147 void RunCompletionCallback(bool success,
148 DriveFirstRunController::UMAOutcome outcome); 148 DriveFirstRunController::UMAOutcome outcome);
149 149
150 // content::WebContentsObserver overrides: 150 // content::WebContentsObserver overrides:
151 void DidFailProvisionalLoad(content::RenderFrameHost* render_frame_host, 151 void DidFailProvisionalLoad(content::RenderFrameHost* render_frame_host,
152 const GURL& validated_url, 152 const GURL& validated_url,
153 int error_code, 153 int error_code,
154 const base::string16& error_description) override; 154 const base::string16& error_description,
155 bool was_ignored_by_handler) override;
155 156
156 void DidFailLoad(content::RenderFrameHost* render_frame_host, 157 void DidFailLoad(content::RenderFrameHost* render_frame_host,
157 const GURL& validated_url, 158 const GURL& validated_url,
158 int error_code, 159 int error_code,
159 const base::string16& error_description) override; 160 const base::string16& error_description,
161 bool was_ignored_by_handler) override;
160 162
161 // content::WebContentsDelegate overrides: 163 // content::WebContentsDelegate overrides:
162 bool ShouldCreateWebContents( 164 bool ShouldCreateWebContents(
163 content::WebContents* web_contents, 165 content::WebContents* web_contents,
164 int route_id, 166 int route_id,
165 int main_frame_route_id, 167 int main_frame_route_id,
166 WindowContainerType window_container_type, 168 WindowContainerType window_container_type,
167 const base::string16& frame_name, 169 const base::string16& frame_name,
168 const GURL& target_url, 170 const GURL& target_url,
169 const std::string& partition_id, 171 const std::string& partition_id,
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
246 void DriveWebContentsManager::RunCompletionCallback( 248 void DriveWebContentsManager::RunCompletionCallback(
247 bool success, 249 bool success,
248 DriveFirstRunController::UMAOutcome outcome) { 250 DriveFirstRunController::UMAOutcome outcome) {
249 completion_callback_.Run(success, outcome); 251 completion_callback_.Run(success, outcome);
250 } 252 }
251 253
252 void DriveWebContentsManager::DidFailProvisionalLoad( 254 void DriveWebContentsManager::DidFailProvisionalLoad(
253 content::RenderFrameHost* render_frame_host, 255 content::RenderFrameHost* render_frame_host,
254 const GURL& validated_url, 256 const GURL& validated_url,
255 int error_code, 257 int error_code,
256 const base::string16& error_description) { 258 const base::string16& error_description,
259 bool was_ignored_by_handler) {
257 if (!render_frame_host->GetParent()) { 260 if (!render_frame_host->GetParent()) {
258 LOG(WARNING) << "Failed to load WebContents to enable offline mode."; 261 LOG(WARNING) << "Failed to load WebContents to enable offline mode.";
259 OnOfflineInit(false, 262 OnOfflineInit(false,
260 DriveFirstRunController::OUTCOME_WEB_CONTENTS_LOAD_FAILED); 263 DriveFirstRunController::OUTCOME_WEB_CONTENTS_LOAD_FAILED);
261 } 264 }
262 } 265 }
263 266
264 void DriveWebContentsManager::DidFailLoad( 267 void DriveWebContentsManager::DidFailLoad(
265 content::RenderFrameHost* render_frame_host, 268 content::RenderFrameHost* render_frame_host,
266 const GURL& validated_url, 269 const GURL& validated_url,
267 int error_code, 270 int error_code,
268 const base::string16& error_description) { 271 const base::string16& error_description,
272 bool was_ignored_by_handler) {
269 if (!render_frame_host->GetParent()) { 273 if (!render_frame_host->GetParent()) {
270 LOG(WARNING) << "Failed to load WebContents to enable offline mode."; 274 LOG(WARNING) << "Failed to load WebContents to enable offline mode.";
271 OnOfflineInit(false, 275 OnOfflineInit(false,
272 DriveFirstRunController::OUTCOME_WEB_CONTENTS_LOAD_FAILED); 276 DriveFirstRunController::OUTCOME_WEB_CONTENTS_LOAD_FAILED);
273 } 277 }
274 } 278 }
275 279
276 bool DriveWebContentsManager::ShouldCreateWebContents( 280 bool DriveWebContentsManager::ShouldCreateWebContents(
277 content::WebContents* web_contents, 281 content::WebContents* web_contents,
278 int route_id, 282 int route_id,
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after
468 base::UTF8ToUTF16(extension->name()), 472 base::UTF8ToUTF16(extension->name()),
469 message_center::NotifierId(message_center::NotifierId::APPLICATION, 473 message_center::NotifierId(message_center::NotifierId::APPLICATION,
470 kDriveHostedAppId), 474 kDriveHostedAppId),
471 data, 475 data,
472 new DriveOfflineNotificationDelegate(profile_))); 476 new DriveOfflineNotificationDelegate(profile_)));
473 notification->set_priority(message_center::LOW_PRIORITY); 477 notification->set_priority(message_center::LOW_PRIORITY);
474 message_center::MessageCenter::Get()->AddNotification(notification.Pass()); 478 message_center::MessageCenter::Get()->AddNotification(notification.Pass());
475 } 479 }
476 480
477 } // namespace chromeos 481 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698