| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 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 | 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/user_style_sheet_watcher.h" | 5 #include "chrome/browser/user_style_sheet_watcher.h" |
| 6 | 6 |
| 7 #include "base/base64.h" | 7 #include "base/base64.h" |
| 8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
| 9 #include "chrome/common/notification_service.h" | 9 #include "content/common/notification_service.h" |
| 10 #include "chrome/common/notification_type.h" | 10 #include "content/common/notification_type.h" |
| 11 | 11 |
| 12 namespace { | 12 namespace { |
| 13 | 13 |
| 14 // The subdirectory of the profile that contains the style sheet. | 14 // The subdirectory of the profile that contains the style sheet. |
| 15 const char kStyleSheetDir[] = "User StyleSheets"; | 15 const char kStyleSheetDir[] = "User StyleSheets"; |
| 16 // The filename of the stylesheet. | 16 // The filename of the stylesheet. |
| 17 const char kUserStyleSheetFile[] = "Custom.css"; | 17 const char kUserStyleSheetFile[] = "Custom.css"; |
| 18 | 18 |
| 19 } // namespace | 19 } // namespace |
| 20 | 20 |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 157 GURL UserStyleSheetWatcher::user_style_sheet() const { | 157 GURL UserStyleSheetWatcher::user_style_sheet() const { |
| 158 return loader_->user_style_sheet(); | 158 return loader_->user_style_sheet(); |
| 159 } | 159 } |
| 160 | 160 |
| 161 void UserStyleSheetWatcher::Observe(NotificationType type, | 161 void UserStyleSheetWatcher::Observe(NotificationType type, |
| 162 const NotificationSource& source, const NotificationDetails& details) { | 162 const NotificationSource& source, const NotificationDetails& details) { |
| 163 DCHECK(type == NotificationType::RENDER_VIEW_HOST_CREATED_FOR_TAB); | 163 DCHECK(type == NotificationType::RENDER_VIEW_HOST_CREATED_FOR_TAB); |
| 164 loader_->NotifyLoaded(); | 164 loader_->NotifyLoaded(); |
| 165 registrar_.RemoveAll(); | 165 registrar_.RemoveAll(); |
| 166 } | 166 } |
| OLD | NEW |