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

Side by Side Diff: chrome/browser/chromeos/net/network_portal_notification_controller.cc

Issue 2098023002: mash: Migrate remaining tray observers and notify functions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Sync and rebase. Created 4 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 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 "chrome/browser/chromeos/net/network_portal_notification_controller.h" 5 #include "chrome/browser/chromeos/net/network_portal_notification_controller.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include <memory> 9 #include <memory>
10 #include <vector> 10 #include <vector>
11 11
12 #include "ash/common/system/system_notifier.h" 12 #include "ash/common/system/system_notifier.h"
13 #include "ash/shell.h" 13 #include "ash/common/system/tray/system_tray_notifier.h"
14 #include "ash/system/tray/system_tray_notifier.h" 14 #include "ash/common/wm_shell.h"
15 #include "base/command_line.h" 15 #include "base/command_line.h"
16 #include "base/compiler_specific.h" 16 #include "base/compiler_specific.h"
17 #include "base/macros.h" 17 #include "base/macros.h"
18 #include "base/memory/ref_counted.h" 18 #include "base/memory/ref_counted.h"
19 #include "base/message_loop/message_loop.h" 19 #include "base/message_loop/message_loop.h"
20 #include "base/metrics/histogram.h" 20 #include "base/metrics/histogram.h"
21 #include "base/strings/string16.h" 21 #include "base/strings/string16.h"
22 #include "base/strings/string_number_conversions.h" 22 #include "base/strings/string_number_conversions.h"
23 #include "base/strings/utf_string_conversions.h" 23 #include "base/strings/utf_string_conversions.h"
24 #include "chrome/browser/browser_process.h" 24 #include "chrome/browser/browser_process.h"
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after
294 // Don't do anything if we're currently activating the device. 294 // Don't do anything if we're currently activating the device.
295 if (MobileActivator::GetInstance()->RunningActivation()) 295 if (MobileActivator::GetInstance()->RunningActivation())
296 return; 296 return;
297 297
298 // Don't do anything if notification for |network| already was 298 // Don't do anything if notification for |network| already was
299 // displayed. 299 // displayed.
300 if (network->path() == last_network_path_) 300 if (network->path() == last_network_path_)
301 return; 301 return;
302 last_network_path_ = network->path(); 302 last_network_path_ = network->path();
303 303
304 if (ash::Shell::HasInstance()) { 304 if (ash::WmShell::HasInstance()) {
305 ash::Shell::GetInstance() 305 ash::WmShell::Get()->system_tray_notifier()->NotifyOnCaptivePortalDetected(
306 ->system_tray_notifier() 306 network->path());
307 ->NotifyOnCaptivePortalDetected(network->path());
308 } 307 }
309 308
310 message_center::MessageCenter::Get()->AddNotification( 309 message_center::MessageCenter::Get()->AddNotification(
311 GetNotification(network, state)); 310 GetNotification(network, state));
312 } 311 }
313 312
314 void NetworkPortalNotificationController::ShowDialog() { 313 void NetworkPortalNotificationController::ShowDialog() {
315 if (dialog_) 314 if (dialog_)
316 return; 315 return;
317 316
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
442 if (dialog_) 441 if (dialog_)
443 dialog_->Close(); 442 dialog_->Close();
444 } 443 }
445 444
446 const NetworkPortalWebDialog* 445 const NetworkPortalWebDialog*
447 NetworkPortalNotificationController::GetDialogForTesting() const { 446 NetworkPortalNotificationController::GetDialogForTesting() const {
448 return dialog_; 447 return dialog_;
449 } 448 }
450 449
451 } // namespace chromeos 450 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698