OLD | NEW |
1 // Copyright (c) 2011 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/browser/profiles/profile.h" | 9 #include "chrome/browser/profiles/profile.h" |
10 #include "chrome/common/chrome_notification_types.h" | 10 #include "chrome/common/chrome_notification_types.h" |
11 #include "content/browser/tab_contents/tab_contents.h" | 11 #include "content/browser/tab_contents/tab_contents.h" |
12 #include "content/public/browser/notification_service.h" | 12 #include "content/public/browser/notification_service.h" |
13 #include "content/public/browser/notification_types.h" | 13 #include "content/public/browser/notification_types.h" |
14 | 14 |
15 using ::base::files::FilePathWatcher; | 15 using ::base::files::FilePathWatcher; |
| 16 using content::BrowserThread; |
16 | 17 |
17 namespace { | 18 namespace { |
18 | 19 |
19 // The subdirectory of the profile that contains the style sheet. | 20 // The subdirectory of the profile that contains the style sheet. |
20 const char kStyleSheetDir[] = "User StyleSheets"; | 21 const char kStyleSheetDir[] = "User StyleSheets"; |
21 // The filename of the stylesheet. | 22 // The filename of the stylesheet. |
22 const char kUserStyleSheetFile[] = "Custom.css"; | 23 const char kUserStyleSheetFile[] = "Custom.css"; |
23 | 24 |
24 } // namespace | 25 } // namespace |
25 | 26 |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
172 const content::NotificationSource& source, | 173 const content::NotificationSource& source, |
173 const content::NotificationDetails& details) { | 174 const content::NotificationDetails& details) { |
174 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 175 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
175 DCHECK(type == content::NOTIFICATION_RENDER_VIEW_HOST_CREATED_FOR_TAB); | 176 DCHECK(type == content::NOTIFICATION_RENDER_VIEW_HOST_CREATED_FOR_TAB); |
176 if (profile_->IsSameProfile(Profile::FromBrowserContext( | 177 if (profile_->IsSameProfile(Profile::FromBrowserContext( |
177 content::Source<TabContents>(source)->browser_context()))) { | 178 content::Source<TabContents>(source)->browser_context()))) { |
178 loader_->NotifyLoaded(); | 179 loader_->NotifyLoaded(); |
179 registrar_.RemoveAll(); | 180 registrar_.RemoveAll(); |
180 } | 181 } |
181 } | 182 } |
OLD | NEW |