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/arc/arc_support_host.cc

Issue 2615793002: arc: Fix situation when ARC cannot be disabled safely. (Closed)
Patch Set: Created 3 years, 11 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/arc/arc_support_host.h" 5 #include "chrome/browser/chromeos/arc/arc_support_host.h"
6 6
7 #include <string> 7 #include <string>
8 #include <utility> 8 #include <utility>
9 9
10 #include "ash/common/system/chromeos/devicetype_utils.h" 10 #include "ash/common/system/chromeos/devicetype_utils.h"
(...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after
358 Close(); 358 Close();
359 } else if (ui_page_ == UIPage::ERROR) { 359 } else if (ui_page_ == UIPage::ERROR) {
360 ShowError(error_, should_show_send_feedback_); 360 ShowError(error_, should_show_send_feedback_);
361 } else { 361 } else {
362 ShowPage(ui_page_); 362 ShowPage(ui_page_);
363 } 363 }
364 } 364 }
365 365
366 void ArcSupportHost::UnsetMessageHost( 366 void ArcSupportHost::UnsetMessageHost(
367 arc::ArcSupportMessageHost* message_host) { 367 arc::ArcSupportMessageHost* message_host) {
368 if (message_host_ != message_host) 368 if (message_host_ == message_host)
369 return; 369 DisconnectMessageHost();
370 DisconnectMessageHost(); 370
371 // There is possible scenario when page is requested to close and then
372 // requested to show again soon. In this case OpenApplication may be ignored
hidehiko 2017/01/05 08:18:02 Who ignores the OpenApplication()? I couldn't find
khmel 2017/01/05 22:55:53 Sorry, I don't exactly know code that prevents run
hidehiko 2017/01/06 14:25:36 I'm not against fixing ArcSupportHost, rather if t
khmel 2017/01/10 02:17:12 Acknowledged.
373 // because app is still
374 // active. Now, when app is finally closed and pending request is open,
375 // try to open app again.
376 if (app_start_pending_)
377 request_open_app_callback_.Run(profile_);
371 } 378 }
372 379
373 void ArcSupportHost::DisconnectMessageHost() { 380 void ArcSupportHost::DisconnectMessageHost() {
374 DCHECK(message_host_); 381 DCHECK(message_host_);
375 display::Screen* screen = display::Screen::GetScreen(); 382 display::Screen* screen = display::Screen::GetScreen();
376 if (screen) 383 if (screen)
377 screen->RemoveObserver(this); 384 screen->RemoveObserver(this);
378 message_host_->SetObserver(nullptr); 385 message_host_->SetObserver(nullptr);
379 message_host_ = nullptr; 386 message_host_ = nullptr;
380 } 387 }
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
544 for (auto& observer : observer_list_) 551 for (auto& observer : observer_list_)
545 observer.OnRetryClicked(); 552 observer.OnRetryClicked();
546 } else if (event == kEventOnSendFeedbackClicked) { 553 } else if (event == kEventOnSendFeedbackClicked) {
547 for (auto& observer : observer_list_) 554 for (auto& observer : observer_list_)
548 observer.OnSendFeedbackClicked(); 555 observer.OnSendFeedbackClicked();
549 } else { 556 } else {
550 LOG(ERROR) << "Unknown message: " << event; 557 LOG(ERROR) << "Unknown message: " << event;
551 NOTREACHED(); 558 NOTREACHED();
552 } 559 }
553 } 560 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698