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