Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(632)

Side by Side Diff: chrome/browser/extensions/api/offscreen_tabs/offscreen_tabs_api.cc

Issue 10443105: Take 2 at implementing activeTab. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: empty -> is_empty Created 8 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « chrome/browser/extensions/active_tab_unittest.cc ('k') | chrome/browser/extensions/api/tabs/execute_code_in_tab_function.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698