| 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/options/options_ui.h" | 5 #include "chrome/browser/ui/webui/options/options_ui.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| (...skipping 401 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 412 continue; | 412 continue; |
| 413 } | 413 } |
| 414 base::DictionaryValue* entry = new base::DictionaryValue(); | 414 base::DictionaryValue* entry = new base::DictionaryValue(); |
| 415 entry->SetString("title", match.description); | 415 entry->SetString("title", match.description); |
| 416 entry->SetString("displayURL", match.contents); | 416 entry->SetString("displayURL", match.contents); |
| 417 entry->SetString("url", match.destination_url.spec()); | 417 entry->SetString("url", match.destination_url.spec()); |
| 418 suggestions->Append(entry); | 418 suggestions->Append(entry); |
| 419 } | 419 } |
| 420 } | 420 } |
| 421 | 421 |
| 422 // static | |
| 423 base::RefCountedMemory* OptionsUI::GetFaviconResourceBytes( | |
| 424 ui::ScaleFactor scale_factor) { | |
| 425 return ui::ResourceBundle::GetSharedInstance(). | |
| 426 LoadDataResourceBytesForScale(IDR_SETTINGS_FAVICON, scale_factor); | |
| 427 } | |
| 428 | |
| 429 void OptionsUI::DidStartProvisionalLoadForFrame( | 422 void OptionsUI::DidStartProvisionalLoadForFrame( |
| 430 content::RenderFrameHost* render_frame_host, | 423 content::RenderFrameHost* render_frame_host, |
| 431 const GURL& validated_url, | 424 const GURL& validated_url, |
| 432 bool is_error_page, | 425 bool is_error_page, |
| 433 bool is_iframe_srcdoc) { | 426 bool is_iframe_srcdoc) { |
| 434 load_start_time_ = base::Time::Now(); | 427 load_start_time_ = base::Time::Now(); |
| 435 if (render_frame_host->GetRenderViewHost() == | 428 if (render_frame_host->GetRenderViewHost() == |
| 436 web_ui()->GetWebContents()->GetRenderViewHost() && | 429 web_ui()->GetWebContents()->GetRenderViewHost() && |
| 437 validated_url.host() == chrome::kChromeUISettingsFrameHost) { | 430 validated_url.host() == chrome::kChromeUISettingsFrameHost) { |
| 438 for (size_t i = 0; i < handlers_.size(); ++i) | 431 for (size_t i = 0; i < handlers_.size(); ++i) |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 492 // Add only if handler's service is enabled. | 485 // Add only if handler's service is enabled. |
| 493 if (handler->IsEnabled()) { | 486 if (handler->IsEnabled()) { |
| 494 // Add handler to the list and also pass the ownership. | 487 // Add handler to the list and also pass the ownership. |
| 495 web_ui()->AddMessageHandler(handler.release()); | 488 web_ui()->AddMessageHandler(handler.release()); |
| 496 handler_raw->GetLocalizedValues(localized_strings); | 489 handler_raw->GetLocalizedValues(localized_strings); |
| 497 handlers_.push_back(handler_raw); | 490 handlers_.push_back(handler_raw); |
| 498 } | 491 } |
| 499 } | 492 } |
| 500 | 493 |
| 501 } // namespace options | 494 } // namespace options |
| OLD | NEW |