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

Side by Side Diff: chrome/browser/extensions/extension_webnavigation_api.cc

Issue 7647026: base: Add three helper functions to Values API. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix a typo Ceate -> Create Created 9 years, 4 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
« no previous file with comments | « chrome/browser/extensions/extension_tabs_module.cc ('k') | chrome/browser/history/top_sites.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 // Implements the Chrome Extensions WebNavigation API. 5 // Implements the Chrome Extensions WebNavigation API.
6 6
7 #include "chrome/browser/extensions/extension_webnavigation_api.h" 7 #include "chrome/browser/extensions/extension_webnavigation_api.h"
8 8
9 #include "base/json/json_writer.h" 9 #include "base/json/json_writer.h"
10 #include "base/lazy_instance.h" 10 #include "base/lazy_instance.h"
(...skipping 581 matching lines...) Expand 10 before | Expand all | Expand 10 after
592 DictionaryValue* details; 592 DictionaryValue* details;
593 EXTENSION_FUNCTION_VALIDATE(args_->GetDictionary(0, &details)); 593 EXTENSION_FUNCTION_VALIDATE(args_->GetDictionary(0, &details));
594 DCHECK(details); 594 DCHECK(details);
595 595
596 int tab_id; 596 int tab_id;
597 int frame_id; 597 int frame_id;
598 EXTENSION_FUNCTION_VALIDATE(details->GetInteger(keys::kTabIdKey, &tab_id)); 598 EXTENSION_FUNCTION_VALIDATE(details->GetInteger(keys::kTabIdKey, &tab_id));
599 EXTENSION_FUNCTION_VALIDATE( 599 EXTENSION_FUNCTION_VALIDATE(
600 details->GetInteger(keys::kFrameIdKey, &frame_id)); 600 details->GetInteger(keys::kFrameIdKey, &frame_id));
601 601
602 result_.reset(Value::CreateNullValue()); 602 result_.reset(base::NullValue());
603 603
604 TabContentsWrapper* wrapper; 604 TabContentsWrapper* wrapper;
605 if (!ExtensionTabUtil::GetTabById( 605 if (!ExtensionTabUtil::GetTabById(
606 tab_id, profile(), include_incognito(), NULL, NULL, &wrapper, NULL) || 606 tab_id, profile(), include_incognito(), NULL, NULL, &wrapper, NULL) ||
607 !wrapper) { 607 !wrapper) {
608 return true; 608 return true;
609 } 609 }
610 610
611 TabContents* tab_contents = wrapper->tab_contents(); 611 TabContents* tab_contents = wrapper->tab_contents();
612 ExtensionWebNavigationTabObserver* observer = 612 ExtensionWebNavigationTabObserver* observer =
(...skipping 11 matching lines...) Expand all
624 DictionaryValue* resultDict = new DictionaryValue(); 624 DictionaryValue* resultDict = new DictionaryValue();
625 resultDict->SetString( 625 resultDict->SetString(
626 keys::kUrlKey, 626 keys::kUrlKey,
627 frame_navigation_state.GetUrl(frame_id).spec()); 627 frame_navigation_state.GetUrl(frame_id).spec());
628 resultDict->SetBoolean( 628 resultDict->SetBoolean(
629 keys::kErrorOccurredKey, 629 keys::kErrorOccurredKey,
630 frame_navigation_state.GetErrorOccurredInFrame(frame_id)); 630 frame_navigation_state.GetErrorOccurredInFrame(frame_id));
631 result_.reset(resultDict); 631 result_.reset(resultDict);
632 return true; 632 return true;
633 } 633 }
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_tabs_module.cc ('k') | chrome/browser/history/top_sites.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698