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/ui/tab_contents/tab_contents_wrapper.h" | 5 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" |
6 | 6 |
7 #include "base/lazy_instance.h" | 7 #include "base/lazy_instance.h" |
8 #include "chrome/browser/bookmarks/bookmark_model.h" | 8 #include "chrome/browser/bookmarks/bookmark_model.h" |
9 #include "chrome/browser/custom_handlers/protocol_handler_registry.h" | 9 #include "chrome/browser/custom_handlers/protocol_handler_registry.h" |
10 #include "chrome/browser/custom_handlers/register_protocol_handler_infobar_deleg
ate.h" | 10 #include "chrome/browser/custom_handlers/register_protocol_handler_infobar_deleg
ate.h" |
11 #include "chrome/browser/password_manager/password_manager.h" | 11 #include "chrome/browser/password_manager/password_manager.h" |
12 #include "chrome/browser/password_manager_delegate_impl.h" | 12 #include "chrome/browser/password_manager_delegate_impl.h" |
13 #include "chrome/browser/prefs/pref_service.h" | 13 #include "chrome/browser/prefs/pref_service.h" |
14 #include "chrome/browser/profiles/profile.h" | 14 #include "chrome/browser/profiles/profile.h" |
15 #include "chrome/browser/tab_contents/infobar_delegate.h" | 15 #include "chrome/browser/tab_contents/simple_alert_infobar_delegate.h" |
16 #include "chrome/browser/ui/find_bar/find_tab_helper.h" | 16 #include "chrome/browser/ui/find_bar/find_tab_helper.h" |
17 #include "chrome/browser/ui/search_engines/search_engine_tab_helper.h" | 17 #include "chrome/browser/ui/search_engines/search_engine_tab_helper.h" |
18 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper_delegate.h" | 18 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper_delegate.h" |
19 #include "chrome/common/notification_service.h" | 19 #include "chrome/common/notification_service.h" |
20 #include "chrome/common/pref_names.h" | 20 #include "chrome/common/pref_names.h" |
21 #include "chrome/common/render_messages.h" | 21 #include "chrome/common/render_messages.h" |
22 #include "content/browser/tab_contents/tab_contents.h" | 22 #include "content/browser/tab_contents/tab_contents.h" |
| 23 #include "grit/generated_resources.h" |
23 #include "grit/locale_settings.h" | 24 #include "grit/locale_settings.h" |
24 #include "grit/generated_resources.h" | |
25 #include "grit/platform_locale_settings.h" | 25 #include "grit/platform_locale_settings.h" |
26 #include "ui/base/l10n/l10n_util.h" | 26 #include "ui/base/l10n/l10n_util.h" |
27 #include "webkit/glue/webpreferences.h" | 27 #include "webkit/glue/webpreferences.h" |
28 | 28 |
29 static base::LazyInstance<PropertyAccessor<TabContentsWrapper*> > | 29 static base::LazyInstance<PropertyAccessor<TabContentsWrapper*> > |
30 g_tab_contents_wrapper_property_accessor(base::LINKER_INITIALIZED); | 30 g_tab_contents_wrapper_property_accessor(base::LINKER_INITIALIZED); |
31 | 31 |
32 //////////////////////////////////////////////////////////////////////////////// | 32 //////////////////////////////////////////////////////////////////////////////// |
33 // TabContentsWrapper, public: | 33 // TabContentsWrapper, public: |
34 | 34 |
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
251 } | 251 } |
252 | 252 |
253 void TabContentsWrapper::UpdateStarredStateForCurrentURL() { | 253 void TabContentsWrapper::UpdateStarredStateForCurrentURL() { |
254 BookmarkModel* model = tab_contents()->profile()->GetBookmarkModel(); | 254 BookmarkModel* model = tab_contents()->profile()->GetBookmarkModel(); |
255 const bool old_state = is_starred_; | 255 const bool old_state = is_starred_; |
256 is_starred_ = (model && model->IsBookmarked(tab_contents()->GetURL())); | 256 is_starred_ = (model && model->IsBookmarked(tab_contents()->GetURL())); |
257 | 257 |
258 if (is_starred_ != old_state && delegate()) | 258 if (is_starred_ != old_state && delegate()) |
259 delegate()->URLStarredChanged(this, is_starred_); | 259 delegate()->URLStarredChanged(this, is_starred_); |
260 } | 260 } |
OLD | NEW |