| 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/extensions/api/offscreen_tabs/offscreen_tabs_api.h" | 5 #include "chrome/browser/extensions/api/offscreen_tabs/offscreen_tabs_api.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/hash_tables.h" | 10 #include "base/hash_tables.h" |
| (...skipping 784 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 795 OffscreenTab* offscreen_tab = NULL; | 795 OffscreenTab* offscreen_tab = NULL; |
| 796 if (!GetMap()->GetOffscreenTab( | 796 if (!GetMap()->GetOffscreenTab( |
| 797 offscreen_tab_id, this, &offscreen_tab, &error_)) | 797 offscreen_tab_id, this, &offscreen_tab, &error_)) |
| 798 return false; | 798 return false; |
| 799 | 799 |
| 800 DictionaryValue* update_props; | 800 DictionaryValue* update_props; |
| 801 EXTENSION_FUNCTION_VALIDATE(args_->GetDictionary(1, &update_props)); | 801 EXTENSION_FUNCTION_VALIDATE(args_->GetDictionary(1, &update_props)); |
| 802 | 802 |
| 803 tab_contents_ = offscreen_tab->tab_contents(); | 803 tab_contents_ = offscreen_tab->tab_contents(); |
| 804 bool is_async = false; | 804 bool is_async = false; |
| 805 if (!UpdateURLIfPresent(update_props, &is_async)) | 805 if (!UpdateURLIfPresent(update_props, offscreen_tab_id, &is_async)) |
| 806 return false; | 806 return false; |
| 807 | 807 |
| 808 // Update the width and height, if specified. | 808 // Update the width and height, if specified. |
| 809 if (update_props->HasKey(tabs_keys::kWidthKey) || | 809 if (update_props->HasKey(tabs_keys::kWidthKey) || |
| 810 update_props->HasKey(tabs_keys::kHeightKey)) { | 810 update_props->HasKey(tabs_keys::kHeightKey)) { |
| 811 const gfx::Size& size = | 811 const gfx::Size& size = |
| 812 tab_contents_->web_contents()->GetView()->GetContainerSize(); | 812 tab_contents_->web_contents()->GetView()->GetContainerSize(); |
| 813 | 813 |
| 814 int width; | 814 int width; |
| 815 if (update_props->HasKey(tabs_keys::kWidthKey)) | 815 if (update_props->HasKey(tabs_keys::kWidthKey)) |
| (...skipping 16 matching lines...) Expand all Loading... |
| 832 // async case (when a "javascript": URL is sent to a tab). | 832 // async case (when a "javascript": URL is sent to a tab). |
| 833 if (!is_async) | 833 if (!is_async) |
| 834 SendResponse(true); | 834 SendResponse(true); |
| 835 | 835 |
| 836 return true; | 836 return true; |
| 837 } | 837 } |
| 838 | 838 |
| 839 void UpdateOffscreenTabFunction::PopulateResult() { | 839 void UpdateOffscreenTabFunction::PopulateResult() { |
| 840 // There's no result associated with this callback. | 840 // There's no result associated with this callback. |
| 841 } | 841 } |
| OLD | NEW |