OLD | NEW |
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 318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
329 | 329 |
330 if (contents == preview_dialog) { | 330 if (contents == preview_dialog) { |
331 // Preview dialog navigated. | 331 // Preview dialog navigated. |
332 if (details) { | 332 if (details) { |
333 ui::PageTransition transition_type = | 333 ui::PageTransition transition_type = |
334 details->entry->GetTransitionType(); | 334 details->entry->GetTransitionType(); |
335 content::NavigationType nav_type = details->type; | 335 content::NavigationType nav_type = details->type; |
336 | 336 |
337 // New |preview_dialog| is created. Don't update/erase map entry. | 337 // New |preview_dialog| is created. Don't update/erase map entry. |
338 if (waiting_for_new_preview_page_ && | 338 if (waiting_for_new_preview_page_ && |
339 transition_type == ui::PAGE_TRANSITION_AUTO_TOPLEVEL && | 339 ui::PageTransitionCoreTypeIs(transition_type, |
| 340 ui::PAGE_TRANSITION_AUTO_TOPLEVEL) && |
340 nav_type == content::NAVIGATION_TYPE_NEW_PAGE) { | 341 nav_type == content::NAVIGATION_TYPE_NEW_PAGE) { |
341 waiting_for_new_preview_page_ = false; | 342 waiting_for_new_preview_page_ = false; |
342 SaveInitiatorTitle(preview_dialog); | 343 SaveInitiatorTitle(preview_dialog); |
343 return; | 344 return; |
344 } | 345 } |
345 | 346 |
346 // Cloud print sign-in causes a reload. | 347 // Cloud print sign-in causes a reload. |
347 if (!waiting_for_new_preview_page_ && | 348 if (!waiting_for_new_preview_page_ && |
348 transition_type == ui::PAGE_TRANSITION_RELOAD && | 349 ui::PageTransitionCoreTypeIs(transition_type, |
| 350 ui::PAGE_TRANSITION_RELOAD) && |
349 nav_type == content::NAVIGATION_TYPE_EXISTING_PAGE && | 351 nav_type == content::NAVIGATION_TYPE_EXISTING_PAGE && |
350 IsPrintPreviewURL(details->previous_url)) { | 352 IsPrintPreviewURL(details->previous_url)) { |
351 return; | 353 return; |
352 } | 354 } |
353 } | 355 } |
354 NOTREACHED(); | 356 NOTREACHED(); |
355 return; | 357 return; |
356 } | 358 } |
357 | 359 |
358 RemoveInitiator(contents); | 360 RemoveInitiator(contents); |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
484 if (initiator) { | 486 if (initiator) { |
485 RemoveObservers(initiator); | 487 RemoveObservers(initiator); |
486 PrintViewManager::FromWebContents(initiator)->PrintPreviewDone(); | 488 PrintViewManager::FromWebContents(initiator)->PrintPreviewDone(); |
487 } | 489 } |
488 | 490 |
489 preview_dialog_map_.erase(preview_dialog); | 491 preview_dialog_map_.erase(preview_dialog); |
490 RemoveObservers(preview_dialog); | 492 RemoveObservers(preview_dialog); |
491 } | 493 } |
492 | 494 |
493 } // namespace printing | 495 } // namespace printing |
OLD | NEW |