| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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/tab_contents/web_contents.h" | 5 #include "chrome/browser/tab_contents/web_contents.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
| 9 #include "base/file_version_info.h" | 9 #include "base/file_version_info.h" |
| 10 #include "base/process_util.h" | 10 #include "base/process_util.h" |
| (...skipping 505 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 516 | 516 |
| 517 void WebContents::CreateShortcut() { | 517 void WebContents::CreateShortcut() { |
| 518 NavigationEntry* entry = controller()->GetLastCommittedEntry(); | 518 NavigationEntry* entry = controller()->GetLastCommittedEntry(); |
| 519 if (!entry) | 519 if (!entry) |
| 520 return; | 520 return; |
| 521 | 521 |
| 522 // We only allow one pending install request. By resetting the page id we | 522 // We only allow one pending install request. By resetting the page id we |
| 523 // effectively cancel the pending install request. | 523 // effectively cancel the pending install request. |
| 524 pending_install_.page_id = entry->page_id(); | 524 pending_install_.page_id = entry->page_id(); |
| 525 pending_install_.icon = GetFavIcon(); | 525 pending_install_.icon = GetFavIcon(); |
| 526 pending_install_.title = GetTitle(); | 526 pending_install_.title = UTF16ToWideHack(GetTitle()); |
| 527 pending_install_.url = GetURL(); | 527 pending_install_.url = GetURL(); |
| 528 if (pending_install_.callback_functor) { | 528 if (pending_install_.callback_functor) { |
| 529 pending_install_.callback_functor->Cancel(); | 529 pending_install_.callback_functor->Cancel(); |
| 530 pending_install_.callback_functor = NULL; | 530 pending_install_.callback_functor = NULL; |
| 531 } | 531 } |
| 532 DCHECK(!pending_install_.icon.isNull()) << "Menu item should be disabled."; | 532 DCHECK(!pending_install_.icon.isNull()) << "Menu item should be disabled."; |
| 533 if (pending_install_.title.empty()) | 533 if (pending_install_.title.empty()) |
| 534 pending_install_.title = UTF8ToWide(GetURL().spec()); | 534 pending_install_.title = UTF8ToWide(GetURL().spec()); |
| 535 | 535 |
| 536 // Request the application info. When done OnDidGetApplicationInfo is invoked | 536 // Request the application info. When done OnDidGetApplicationInfo is invoked |
| (...skipping 1310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1847 // The favicon url isn't valid. This means there really isn't a favicon, | 1847 // The favicon url isn't valid. This means there really isn't a favicon, |
| 1848 // or the favicon url wasn't obtained before the load started. This assumes | 1848 // or the favicon url wasn't obtained before the load started. This assumes |
| 1849 // the later. | 1849 // the later. |
| 1850 // TODO(sky): Need a way to set the favicon that doesn't involve generating | 1850 // TODO(sky): Need a way to set the favicon that doesn't involve generating |
| 1851 // its url. | 1851 // its url. |
| 1852 new_url->SetFavIconURL(TemplateURL::GenerateFaviconURL(params.referrer)); | 1852 new_url->SetFavIconURL(TemplateURL::GenerateFaviconURL(params.referrer)); |
| 1853 } | 1853 } |
| 1854 new_url->set_safe_for_autoreplace(true); | 1854 new_url->set_safe_for_autoreplace(true); |
| 1855 url_model->Add(new_url); | 1855 url_model->Add(new_url); |
| 1856 } | 1856 } |
| OLD | NEW |