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/browser.h" | 5 #include "chrome/browser/browser.h" |
6 | 6 |
7 #include <commdlg.h> | 7 #include <commdlg.h> |
8 #include <shellapi.h> | 8 #include <shellapi.h> |
9 | 9 |
10 #include "base/file_version_info.h" | 10 #include "base/file_version_info.h" |
(...skipping 792 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
803 GetSelectedTabContents()->controller()->LoadURL( | 803 GetSelectedTabContents()->controller()->LoadURL( |
804 homepage_url, PageTransition::AUTO_BOOKMARK); | 804 homepage_url, PageTransition::AUTO_BOOKMARK); |
805 } | 805 } |
806 | 806 |
807 void Browser::StarCurrentTabContents() { | 807 void Browser::StarCurrentTabContents() { |
808 TabContents* tab = GetSelectedTabContents(); | 808 TabContents* tab = GetSelectedTabContents(); |
809 if (!tab || !tab->AsWebContents()) | 809 if (!tab || !tab->AsWebContents()) |
810 return; | 810 return; |
811 | 811 |
812 WebContents* rvh = tab->AsWebContents(); | 812 WebContents* rvh = tab->AsWebContents(); |
813 BookmarkBarModel* model = tab->profile()->GetBookmarkBarModel(); | 813 BookmarkModel* model = tab->profile()->GetBookmarkModel(); |
814 if (!model || !model->IsLoaded()) | 814 if (!model || !model->IsLoaded()) |
815 return; // Ignore requests until bookmarks are loaded. | 815 return; // Ignore requests until bookmarks are loaded. |
816 | 816 |
817 NavigationEntry* entry = rvh->controller()->GetActiveEntry(); | 817 NavigationEntry* entry = rvh->controller()->GetActiveEntry(); |
818 if (!entry) | 818 if (!entry) |
819 return; // Can't star if there is no URL. | 819 return; // Can't star if there is no URL. |
820 const GURL& url = entry->display_url(); | 820 const GURL& url = entry->display_url(); |
821 if (url.is_empty() || !url.is_valid()) | 821 if (url.is_empty() || !url.is_valid()) |
822 return; | 822 return; |
823 | 823 |
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1063 | 1063 |
1064 //////////////////////////////////////////////////////////////////////////////// | 1064 //////////////////////////////////////////////////////////////////////////////// |
1065 // Browser, SelectFileDialog::Listener implementation: | 1065 // Browser, SelectFileDialog::Listener implementation: |
1066 | 1066 |
1067 void Browser::FileSelected(const std::wstring& path, void* params) { | 1067 void Browser::FileSelected(const std::wstring& path, void* params) { |
1068 GURL file_url = net::FilePathToFileURL(path); | 1068 GURL file_url = net::FilePathToFileURL(path); |
1069 if (!file_url.is_empty()) | 1069 if (!file_url.is_empty()) |
1070 OpenURL(file_url, CURRENT_TAB, PageTransition::TYPED); | 1070 OpenURL(file_url, CURRENT_TAB, PageTransition::TYPED); |
1071 } | 1071 } |
1072 | 1072 |
OLD | NEW |