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

Side by Side Diff: chrome/browser/printing/print_preview_dialog_controller.cc

Issue 2225343002: Navigation: move RestoreType and ReloadType into a separate file (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase+ Created 4 years, 4 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 (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/printing/print_preview_dialog_controller.h" 5 #include "chrome/browser/printing/print_preview_dialog_controller.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <string> 10 #include <string>
(...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after
322 // Preview dialog navigated. 322 // Preview dialog navigated.
323 if (details) { 323 if (details) {
324 ui::PageTransition transition_type = 324 ui::PageTransition transition_type =
325 details->entry->GetTransitionType(); 325 details->entry->GetTransitionType();
326 content::NavigationType nav_type = details->type; 326 content::NavigationType nav_type = details->type;
327 327
328 // New |preview_dialog| is created. Don't update/erase map entry. 328 // New |preview_dialog| is created. Don't update/erase map entry.
329 if (waiting_for_new_preview_page_ && 329 if (waiting_for_new_preview_page_ &&
330 ui::PageTransitionCoreTypeIs(transition_type, 330 ui::PageTransitionCoreTypeIs(transition_type,
331 ui::PAGE_TRANSITION_AUTO_TOPLEVEL) && 331 ui::PAGE_TRANSITION_AUTO_TOPLEVEL) &&
332 nav_type == content::NAVIGATION_TYPE_NEW_PAGE) { 332 nav_type == content::NavigationType::NEW_PAGE) {
333 waiting_for_new_preview_page_ = false; 333 waiting_for_new_preview_page_ = false;
334 SaveInitiatorTitle(preview_dialog); 334 SaveInitiatorTitle(preview_dialog);
335 return; 335 return;
336 } 336 }
337 337
338 // Cloud print sign-in causes a reload. 338 // Cloud print sign-in causes a reload.
339 if (!waiting_for_new_preview_page_ && 339 if (!waiting_for_new_preview_page_ &&
340 ui::PageTransitionCoreTypeIs(transition_type, 340 ui::PageTransitionCoreTypeIs(transition_type,
341 ui::PAGE_TRANSITION_RELOAD) && 341 ui::PAGE_TRANSITION_RELOAD) &&
342 nav_type == content::NAVIGATION_TYPE_EXISTING_PAGE && 342 nav_type == content::NavigationType::EXISTING_PAGE &&
343 IsPrintPreviewURL(details->previous_url)) { 343 IsPrintPreviewURL(details->previous_url)) {
344 return; 344 return;
345 } 345 }
346 } 346 }
347 NOTREACHED(); 347 NOTREACHED();
348 return; 348 return;
349 } 349 }
350 if (details) { 350 if (details) {
351 ui::PageTransition type = details->entry->GetTransitionType(); 351 ui::PageTransition type = details->entry->GetTransitionType();
352 content::NavigationType nav_type = details->type; 352 content::NavigationType nav_type = details->type;
353 if (nav_type == content::NAVIGATION_TYPE_EXISTING_PAGE && 353 if (nav_type == content::NavigationType::EXISTING_PAGE &&
354 (ui::PageTransitionTypeIncludingQualifiersIs( 354 (ui::PageTransitionTypeIncludingQualifiersIs(
355 type, 355 type,
356 ui::PageTransitionFromInt(ui::PAGE_TRANSITION_TYPED | 356 ui::PageTransitionFromInt(ui::PAGE_TRANSITION_TYPED |
357 ui::PAGE_TRANSITION_FROM_ADDRESS_BAR)) || 357 ui::PAGE_TRANSITION_FROM_ADDRESS_BAR)) ||
358 ui::PageTransitionTypeIncludingQualifiersIs(type, 358 ui::PageTransitionTypeIncludingQualifiersIs(type,
359 ui::PAGE_TRANSITION_LINK))) 359 ui::PAGE_TRANSITION_LINK)))
360 return; 360 return;
361 } 361 }
362 362
363 RemoveInitiator(contents); 363 RemoveInitiator(contents);
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
471 if (initiator) { 471 if (initiator) {
472 RemoveObservers(initiator); 472 RemoveObservers(initiator);
473 PrintViewManager::FromWebContents(initiator)->PrintPreviewDone(); 473 PrintViewManager::FromWebContents(initiator)->PrintPreviewDone();
474 } 474 }
475 475
476 preview_dialog_map_.erase(preview_dialog); 476 preview_dialog_map_.erase(preview_dialog);
477 RemoveObservers(preview_dialog); 477 RemoveObservers(preview_dialog);
478 } 478 }
479 479
480 } // namespace printing 480 } // namespace printing
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698