| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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/browser_commands.h" | 5 #include "chrome/browser/ui/browser_commands.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/metrics/histogram.h" | 8 #include "base/metrics/histogram.h" |
| 9 #include "base/prefs/pref_service.h" | 9 #include "base/prefs/pref_service.h" |
| 10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 | 113 |
| 114 namespace chrome { | 114 namespace chrome { |
| 115 namespace { | 115 namespace { |
| 116 | 116 |
| 117 bool CanBookmarkCurrentPageInternal(const Browser* browser, | 117 bool CanBookmarkCurrentPageInternal(const Browser* browser, |
| 118 bool check_remove_bookmark_ui) { | 118 bool check_remove_bookmark_ui) { |
| 119 BookmarkModel* model = | 119 BookmarkModel* model = |
| 120 BookmarkModelFactory::GetForProfile(browser->profile()); | 120 BookmarkModelFactory::GetForProfile(browser->profile()); |
| 121 return browser_defaults::bookmarks_enabled && | 121 return browser_defaults::bookmarks_enabled && |
| 122 browser->profile()->GetPrefs()->GetBoolean( | 122 browser->profile()->GetPrefs()->GetBoolean( |
| 123 prefs::kEditBookmarksEnabled) && | 123 bookmarks::prefs::kEditBookmarksEnabled) && |
| 124 model && model->loaded() && browser->is_type_tabbed() && | 124 model && model->loaded() && browser->is_type_tabbed() && |
| 125 (!check_remove_bookmark_ui || | 125 (!check_remove_bookmark_ui || |
| 126 !chrome::ShouldRemoveBookmarkThisPageUI(browser->profile())); | 126 !chrome::ShouldRemoveBookmarkThisPageUI(browser->profile())); |
| 127 } | 127 } |
| 128 | 128 |
| 129 bool GetBookmarkOverrideCommand( | 129 bool GetBookmarkOverrideCommand( |
| 130 Profile* profile, | 130 Profile* profile, |
| 131 const extensions::Extension** extension, | 131 const extensions::Extension** extension, |
| 132 extensions::Command* command, | 132 extensions::Command* command, |
| 133 extensions::CommandService::ExtensionCommandType* command_type) { | 133 extensions::CommandService::ExtensionCommandType* command_type) { |
| (...skipping 1147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1281 browser->profile(), | 1281 browser->profile(), |
| 1282 browser->host_desktop_type())); | 1282 browser->host_desktop_type())); |
| 1283 app_browser->tab_strip_model()->AppendWebContents(contents, true); | 1283 app_browser->tab_strip_model()->AppendWebContents(contents, true); |
| 1284 | 1284 |
| 1285 contents->GetMutableRendererPrefs()->can_accept_load_drops = false; | 1285 contents->GetMutableRendererPrefs()->can_accept_load_drops = false; |
| 1286 contents->GetRenderViewHost()->SyncRendererPrefs(); | 1286 contents->GetRenderViewHost()->SyncRendererPrefs(); |
| 1287 app_browser->window()->Show(); | 1287 app_browser->window()->Show(); |
| 1288 } | 1288 } |
| 1289 | 1289 |
| 1290 } // namespace chrome | 1290 } // namespace chrome |
| OLD | NEW |