| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/webui/ntp/new_tab_ui.h" | 5 #include "chrome/browser/ui/webui/ntp/new_tab_ui.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 | 8 |
| 9 #include "base/i18n/rtl.h" | 9 #include "base/i18n/rtl.h" |
| 10 #include "base/memory/ref_counted_memory.h" | 10 #include "base/memory/ref_counted_memory.h" |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 base::Bind(&NewTabUI::OnShowBookmarkBarChanged, | 89 base::Bind(&NewTabUI::OnShowBookmarkBarChanged, |
| 90 base::Unretained(this))); | 90 base::Unretained(this))); |
| 91 } | 91 } |
| 92 | 92 |
| 93 NewTabUI::~NewTabUI() {} | 93 NewTabUI::~NewTabUI() {} |
| 94 | 94 |
| 95 void NewTabUI::OnShowBookmarkBarChanged() { | 95 void NewTabUI::OnShowBookmarkBarChanged() { |
| 96 base::StringValue attached( | 96 base::StringValue attached( |
| 97 GetProfile()->GetPrefs()->GetBoolean(bookmarks::prefs::kShowBookmarkBar) ? | 97 GetProfile()->GetPrefs()->GetBoolean(bookmarks::prefs::kShowBookmarkBar) ? |
| 98 "true" : "false"); | 98 "true" : "false"); |
| 99 web_ui()->CallJavascriptFunction("ntp.setBookmarkBarAttached", attached); | 99 web_ui()->CallJavascriptFunctionUnsafe("ntp.setBookmarkBarAttached", |
| 100 attached); |
| 100 } | 101 } |
| 101 | 102 |
| 102 // static | 103 // static |
| 103 void NewTabUI::RegisterProfilePrefs( | 104 void NewTabUI::RegisterProfilePrefs( |
| 104 user_prefs::PrefRegistrySyncable* registry) { | 105 user_prefs::PrefRegistrySyncable* registry) { |
| 105 CoreAppLauncherHandler::RegisterProfilePrefs(registry); | 106 CoreAppLauncherHandler::RegisterProfilePrefs(registry); |
| 106 AppLauncherHandler::RegisterProfilePrefs(registry); | 107 AppLauncherHandler::RegisterProfilePrefs(registry); |
| 107 } | 108 } |
| 108 | 109 |
| 109 // static | 110 // static |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 235 void NewTabUI::NewTabHTMLSource::AddResource(const char* resource, | 236 void NewTabUI::NewTabHTMLSource::AddResource(const char* resource, |
| 236 const char* mime_type, | 237 const char* mime_type, |
| 237 int resource_id) { | 238 int resource_id) { |
| 238 DCHECK(resource); | 239 DCHECK(resource); |
| 239 DCHECK(mime_type); | 240 DCHECK(mime_type); |
| 240 resource_map_[std::string(resource)] = | 241 resource_map_[std::string(resource)] = |
| 241 std::make_pair(std::string(mime_type), resource_id); | 242 std::make_pair(std::string(mime_type), resource_id); |
| 242 } | 243 } |
| 243 | 244 |
| 244 NewTabUI::NewTabHTMLSource::~NewTabHTMLSource() {} | 245 NewTabUI::NewTabHTMLSource::~NewTabHTMLSource() {} |
| OLD | NEW |