OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "chrome/browser/chromeos/legacy_window_manager/initial_browser_window_o
bserver.h" |
| 6 |
| 7 #include "base/file_path.h" |
| 8 #include "base/file_util.h" |
| 9 #include "base/logging.h" |
| 10 #include "chrome/common/chrome_notification_types.h" |
| 11 #include "content/public/browser/notification_service.h" |
| 12 |
| 13 namespace { |
| 14 |
| 15 // Taken from the --initial_chrome_window_mapped_file flag in the chromeos-wm |
| 16 // command line: http://goo.gl/uLwIL |
| 17 const char kInitialWindowFile[] = |
| 18 "/var/run/state/windowmanager/initial-chrome-window-mapped"; |
| 19 |
| 20 } // namespace |
| 21 |
| 22 namespace chromeos { |
| 23 |
| 24 InitialBrowserWindowObserver::InitialBrowserWindowObserver() { |
| 25 registrar_.Add(this, |
| 26 chrome::NOTIFICATION_BROWSER_WINDOW_READY, |
| 27 content::NotificationService::AllSources()); |
| 28 } |
| 29 |
| 30 void InitialBrowserWindowObserver::Observe( |
| 31 int type, |
| 32 const content::NotificationSource& source, |
| 33 const content::NotificationDetails& details) { |
| 34 registrar_.RemoveAll(); |
| 35 file_util::WriteFile(FilePath(kInitialWindowFile), "", 0); |
| 36 } |
| 37 |
| 38 } // namespace chromeos |
OLD | NEW |