| 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/bookmarks/bookmark_manager_extension_api.h" | 5 #include "chrome/browser/bookmarks/bookmark_manager_extension_api.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/json/json_writer.h" | 9 #include "base/json/json_writer.h" |
| 10 #include "base/string_number_conversions.h" | 10 #include "base/string_number_conversions.h" |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" | 22 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" |
| 23 #include "chrome/browser/ui/webui/chrome_url_data_manager.h" | 23 #include "chrome/browser/ui/webui/chrome_url_data_manager.h" |
| 24 #include "chrome/browser/view_type_utils.h" | 24 #include "chrome/browser/view_type_utils.h" |
| 25 #include "chrome/common/pref_names.h" | 25 #include "chrome/common/pref_names.h" |
| 26 #include "content/public/browser/render_view_host.h" | 26 #include "content/public/browser/render_view_host.h" |
| 27 #include "content/public/browser/web_contents.h" | 27 #include "content/public/browser/web_contents.h" |
| 28 #include "content/public/browser/web_ui.h" | 28 #include "content/public/browser/web_ui.h" |
| 29 #include "grit/generated_resources.h" | 29 #include "grit/generated_resources.h" |
| 30 #include "ui/base/l10n/l10n_util.h" | 30 #include "ui/base/l10n/l10n_util.h" |
| 31 | 31 |
| 32 #if defined(OS_WIN) |
| 33 #include "base/win/metro.h" |
| 34 #endif // OS_WIN |
| 35 |
| 32 namespace keys = bookmark_extension_api_constants; | 36 namespace keys = bookmark_extension_api_constants; |
| 33 | 37 |
| 34 using content::WebContents; | 38 using content::WebContents; |
| 35 | 39 |
| 36 namespace { | 40 namespace { |
| 37 | 41 |
| 38 // Returns a single bookmark node from the argument ID. | 42 // Returns a single bookmark node from the argument ID. |
| 39 // This returns NULL in case of failure. | 43 // This returns NULL in case of failure. |
| 40 const BookmarkNode* GetNodeFromArguments(BookmarkModel* model, | 44 const BookmarkNode* GetNodeFromArguments(BookmarkModel* model, |
| 41 const ListValue* args) { | 45 const ListValue* args) { |
| (...skipping 451 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 493 bool CanEditBookmarkManagerFunction::RunImpl() { | 497 bool CanEditBookmarkManagerFunction::RunImpl() { |
| 494 result_.reset(Value::CreateBooleanValue( | 498 result_.reset(Value::CreateBooleanValue( |
| 495 profile_->GetPrefs()->GetBoolean(prefs::kEditBookmarksEnabled))); | 499 profile_->GetPrefs()->GetBoolean(prefs::kEditBookmarksEnabled))); |
| 496 return true; | 500 return true; |
| 497 } | 501 } |
| 498 | 502 |
| 499 bool RecordLaunchBookmarkFunction::RunImpl() { | 503 bool RecordLaunchBookmarkFunction::RunImpl() { |
| 500 bookmark_utils::RecordBookmarkLaunch(bookmark_utils::LAUNCH_MANAGER); | 504 bookmark_utils::RecordBookmarkLaunch(bookmark_utils::LAUNCH_MANAGER); |
| 501 return true; | 505 return true; |
| 502 } | 506 } |
| 507 |
| 508 bool CanOpenNewWindowsBookmarkFunction::RunImpl() { |
| 509 bool can_open_new_windows = true; |
| 510 |
| 511 #if defined(OS_WIN) |
| 512 if (base::win::GetMetroModule()) |
| 513 can_open_new_windows = false; |
| 514 #endif // OS_WIN |
| 515 |
| 516 result_.reset(Value::CreateBooleanValue(can_open_new_windows)); |
| 517 return true; |
| 518 } |
| OLD | NEW |